Object.seal, read references, and code reliability

Oriol _ oriol-bugzilla at hotmail.com
Mon Aug 14 18:44:18 UTC 2017

> Why do you think `[[Get]]` needs a flag? The object will have the flag on it, and `[[Get]]` has the object.

I also think a new flag or something similar is needed, because it would be good to throw if some object in the prototype chain is locked, not necessarily the receiver.
I would expect this:

let locked = Object.lock({});
let inherits = Object.create(locked);
Reflect.get(locked, "foo"); // TypeError
Reflect.get(locked, "foo", {}); // TypeError
Reflect.get({}, "foo", locked); // undefined
Reflect.get(inherits, "foo"); // TypeError


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170814/77b76073/attachment.html>

More information about the es-discuss mailing list