mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Simplify Error Xray code
This commit is contained in:
parent
4fad420bb8
commit
dd09fc2495
2 changed files with 3 additions and 20 deletions
|
|
@ -636,14 +636,6 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
|||
return true;
|
||||
}
|
||||
|
||||
// Handle the 'name' property for error prototypes.
|
||||
if (IsErrorObjectKey(key) && id == GetJSIDByIndex(cx, XPCJSContext::IDX_NAME)) {
|
||||
RootedId className(cx);
|
||||
ProtoKeyToId(cx, key, &className);
|
||||
FillPropertyDescriptor(desc, wrapper, 0, UndefinedValue());
|
||||
return JS_IdToValue(cx, className, desc.value());
|
||||
}
|
||||
|
||||
// Handle the 'lastIndex' property for RegExp prototypes.
|
||||
if (key == JSProto_RegExp && id == GetJSIDByIndex(cx, XPCJSContext::IDX_LASTINDEX))
|
||||
return getOwnPropertyFromWrapperIfSafe(cx, wrapper, id, desc);
|
||||
|
|
@ -889,10 +881,6 @@ JSXrayTraits::enumerateNames(JSContext* cx, HandleObject wrapper, unsigned flags
|
|||
if (!props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_CONSTRUCTOR)))
|
||||
return false;
|
||||
|
||||
// For Error protoypes, add the 'name' property.
|
||||
if (IsErrorObjectKey(key) && !props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_NAME)))
|
||||
return false;
|
||||
|
||||
// For RegExp protoypes, add the 'lastIndex' property.
|
||||
if (key == JSProto_RegExp && !props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_LASTINDEX)))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue