Subj : Re: [SpiderMonkey] JS_SealObject To : Brendan Eich From : ggadwa@voyager.net (Brian Barnes) Date : Tue Jul 22 2003 02:25 pm Brendan Eich wrote: > Brian Barnes wrote: > >> Got a problem with JS_SealObject. >> >> It makes the entire object read-only (overriding my property >> settings). This *might* be the behavior it's supposed to do, which >> means I'm out of luck again. More or less, I'm looking for an easy >> way to make it so you can't ADD properties to objects that I create >> the JS_DefineProperty or JS_NewObject. I can fix the delete by >> making all the properties permanent, but not the add. >> >> If this isn't the behavior, then I've just filed a bug report! :) > > > That's the behavior. It's for shared via prototype ("superglobal") > standard objects, and other cases where you want immutability. > > Why not make your JSClass.addProperty hook fail after you've finished > defining the properties you want? Yeah, that was my original solution, but it meant having a global flag around that had to be sent high after my scripts finished, which seems a little messy. But, that's what I'll have to do! Thanks ... [>] Brian .