diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-04 22:11:58 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:26 -0500 |
commit | f87b1b8850d97eb7c9c9e5adb31594251a934441 (patch) | |
tree | f9bc4892add8ab7127017e533e3a13523d1f2699 /js/src/vm/GeneratorObject.cpp | |
parent | f5fa6cfea7dbd02dd690ac030157c4c94ba7ce63 (diff) | |
download | UXP-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/GeneratorObject.cpp')
-rw-r--r-- | js/src/vm/GeneratorObject.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/src/vm/GeneratorObject.cpp b/js/src/vm/GeneratorObject.cpp index 11c686f28..2f5c63c28 100644 --- a/js/src/vm/GeneratorObject.cpp +++ b/js/src/vm/GeneratorObject.cpp @@ -316,7 +316,8 @@ GlobalObject::initStarGenerators(JSContext* cx, Handle<GlobalObject*> global) RootedObject genFunctionProto(cx, NewSingletonObjectWithFunctionPrototype(cx, global)); if (!genFunctionProto || !JSObject::setDelegate(cx, genFunctionProto)) return false; - if (!LinkConstructorAndPrototype(cx, genFunctionProto, genObjectProto) || + if (!LinkConstructorAndPrototype(cx, genFunctionProto, genObjectProto, JSPROP_READONLY, + JSPROP_READONLY) || !DefineToStringTag(cx, genFunctionProto, cx->names().GeneratorFunction)) { return false; @@ -333,8 +334,11 @@ GlobalObject::initStarGenerators(JSContext* cx, Handle<GlobalObject*> global) SingletonObject)); if (!genFunction) return false; - if (!LinkConstructorAndPrototype(cx, genFunction, genFunctionProto)) + if (!LinkConstructorAndPrototype(cx, genFunction, genFunctionProto, + JSPROP_PERMANENT | JSPROP_READONLY, JSPROP_READONLY)) + { return false; + } global->setReservedSlot(STAR_GENERATOR_OBJECT_PROTO, ObjectValue(*genObjectProto)); global->setReservedSlot(STAR_GENERATOR_FUNCTION, ObjectValue(*genFunction)); |