Disallow BigInt literals for Annex-B non-octal digits
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: anba, Assigned: wingo)
References
()
Details
(Keywords: dev-doc-complete, site-compat)
Attachments
(1 file)
https://github.com/tc39/proposal-bigint/issues/208 got consensus at the July 2019 TC39 meeting. That means 08n
is now no longer allowed and instead should throw a SyntaxError.
Assignee | ||
Comment 1•5 years ago
|
||
I can take this next week; will be out of office until Wednesday. Please feel free to steal if appropriate.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Doc update needed (at least) here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_literals
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/b29469828c33
Disallow BigInt literals for Annex-B non-octal digits r=anba
Comment 5•5 years ago
|
||
bugherder |
Comment 6•5 years ago
|
||
Posted site compatibility note: https://www.fxsitecompat.dev/en-CA/docs/2019/bigint-literals-for-non-octal-digits-are-no-longer-allowed/
Comment 7•5 years ago
|
||
I've added this to the Fx 70 for developers release notes: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/70#JavaScript
The reference pages that describes numeric literals has been updated to talk about this, too: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#BigInt_literal
:anba, could you double check if these doc updates are correct?
Reporter | ||
Comment 8•5 years ago
|
||
(In reply to Florian Scholz [:fscholz] (MDN) from comment #7)
I've added this to the Fx 70 for developers release notes: [...]
Thanks!
:anba, could you double check if these doc updates are correct?
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/70#JavaScript:
- Nit: Contains "legacy legacy".
- Even before this bug, legacy octal numbers weren't allowed in BigInt literals, i.e.
0755n
from the example code was always a SyntaxError. But before this bug,08n
was allowed and treated the same as8n
. The spec change made this an error.
So maybe use something along the lines:
Per the latest ECMAScript specification, a leading zero is now never allowed for BigInt literals, making
08n
and09n
invalid similar to the existing error when legacy octal numbers like07n
are used.
Comment 9•5 years ago
|
||
Aha! Then this change is even more subtle than I thought.
Thank you so much for clarifying this, :anba! I've updated the release docs.
Description
•