6

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

 1 year ago
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.
neoserver,ios ssh client
Closed Bug 1753682 Opened 1 year ago Closed 21 days ago

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

Categories

(DevTools :: Console, defect, P3)

Tracking

(firefox113 fixed)

RESOLVED FIXED

113 Branch

Tracking Status
firefox113 --- fixed

People

(Reporter: david, Assigned: shisama07)

Details

ff32d1d0ad8e694363ca07bc0349e9f8?d=mm&size=64
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.

ff32d1d0ad8e694363ca07bc0349e9f8?d=mm&size=64
Reporter

Comment 1

1 year ago

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)

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
Status: ASSIGNED → RESOLVED
Closed: 21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK