I believe the intention is to align with public properties on this. Currently,
function thisDoesntThrow() {
class C { get foo() { return 42; } }
let c = new C;
c.foo = "bar";
}
function thisThrows() {
"use strict";
class C { get foo() { return 42; } }
let c = new C;
c.foo = "bar";
};
I believe the intention is to align with public properties on this. Currently,
The current spec doesn't have this behavior for
#foo
. https://tc39.github.io/proposal-private-methods/#sec-privatefieldset returns false instead of throwing, but the callerPutValue
doesn't check the return boolean.