This article covers features introduced in SpiderMonkey 1.8.5
Freeze an object.
Syntax
bool JS_FreezeObject(JSContext *cx, JS::Handle<JSObject*> obj);
| Name | Type | Description | 
|---|---|---|
| cx | JSContext * | The context. Requires request. In a JS_THREADSAFEbuild, the caller must be in a request on thisJSContext. | 
| obj | JS::Handle<JSObject*> | An object to freeze. | 
Description
Freezes an object. This means that other code cannot delete, add or change any properties on the object. See ES5's Object.freeze method.
See also
- MXR ID Search for JS_FreezeObject
- JavaScript Reference: The Object.freezemethod ofObject
- JS_DeepFreezeObject
- bug 492849