JS::RootedObject global(cx, JS::CurrentGlobalOrNull(cx)); //get global object JS::MutableHandleValue val = JS::MutableHandleValue::fromMarkedLocation(&global); JS::Int32Value newNum(42); // create a new number val.set(newNum); // set the value to the new number
JS::RootedObject obj(cx, /* some object */); JS::MutableHandleValue prop(cx); JS_GetProperty(cx, obj, "property-name", prop); //modify the property JS::Int32Value newNum(42); prop.set(newNum);These examples suggest that the MutableHandleValue class is part of the SpiderMonkey API library, a core component of the Mozilla browser engine.