On Sun, Jan 19, 2014 at 7:21 PM, Allen Wirfs-Brock <al...@wirfs-brock.com>wrote:

> It isn't clear that there much need for a global name for
> GeneratorFunction.  If you really eed to access it can always get it via:
>
>    (function *() {}).constructor
>
> (as the always helful generator UMO diagram at
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorfunction-objects
>  tells
> us)
>

SES needs to visit every 'primordial' / 'singleton' object to ensure
they're made immutable and harmless. (Other 'meta' code might also benefit
though I don't know of any examples offhand.)

This job is easier if all such objects are reachable via traversing data
properties.

ES5 contains only one object which this is not true of: [[ThrowTypeError]].
This would have been fine since [[ThrowTypeError]] as specified is
immutable and harmless, but in practice many implementations have bugs or
extensions which make it mutable. We had to add a special case for it to
ensure that it was traversed.
https://code.google.com/p/google-caja/issues/detail?id=1661
https://codereview.appspot.com/8093043/diff/19001/src/com/google/caja/ses/repairES5.js

It would be nice if there was some way in ES6 to make sure SES doesn't miss
any objects — either that every primordial object is reachable via data
properties (more precisely: that there are no preexisting objects which are
reachable only by way of executing some program construct; e.g. Array is
reachable by [].constructor, but is also named Array in the standard
environment), or there is some other way to enumerate them.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to