summaryrefslogtreecommitdiffstats
path: root/js/src/vm/GlobalObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/GlobalObject.cpp')
-rw-r--r--js/src/vm/GlobalObject.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp
index 013208f66..70c33c647 100644
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -586,17 +586,18 @@ GlobalObject::createBlankPrototypeInheriting(JSContext* cx, Handle<GlobalObject*
}
bool
-js::LinkConstructorAndPrototype(JSContext* cx, JSObject* ctor_, JSObject* proto_)
+js::LinkConstructorAndPrototype(JSContext* cx, JSObject* ctor_, JSObject* proto_,
+ unsigned prototypeAttrs, unsigned constructorAttrs)
{
RootedObject ctor(cx, ctor_), proto(cx, proto_);
RootedValue protoVal(cx, ObjectValue(*proto));
RootedValue ctorVal(cx, ObjectValue(*ctor));
- return DefineProperty(cx, ctor, cx->names().prototype, protoVal,
- nullptr, nullptr, JSPROP_PERMANENT | JSPROP_READONLY) &&
- DefineProperty(cx, proto, cx->names().constructor, ctorVal,
- nullptr, nullptr, 0);
+ return DefineProperty(cx, ctor, cx->names().prototype, protoVal, nullptr, nullptr,
+ prototypeAttrs) &&
+ DefineProperty(cx, proto, cx->names().constructor, ctorVal, nullptr, nullptr,
+ constructorAttrs);
}
bool