Subj : Re: [SpiderMonkey] JS_SealObject To : Brian Barnes From : Brendan Eich Date : Mon Jul 21 2003 10:18 pm 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? /be .