Subj : Re: Assigning to a nonexistent property To : Braden McDaniel From : Brendan Eich Date : Thu Dec 09 2004 11:09 am Braden McDaniel wrote: > I have defined a type whose JSClass::setProperty is simply > JSPropertyStub. I would have expected an attempt to assign to a property > on instances of this type (e.g., "instance.prop = foo") would result in > an error message. Why? Stub means no-op, usually. And ECMA by default does not seal objects, and stubs are for "most common" default cases. > Instead, I get no error message and the code seems to > be a no-op. Is there something I should be doing to make this an error > condition? (Aside from adding a setter that simply reports an error.) Do you want to seal the object against all future sets, adds, and deletes? If so, consider JS_SealObject (beware passing true for the |deep| param! ;-). /be .