Closed Bug 1568619 Opened 5 years ago Closed 5 years ago

Disallow BigInt literals for Annex-B non-octal digits

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla70
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.

I can take this next week; will be out of office until Wednesday. Please feel free to steal if appropriate.

Assignee: nobody → wingo
Priority: -- → P1
Keywords: site-compat
Keywords: checkin-needed

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

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

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?

Flags: needinfo?(andrebargull)

(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 as 8n. 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 and 09n invalid similar to the existing error when legacy octal numbers like 07n are used.

Flags: needinfo?(andrebargull)

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: