Security Demands Simplicity (was: Private Slots)

Tom Van Cutsem tomvc.be at gmail.com
Mon Jan 21 08:21:06 PST 2013


2013/1/20 Kevin Smith <khs4473 at gmail.com>

>
>  It is not. At the exit of the get trap, the JS engine checks whether
>> invariants should be enforced for the given property on the target. In your
>> case, the runtime sees that the target has a non-configurable non-writable
>> property called 'foo' with 1 as value. When you try to return 0, it will
>> throw a TypeError because of invariant violation. You can read about
>> invariants at
>> http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies#invariant_enforcement
>>
>>
> Excellent - thanks for the link!
>

I wrote an introductory article a while back explaining precisely the
interaction between frozen objects and proxies, and the invariant checks.
Easier to digest than the draft spec on the wiki:
http://soft.vub.ac.be/~tvcutsem/invokedynamic/frozen-proxies

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130121/cf5ea363/attachment.html>


More information about the es-discuss mailing list