Mark S. Miller wrote: > Given the four relationships we seek between ES5 and a future > Cajita-like language (bottom of > <http://code.google.com/p/google-caja/wiki/SubsetRelationships>), does > this argue for one of these possibilities over the other?
To avoid all of the funky exceptions associated with the global scope, subset code should only ever run in a function scope (as it does in Cajita, ADsafe, and Jacaranda). So this issue doesn't matter, I think. > ---------- Forwarded message ---------- > From: Allen Wirfs-Brock <[email protected]> > Date: Mon, Jul 20, 2009 at 4:45 PM > Subject: bug or feature: global declarations create configurable > properties on global object [...] > ES3 says (10.2.1): “Variable instantiation is performed using the > global object as the variable object and using property attributes { > DontDelete }.” In ES5 terms, the attributes of an ES3 global > declaration are {writable: true, enumerable: true, configurable: > false}. This means that in ES3 global var statements or function > declarations create properties on the global object that cannot be > deleted. > > The current ES5 draft, following the logic starting in Declaration > Binding Instantiation (10.5) step 4.d or 5.c.i for global declarations > goes through CreateMutableBinding for ObjectEnviornmentRecords where > we see that [[Put]] is used to create the global object property. > (note this only happens with the property doesn’t already exist). > [[Put]] sets the attributes of a new property to {writable: true, > enumerable: true, configurable: false}. This means that as currently > written ES5 global var statements or function declarations create > properties on the global object that can be deleted. -- David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
