Closed Bug 1753682 Opened 2 years ago Closed 6 months ago

console.log() does not emit BigInt in format specifier


(DevTools :: Console, defect, P3)

Firefox 96


(firefox113 fixed)

113 Branch
Tracking Status
firefox113 --- fixed


(Reporter: david, Assigned: shisama07)



(1 file)

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.

Component: Untriaged → Console
Product: Firefox → DevTools

Nicolas will investigate where we lose this message.

Severity: -- → S3
Ever confirmed: true
Flags: needinfo?(nchevobbe)
Priority: -- → P3

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)

Seems like we're hitting this:

Baku, would it be easy to ensure we support BigInt ?

Flags: needinfo?(nchevobbe) → needinfo?(amarchesini)

The fix is simple, I guess. But I don't have the bandwidth to work on it. Nicolas, can you take this?

Flags: needinfo?(amarchesini) → needinfo?(nchevobbe)

alright, let's see if I can do it. I'll ask you to review the patch :)

Flags: needinfo?(nchevobbe)
Assignee: nobody → shisama07
Attachment #9324637 - Attachment description: Bug 1753682 - fix format specifier for BigInt. r=nchevobbe,smaug → 6cBug 1753682 - fix format specifier for BigInt. r=nchevobbe,smaug
Attachment #9324637 - Attachment description: 6cBug 1753682 - fix format specifier for BigInt. r=nchevobbe,smaug → Bug 1753682 - fix format specifier for BigInt. r=nchevobbe,smaug
Pushed by
fix format specifier for BigInt. r=nchevobbe,smaug,devtools-reviewers
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.