Mark Miller wrote:
> On Fri, Dec 4, 2009 at 9:52 AM, Mark Miller <[email protected]> wrote:
>>> Given that primordials (other than the global object) are transitively
>>> frozen and that the above whitelist was adequately restrictive, each
>>> call of a closed function is fully isolated -- its connectivity to the
>>> world outside itself is fully under control of its caller. If the
>>> module-function's caller denies access to the global object, the
>>> indirect eval function, and to the Function constructor, then the
>>> module cannot pollute non-local state.
> 
> Note that Function.prototype.constructor should either not be on the
> whitelist (and should thereby be deleted), or it should be reassigned
> to something safe during the initial clean-or-die phase. Otherwise
> "(function(){}).constructor" would give access to the Function
> constructor, allowing global pollution after all.
> 
> I cannot currently find in the ES5 spec whether a conforming
> implementation may/must allow Function.prototype.constructor to be
> deleted or reassigned.

It must.

> Where in the spec is this dealt with?

Section 15,

# In every case, the length property of a built-in Function object
# described in this clause has the attributes [blah]. Every other
# property described in this clause has the attributes
# { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
# unless otherwise specified.

(was just looking it up :-)

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to