mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
Bug 1317389: Change property attributes for generator and async functions to match ES2015/2017.
Tag #1287
This commit is contained in:
parent
086d14cb8b
commit
22cd310e82
6 changed files with 209 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue