Open
Bug 1826233
Opened 2 years ago
Updated 2 years ago
ErrorObject reserved 'cause' slot is aliased
Categories
(Core :: JavaScript Engine, task, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: bthrall, Unassigned)
References
(Blocks 1 open bug)
Details
ErrorObject
has a reserved slot for its cause. When an initial cause is provided (as below), then the reserved slot is used for the "cause" property defined later:
const error = Error(this, { cause: "initial cause" });
Object.defineProperty(error, "cause", { get: () => "cause property" });
throw error;
However, when there is no initial cause, the property ends up in a non-reserved slot:
const error = Error(this);
Object.defineProperty(error, "cause", { get: () => "cause property" });
throw error;
Code that directly uses ErrorObject::getCause()
will not see the "cause" property in this case. For example, the JS shell output does not list the cause as expected because it uses getCause()
.
This does not appear to affect the Firefox Developer Console.
Reporter | ||
Updated•2 years ago
|
Blocks: sm-runtime
Updated•2 years ago
|
Severity: -- → S3
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•