Last Comment Bug 894026 - Implement BinaryIntegerLiteral and OctalIntegerLiteral
: Implement BinaryIntegerLiteral and OctalIntegerLiteral
Status: RESOLVED FIXED
[qa-][DocArea=JS]
: dev-doc-complete
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla25
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
:
Mentors:
Depends on:
Blocks: es6
  Show dependency treegraph
 
Reported: 2013-07-15 13:41 PDT by Rick Waldron [:rwaldron]
Modified: 2014-06-30 12:34 PDT (History)
11 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-


Attachments
Patch (10.16 KB, patch)
2013-07-23 14:14 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
till: review+
Details | Diff | Splinter Review

Description Rick Waldron [:rwaldron] 2013-07-15 13:41:01 PDT
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.3

BinaryIntegerLiteral ::
  0b BinaryDigit
  0B BinaryDigit
  BinaryIntegerLiteral BinaryDigit

BinaryDigit :: one of
  0 1

OctalIntegerLiteral ::
  0o OctalDigit
  0O OctalDigit
  OctalIntegerLiteral OctalDigit
Comment 1 Rick Waldron [:rwaldron] 2013-07-15 13:41:49 PDT
For coordination https://code.google.com/p/v8/issues/detail?id=2783
Comment 2 Erik Arvidsson 2013-07-16 06:50:40 PDT
Note that the spec draft grammar is wrong:

https://bugs.ecmascript.org/show_bug.cgi?id=1583
Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-23 14:14:16 PDT
Created attachment 780005 [details] [diff] [review]
Patch

Temporarily blocked on other stuff, this was easy.
Comment 4 Mathias Bynens 2013-07-23 14:57:52 PDT
Comment on attachment 780005 [details] [diff] [review]
Patch

Review of attachment 780005 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/tests/ecma_6/Expressions/octal-literals.js
@@ +92,5 @@
> +{
> +  "use strict";
> +  return 0o755;
> +}
> +assertEq(strict(), 7 * 64 + 5 * 8 + 5);

Shouldn’t this throw a SyntaxError? “A conforming implementation, when processing strict mode code (see 10.1.1), must not extend the syntax of NumericLiteral to include OctalIntegerLiteral as described in B.1.1.”
Comment 5 Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-23 15:15:40 PDT
I'm pretty sure that should be changed to LegacyOctalIntegerLiteral now -- the term in B.1.1 got renamed.
Comment 6 Till Schneidereit [:till] 2013-07-23 16:02:43 PDT
Comment on attachment 780005 [details] [diff] [review]
Patch

Review of attachment 780005 [details] [diff] [review]:
-----------------------------------------------------------------

Amount of conviction I have in allowing "0O" as the octal prefix: 0O0. I see how it makes sense to be consistent with the other prefixes, though.

Otherwise: nice!
Comment 7 Till Schneidereit [:till] 2013-07-23 16:03:46 PDT
"[..] in allowing "0O" as the octal prefix making sense", even
Comment 8 Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-23 16:32:58 PDT
Yeah, 0O0 is so not a good idea.  I sent mail about it, which finally made it through now after prodding (sounds like @mit.edu might be deemed a spam source by postini :-\ ):

https://mail.mozilla.org/pipermail/es-discuss/2013-July/032192.html

I'll sit on this a little bit til that discussion, if any, ensues a bit.  Also, earlier is better and all, but if 0O0 gets excluded, I'd rather not unleash that on aurora if possible, so I'm going to be careful about uplift when landing this.  ;-)
Comment 9 Mathias Bynens 2013-07-24 01:01:02 PDT
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #5)
> I'm pretty sure that should be changed to LegacyOctalIntegerLiteral now --
> the term in B.1.1 got renamed.

Ah, you’re probably right — in that case, the spec should be updated. https://bugs.ecmascript.org/show_bug.cgi?id=1596
Comment 10 Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-25 17:54:46 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e1dd28ede5d

I'll try to get a blog post about this done soon.
Comment 11 Ryan VanderMeulen [:RyanVM] 2013-07-25 22:36:43 PDT
Something in this push made Windows checktests mad. Backed out per our IRC conversation.
https://hg.mozilla.org/integration/mozilla-inbound/rev/bbf37166d07c
Comment 12 Jeff Walden [:Waldo] (remove +bmo to email) 2013-07-26 02:28:40 PDT
I fired up a Windows build, and the jsapi-tests executable (which failed in tbpl logs, although nobody noticed it just at the time) was crashing in PRMJ_ShutdownNow() code, or something similar, clearly implicating the JS_Init changes -- not this bug.  Relanded:

https://hg.mozilla.org/integration/mozilla-inbound/rev/77df61af1a84
Comment 13 Ryan VanderMeulen [:RyanVM] 2013-07-26 19:43:14 PDT
https://hg.mozilla.org/mozilla-central/rev/77df61af1a84
Comment 14 Jeff Walden [:Waldo] (remove +bmo to email) 2013-08-12 19:53:22 PDT
Blogrified:

http://whereswalden.com/2013/08/12/micro-feature-from-es6-now-in-firefox-aurora-and-nightly-binary-and-octal-numbers/

Still needs MDN docs, I'll try to get to them next time I face downtime while compiling, or similar.
Comment 15 Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2013-09-13 11:22:33 PDT
Assuming this does not need QA. If this needs QA, please remove the [qa-] whiteboard tag and add the verifyme keyword.
Comment 16 Florian Scholz [:fscholz] (MDN) 2014-06-30 12:34:19 PDT
Firefox 25 for developers
https://developer.mozilla.org/en-US/Firefox/Releases/25#JavaScript

Reference
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_literals

As always, review and additions to these docs are more than welcome on the MDN wiki :-)

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