Closed Bug 1753682 Opened 3 years ago Closed 2 years ago

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

Categories

(DevTools :: Console, defect, P3)

Firefox 96
defect

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: david, Assigned: shisama07)

Details

Attachments

(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
Status: UNCONFIRMED → NEW
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: https://searchfox.org/mozilla-release/rev/30f8a5a2dd07280e4445f566980522fe876bec70/dom/console/Console.cpp#2003-2005

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
Status: NEW → ASSIGNED
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 nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6dec35cb78f1 fix format specifier for BigInt. r=nchevobbe,smaug,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: