Improving Function.prototype.bind

Mark S. Miller erights at google.com
Fri Jan 6 11:35:42 PST 2012


On Fri, Jan 6, 2012 at 10:02 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:
[...]

>  1. everyone can WeakMap = function () {}; anywhere
>>>
>>
>> Again, no they can't because all whitelisted global variables are
>> unassignable.
>>
>>
> it's a var WeakMap in the global scope ... still talking about your shim,
> probably I am missing some dependency?
>

It's easy to miss. "WeakMap" appears as a whitelisted global at
http://code.google.com/p/es-lab/source/browse/trunk/src/ses/whitelist.js#146

At
http://code.google.com/p/es-lab/source/browse/trunk/src/ses/startSES.js#1062we
place all these whitelisted globals on the sharedImports object as
well
as redefine the property as non-writable non-configurable on the global
object.

At
http://code.google.com/p/es-lab/source/browse/trunk/src/ses/startSES.js#1294we
freeze sharedImports and all objects reachable from it by transitive
prototype and reflective property traversal.



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


More information about the es-discuss mailing list