Closed Bug 1464758 Opened 6 years ago Closed 6 years ago

BigInt shouldn't get the legacy fallback behaviour in Object.prototype.toString

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: anba, Assigned: terpri)

References

Details

Attachments

(1 file)

Test case:
---
delete BigInt.prototype[Symbol.toStringTag];
assertEq(Object.prototype.toString.call(BigInt(0)), "[object Object]");
---

Expected: Test passes
Actual: Object.prototype.toString returns "[object BigInt]"
I would suggest just changing the name in the JSClass field to "Object". Hopefully bug 1277799 is going to be fixed at some point.
Change BigInt's class name to "Object" so that the correct tag is used
when the @@toStringTag property is not a string. Remove special cases
for BigInt in GetBuiltinTagFast and GetBuiltinTagSlow.
Attachment #8981537 - Flags: review?(andrebargull)
Comment on attachment 8981537 [details] [diff] [review]
BigInt shouldn't get the legacy fallback behaviour in Object.prototype.toString.

Review of attachment 8981537 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM!
Attachment #8981537 - Flags: review?(andrebargull) → review+
Attachment #8981537 - Flags: checkin+
Keywords: checkin-needed
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fcf6bdd122ad
BigInt shouldn't get the legacy fallback behaviour in Object.prototype.toString. r=anba
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/fcf6bdd122ad
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Assignee: nobody → robin
You need to log in before you can comment on or make changes to this bug.