Closed
Bug 1528784
Opened 6 years ago
Closed 6 years ago
BigInt wrapper passed as receiver when retrieving "toJSON" property in JSON.stringify
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla67
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: anba, Assigned: wingo)
References
Details
Attachments
(1 file)
Test case:
Object.defineProperty(BigInt.prototype, "toJSON", {
get() {
"use strict";
return () => typeof this;
}
});
print(JSON.stringify(0n));
Expected: Prints "bigint"
Actual: Prints "object"
Spec:
Runtime Semantics: SerializeJSONProperty calls GetV
which means the primitive value should be passed as the receiver.
Note:
This also fails in V8, so there's probably no test262 test for this case.
Assignee | ||
Comment 1•6 years ago
|
||
test262 PR here: https://github.com/tc39/test262/pull/2079
Assignee: nobody → wingo
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Keywords: checkin-needed
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c6ae678d11d1
Pass BigInt as receiver when retrieving "toJSON" property r=anba
Keywords: checkin-needed
Comment 4•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in
before you can comment on or make changes to this bug.
Description
•