mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
parent
b4a4fb4b3c
commit
5386cd812b
5 changed files with 44 additions and 3 deletions
|
|
@ -1029,13 +1029,17 @@ JS_ResolveStandardClass(JSContext* cx, HandleObject obj, HandleId id, bool* reso
|
|||
|
||||
/* Check whether we're resolving 'undefined', and define it if so. */
|
||||
JSAtom* idAtom = JSID_TO_ATOM(id);
|
||||
JSAtom* undefinedAtom = cx->names().undefined;
|
||||
if (idAtom == undefinedAtom) {
|
||||
if (idAtom == cx->names().undefined) {
|
||||
*resolved = true;
|
||||
return DefineProperty(cx, global, id, UndefinedHandleValue, nullptr, nullptr,
|
||||
JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_RESOLVING);
|
||||
}
|
||||
|
||||
// Resolve a "globalThis" self-referential property if necessary.
|
||||
if (idAtom == cx->names().globalThis) {
|
||||
return GlobalObject::maybeResolveGlobalThis(cx, global, resolved);
|
||||
}
|
||||
|
||||
/* Try for class constructors/prototypes named by well-known atoms. */
|
||||
stdnm = LookupStdName(cx->names(), idAtom, standard_class_names);
|
||||
|
||||
|
|
@ -1088,6 +1092,7 @@ JS_MayResolveStandardClass(const JSAtomState& names, jsid id, JSObject* maybeObj
|
|||
// better, we need a JSContext here; it's fine as it is.)
|
||||
|
||||
return atom == names.undefined ||
|
||||
atom == names.globalThis ||
|
||||
LookupStdName(names, atom, standard_class_names) ||
|
||||
LookupStdName(names, atom, builtin_property_names);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue