mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1052139 - Make more objects on the global prototype chain have immutable [[Prototype]], when we enable enforcement of this requirement. r=bz
This commit is contained in:
parent
eed6ab5c07
commit
d35ad25a4b
@ -274,13 +274,27 @@ WindowNamedPropertiesHandler::Create(JSContext* aCx,
|
||||
// Note: since the scope polluter proxy lives on the window's prototype
|
||||
// chain, it needs a singleton type to avoid polluting type information
|
||||
// for properties on the window.
|
||||
JS::Rooted<JSObject*> gsp(aCx);
|
||||
js::ProxyOptions options;
|
||||
options.setSingleton(true);
|
||||
options.setClass(&WindowNamedPropertiesClass.mBase);
|
||||
return js::NewProxyObject(aCx, WindowNamedPropertiesHandler::getInstance(),
|
||||
JS::NullHandleValue, aProto,
|
||||
options);
|
||||
|
||||
JS::Rooted<JSObject*> gsp(aCx);
|
||||
gsp = js::NewProxyObject(aCx, WindowNamedPropertiesHandler::getInstance(),
|
||||
JS::NullHandleValue, aProto,
|
||||
options);
|
||||
if (!gsp) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool succeeded;
|
||||
if (!JS_SetImmutablePrototype(aCx, gsp, &succeeded)) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(succeeded,
|
||||
"errors making the [[Prototype]] of the named properties object "
|
||||
"immutable should have been JSAPI failures, not !succeeded");
|
||||
|
||||
return gsp;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -90,9 +90,6 @@ js::GlobalObject::getTypedObjectModule() const {
|
||||
return v.toObject().as<TypedObjectModuleObject>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* static */ bool
|
||||
GlobalObject::ensureConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user