summaryrefslogtreecommitdiffstats
path: root/js/src/vm/GlobalObject.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-04 22:11:58 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:26 -0500
commitf87b1b8850d97eb7c9c9e5adb31594251a934441 (patch)
treef9bc4892add8ab7127017e533e3a13523d1f2699 /js/src/vm/GlobalObject.cpp
parentf5fa6cfea7dbd02dd690ac030157c4c94ba7ce63 (diff)
downloadUXP-f87b1b8850d97eb7c9c9e5adb31594251a934441.tar
UXP-f87b1b8850d97eb7c9c9e5adb31594251a934441.tar.gz
UXP-f87b1b8850d97eb7c9c9e5adb31594251a934441.tar.lz
UXP-f87b1b8850d97eb7c9c9e5adb31594251a934441.tar.xz
UXP-f87b1b8850d97eb7c9c9e5adb31594251a934441.zip
Bug 1317389: Change property attributes for generator and async functions to match ES2015/2017.
Tag #1287
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