Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Implement BinaryIntegerLiteral and OctalIntegerLiteral

RESOLVED FIXED in mozilla25



JavaScript Engine
4 years ago
3 years ago


(Reporter: rwaldron, Assigned: Waldo)


(Blocks: 1 bug, {dev-doc-complete})

Bug Flags:
in-testsuite +

Firefox Tracking Flags

(relnote-firefox -)


(Whiteboard: [qa-][DocArea=JS])


(1 attachment)



4 years ago

BinaryIntegerLiteral ::
  0b BinaryDigit
  0B BinaryDigit
  BinaryIntegerLiteral BinaryDigit

BinaryDigit :: one of
  0 1

OctalIntegerLiteral ::
  0o OctalDigit
  0O OctalDigit
  OctalIntegerLiteral OctalDigit

Comment 1

4 years ago
For coordination
Keywords: dev-doc-needed

Comment 2

4 years ago
Note that the spec draft grammar is wrong:
Created attachment 780005 [details] [diff] [review]

Temporarily blocked on other stuff, this was easy.
Attachment #780005 - Flags: review?
Assignee: general → jwalden+bmo
Attachment #780005 - Flags: review? → review?(till)

Comment 4

4 years ago
Comment on attachment 780005 [details] [diff] [review]

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.”
I'm pretty sure that should be changed to LegacyOctalIntegerLiteral now -- the term in B.1.1 got renamed.
Comment on attachment 780005 [details] [diff] [review]

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!
Attachment #780005 - Flags: review?(till) → review+
"[..] in allowing "0O" as the octal prefix making sense", even
Yeah, 0O0 is so not a good idea.  I sent mail about it, which finally made it through now after prodding (sounds like might be deemed a spam source by postini :-\ ):

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

4 years ago
(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.

I'll try to get a blog post about this done soon.
OS: Mac OS X → All
Hardware: x86 → All
Something in this push made Windows checktests mad. Backed out per our IRC conversation.
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:
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
relnote-firefox: --- → ?

Still needs MDN docs, I'll try to get to them next time I face downtime while compiling, or similar.
Assuming this does not need QA. If this needs QA, please remove the [qa-] whiteboard tag and add the verifyme keyword.
Whiteboard: [qa-]


4 years ago
relnote-firefox: ? → -
Whiteboard: [qa-] → [qa-][DocArea=JS]
Firefox 25 for developers


As always, review and additions to these docs are more than welcome on the MDN wiki :-)
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.