Closed
Bug 1971000
Opened 2 months ago
Closed 2 months ago
`SuppressedError` constructor should not accept `cause` argument
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
FIXED
141 Branch
Tracking | Status | |
---|---|---|
firefox141 | --- | fixed |
People
(Reporter: zloirock, Assigned: debadree333)
Details
Attachments
(1 file)
Steps to reproduce:
new SuppressedError(1, 2, 3, { cause: 4 }).cause
Actual results:
4
Expected results:
undefined
Updated•2 months ago
|
Component: Untriaged → JavaScript: Standard Library
Product: Firefox → Core
Comment 1•2 months ago
|
||
Thank you for reporting!
Indeed, the SuppressedError
constructor doesn't receive the options
parameter.
https://arai-a.github.io/ecma262-compare/?pr=3000&id=sec-suppressederror
SuppressedError ( error, suppressed, message )
According to the following issue, not having the cause
support is intentional.
https://github.com/tc39/proposal-explicit-resource-management/issues/147
Thus, we should skip the options handling for SuppressedError below
bool hasOptions = args.get(messageArg + 1).isObject();
Rooted<mozilla::Maybe<Value>> cause(cx, mozilla::Nothing());
if (hasOptions) {
RootedObject options(cx, &args[messageArg + 1].toObject());
bool hasCause = false;
if (!HasProperty(cx, options, cx->names().cause, &hasCause)) {
return nullptr;
}
if (hasCause) {
RootedValue causeValue(cx);
if (!GetProperty(cx, options, options, cx->names().cause, &causeValue)) {
return nullptr;
}
cause = mozilla::Some(causeValue.get());
}
}
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 2•2 months ago
|
||
Updated•2 months ago
|
Assignee: nobody → debadree333
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com:
https://github.com/mozilla-firefox/firefox/commit/686f1afadc73
https://hg.mozilla.org/integration/autoland/rev/5f1a873ef322
Skip cause handling in SuppressedError. r=arai
Comment 4•2 months ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
status-firefox141:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Updated•1 month ago
|
QA Whiteboard: [qa-triage-done-c142/b141]
You need to log in
before you can comment on or make changes to this bug.
Description
•