Intent to ship: ES6 numeric literal syntax

83 views
Skip to first unread message

Erik Arvidsson

unread,
Oct 1, 2014, 2:52:00 PM10/1/14
to v8-u...@googlegroups.com, blink-dev
[FYI +blink-dev]

ES6 extends the syntax for defining numbers to allow the number literal to be either binary or octal. (0b10101 and 0o753 respectively) [1]

ES6 numeric literals have been shipping in Firefox since July 2013. [2]

ES6 numeric literals have been available in V8 under a flag since July 2013. [3]



--
erik


John Mellor

unread,
Oct 2, 2014, 7:10:41 AM10/2/14
to Erik Arvidsson, v8-u...@googlegroups.com, blink-dev
Will V8 simultaneously drop support for the legacy 0377 syntax for octal numbers? Or does this mean both will be supported?

Mathias Bynens

unread,
Oct 2, 2014, 7:25:01 AM10/2/14
to John Mellor, Erik Arvidsson, v8-u...@googlegroups.com, blink-dev
On Thu, Oct 2, 2014 at 1:10 PM, John Mellor <joh...@chromium.org> wrote:
> Will V8 simultaneously drop support for the legacy 0377 syntax for octal
> numbers? Or does this mean both will be supported?

The octal literal syntax is part of Annex B, which browsers are
required to implement for Web compatibility.

John Mellor

unread,
Oct 2, 2014, 9:19:31 AM10/2/14
to Mathias Bynens, Erik Arvidsson, v8-u...@googlegroups.com, blink-dev
Do we have any use counters for this? I've never seen anyone deliberately using octal.

Erik Arvidsson

unread,
Oct 2, 2014, 1:22:16 PM10/2/14
to John Mellor, Mathias Bynens, v8-u...@googlegroups.com, blink-dev
We are still supporting LegacyOctalIntegerLiteral in sloppy mode and we cannot change that. The web depends on it.

LegacyOctalIntegerLiteral is pretty common in Node.js for file attributes for example. Once people transition to use 0o777 instead we can revisit LegacyOctalIntegerLiteral but generally these things are really hard to remove.

--
erik


Trevor Norris

unread,
Oct 2, 2014, 11:09:51 PM10/2/14
to v8-u...@googlegroups.com, joh...@chromium.org, math...@opera.com, blin...@chromium.org
On Thursday, October 2, 2014 9:58:20 AM UTC-7, Erik Arvidsson wrote:
LegacyOctalIntegerLiteral is pretty common in Node.js for file attributes for example. Once people transition to use 0o777 instead we can revisit LegacyOctalIntegerLiteral but generally these things are really hard to remove.

Though for people to transition to using ES6 numeric literals they realistically need to be removed from behind the flag?

Support LegacyOctalIntegerLiteral forever if you'd like, but that doesn't mean numeric literals can't be taken out from behind the --harmony_numeric_literals flag.

/trev

Mathias Bynens

unread,
Oct 3, 2014, 5:24:58 AM10/3/14
to v8-u...@googlegroups.com, joh...@chromium.org, blink-dev
On Fri, Oct 3, 2014 at 5:09 AM, Trevor Norris <trev....@gmail.com> wrote:
> Though for people to transition to using ES6 numeric literals they
> realistically need to be removed from behind the flag?
>
> Support LegacyOctalIntegerLiteral forever if you'd like, but that doesn't
> mean numeric literals can't be taken out from behind the
> --harmony_numeric_literals flag.

Yes, that’s what this “intent to ship” thread is about.
Reply all
Reply to author
Forward
0 new messages