mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 00:27:29 +09:00
Issue #2304 - Part 4 - Add xray support for the Error cause property. https://bugzilla.mozilla.org/show_bug.cgi?id=1679653
This commit is contained in:
parent
36285d0405
commit
33c2fae0ba
3 changed files with 7 additions and 0 deletions
|
|
@ -111,6 +111,7 @@ const char* const XPCJSContext::mStrings[] = {
|
||||||
"columnNumber", // IDX_COLUMNNUMBER
|
"columnNumber", // IDX_COLUMNNUMBER
|
||||||
"stack", // IDX_STACK
|
"stack", // IDX_STACK
|
||||||
"message", // IDX_MESSAGE
|
"message", // IDX_MESSAGE
|
||||||
|
"cause", // IDX_CAUSE
|
||||||
"errors", // IDX_ERRORS
|
"errors", // IDX_ERRORS
|
||||||
"lastIndex" // IDX_LASTINDEX
|
"lastIndex" // IDX_LASTINDEX
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -495,6 +495,7 @@ public:
|
||||||
IDX_COLUMNNUMBER ,
|
IDX_COLUMNNUMBER ,
|
||||||
IDX_STACK ,
|
IDX_STACK ,
|
||||||
IDX_MESSAGE ,
|
IDX_MESSAGE ,
|
||||||
|
IDX_CAUSE ,
|
||||||
IDX_ERRORS ,
|
IDX_ERRORS ,
|
||||||
IDX_LASTINDEX ,
|
IDX_LASTINDEX ,
|
||||||
IDX_TOTAL_COUNT // just a count of the above
|
IDX_TOTAL_COUNT // just a count of the above
|
||||||
|
|
|
||||||
|
|
@ -609,6 +609,11 @@ JSXrayTraits::resolveOwnProperty(JSContext* cx, const Wrapper& jsWrapper,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The optional .cause property can have any value.
|
||||||
|
if (id == GetJSIDByIndex(cx, XPCJSContext::IDX_CAUSE)) {
|
||||||
|
return getOwnPropertyFromWrapperIfSafe(cx, wrapper, id, desc);
|
||||||
|
}
|
||||||
|
|
||||||
if (key == JSProto_AggregateError &&
|
if (key == JSProto_AggregateError &&
|
||||||
id == GetJSIDByIndex(cx, XPCJSContext::IDX_ERRORS)) {
|
id == GetJSIDByIndex(cx, XPCJSContext::IDX_ERRORS)) {
|
||||||
return getOwnPropertyFromWrapperIfSafe(cx, wrapper, id, desc);
|
return getOwnPropertyFromWrapperIfSafe(cx, wrapper, id, desc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue