summaryrefslogtreecommitdiff
path: root/js/src/jsobj.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 19:49:29 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:24 -0400
commit1d0ab1c752c583c153b850af339edb86d23f6cc8 (patch)
treea59897de81ee25b02faad4dd67c08e3acf1272a5 /js/src/jsobj.cpp
parentfe20cd26491f8db4e7304d509a2639cfccf26c7e (diff)
downloaduxp-1d0ab1c752c583c153b850af339edb86d23f6cc8.tar.gz
1320408 - Part 9: Change JSObject::setFlags and depending methods to static method.
Diffstat (limited to 'js/src/jsobj.cpp')
-rw-r--r--js/src/jsobj.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index b08e8a6193..78efca8de3 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1842,7 +1842,7 @@ js::SetClassAndProto(JSContext* cx, HandleObject obj,
if (!oldproto->as<NativeObject>().generateOwnShape(cx))
return false;
} else {
- if (!oldproto->setUncacheableProto(cx))
+ if (!JSObject::setUncacheableProto(cx, oldproto))
return false;
}
if (!obj->isDelegate()) {
@@ -1854,8 +1854,11 @@ js::SetClassAndProto(JSContext* cx, HandleObject obj,
oldproto = oldproto->staticPrototype();
}
- if (proto.isObject() && !proto.toObject()->setDelegate(cx))
- return false;
+ if (proto.isObject()) {
+ RootedObject protoObj(cx, proto.toObject());
+ if (!JSObject::setDelegate(cx, protoObj))
+ return false;
+ }
if (obj->isSingleton()) {
/*
@@ -2611,7 +2614,7 @@ js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, I
}
}
- if (!obj->setFlags(cx, BaseShape::NOT_EXTENSIBLE, JSObject::GENERATE_SHAPE)) {
+ if (!JSObject::setFlags(cx, obj, BaseShape::NOT_EXTENSIBLE, JSObject::GENERATE_SHAPE)) {
// We failed to mark the object non-extensible, so reset the frozen
// flag on the elements.
MOZ_ASSERT(obj->nonProxyIsExtensible());
@@ -2751,7 +2754,7 @@ js::SetImmutablePrototype(ExclusiveContext* cx, HandleObject obj, bool* succeede
return Proxy::setImmutablePrototype(cx->asJSContext(), obj, succeeded);
}
- if (!obj->setFlags(cx, BaseShape::IMMUTABLE_PROTOTYPE))
+ if (!JSObject::setFlags(cx, obj, BaseShape::IMMUTABLE_PROTOTYPE))
return false;
*succeeded = true;
return true;