Mark S. Miller skrev: > On Wed, Sep 3, 2008 at 10:58 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: >>> If deletable and >>> configurable were distinct, we could make new properties of the global >>> object start as configurable but not deletable. >> Saving perf but to what end? Does the Caja, etc. programming model >> require configurability before freezing for all global props, or a >> few, or one? >> >>> However, adding >>> another attribute to deal with this one problematic case seemed >>> overkill. Allowing non-configurable properties to be made non-writable >>> seems like the simplest adequate solution. >> Not arguing, just recapitulating and asking for the Caja use-case. > > The use case is that the Caja runtime gets loaded into a frame after > writable-but-non-deletable properties that we wish to whitelist have > been added to the global object. The Caja runtime needs to freeze all > whitelisted objects and properties reachable from from the global > object. > > In ES3.1 as we're proposing it, the only way to represent that a > property is non-deletable is to make it non-configurable. If writable > non-configurable properties could not be made non-writable, the use > case above would be screwed.
It would be much better if Object.freeze() got an added parameter, a bit flag that, when set, makes it more powerful and allows it to override the configurability flag. Then the override happens only when you enable it explicitly. Otherwise we have a case of silent failure, and silent failures are often very expensive to debug. -- Ingvar von Schoultz _______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

