console.log() does not emit BigInt in format specifier
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1753682
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
console.log() does not emit BigInt in format specifier
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox113 fixed)
113 Branch
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: david, Assigned: shisama07)
Details
Reporter | ||
Description•1 year ago
|
||
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
Steps to reproduce:
In console, execute: console.log('foo: %d', BigInt(5))
Actual results:
No message is emitted to console at all
Expected results:
Message "foo: 5n" should be emitted to console.
Not a world-ending priority but this thing completely swallowed diagnostic messages for a module I was working on. In a console-noisy environment, this might not be noticed.
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Nicolas will investigate where we lose this message.
Thanks for filing David, I'll try to see where we block this message.
Small note; according to the spec:
If specifier is %d or %i:
If Type(current) is Symbol, let converted be NaN
Otherwise, let converted be the result of Call(%parseInt%, undefined, « current, 10 »).
So the result should be: foo: 5
(since parseInt(5n)
-> 5
)
The fix is simple, I guess. But I don't have the bandwidth to work on it. Nicolas, can you take this?
alright, let's see if I can do it. I'll ask you to review the patch :)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK