Closed
Bug 1243858
Opened 9 years ago
Closed 8 years ago
Exponentiation Operator precendence update (ES2016/ES7, Stage 4)
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: rwaldron, Assigned: anba)
References
()
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file, 1 obsolete file)
18.55 KB,
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
Exponentiation Operator reached stage 4 status today and the normative spec will be merged with Ecma 262 (https://github.com/tc39/ecma262/pull/318)
Updated•9 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Reporter | ||
Comment 1•9 years ago
|
||
fscholz, I've updated the MDN docs for exp op:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation_(**)
(In reply to Rick Waldron [:rwaldron] from comment #1)
> fscholz, I've updated the MDN docs for exp op:
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/
> Arithmetic_Operators#Exponentiation_(**)
Waldron, is (-2) ** 2 also a syntax error?
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to ziyunfei from comment #2)
> (In reply to Rick Waldron [:rwaldron] from comment #1)
> > fscholz, I've updated the MDN docs for exp op:
> >
> > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/
> > Arithmetic_Operators#Exponentiation_(**)
>
> Waldron, is (-2) ** 2 also a syntax error?
No, it's not.
Also, I think the ids on that page need to have "(" and ")" removed, so they don't break the fragment urls.
Comment 4•9 years ago
|
||
(In reply to Rick Waldron [:rwaldron] from comment #3)
> Also, I think the ids on that page need to have "(" and ")" removed, so they
> don't break the fragment urls.
All operators on that page are also linked without their syntax, like this:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation
Unfortunately, I can't control what is in the TOC as it is generated automatically.
Is it OK to use Exponentiation Operator on Firefox Stable version now?
I try on Firefox Stable and Developer Edition, both failed.
> 2**3
> SyntaxError: expected expression, got '*'
Comment 6•9 years ago
|
||
(In reply to Liu Xing from comment #5)
> Is it OK to use Exponentiation Operator on Firefox Stable version now?
It is currently only available on Nightly. See bug 1198453. I couldn't find a bug for letting it ride the trains (move to the other releases), though. Not sure whether this will be covered in this bug, too, or a new bug will be created.
Sebastian
Depends on: 1135708
(In reply to Sebastian Zartner [:sebo] from comment #6)
> (In reply to Liu Xing from comment #5)
> > Is it OK to use Exponentiation Operator on Firefox Stable version now?
>
> It is currently only available on Nightly. See bug 1198453. I couldn't find
> a bug for letting it ride the trains (move to the other releases), though.
> Not sure whether this will be covered in this bug, too, or a new bug will be
> created.
>
> Sebastian
Thank you very much.
Assignee | ||
Comment 8•8 years ago
|
||
I think this approach should suffice to meet the left-hand side restriction, but I'm not 100% sure, therefore I'm only asking for feedback at this point.
Attachment #8792575 -
Flags: feedback?(arai.unmht)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → andrebargull
Comment 9•8 years ago
|
||
I'm missing the context.
where is the latest spec or proposal?
this, or somewhere else?
http://rwaldron.github.io/exponentiation-operator/
Flags: needinfo?(andrebargull)
Comment 10•8 years ago
|
||
Flags: needinfo?(andrebargull)
Comment 11•8 years ago
|
||
thanks :)
Comment 12•8 years ago
|
||
Comment on attachment 8792575 [details] [diff] [review]
exp_op_unary.patch
Review of attachment 8792575 [details] [diff] [review]:
-----------------------------------------------------------------
looks good.
::: js/src/js.msg
@@ +201,5 @@
> MSG_DEF(JSMSG_BAD_INCOP_OPERAND, 0, JSEXN_REFERENCEERR, "invalid increment/decrement operand")
> MSG_DEF(JSMSG_BAD_METHOD_DEF, 0, JSEXN_SYNTAXERR, "bad method definition")
> MSG_DEF(JSMSG_BAD_OCTAL, 1, JSEXN_SYNTAXERR, "{0} is not a legal ECMA-262 octal constant")
> MSG_DEF(JSMSG_BAD_OPERAND, 1, JSEXN_SYNTAXERR, "invalid {0} operand")
> +MSG_DEF(JSMSG_BAD_POW_LEFTSIDE, 0, JSEXN_SYNTAXERR, "invalid operand for '**' expression")
it would be nice to suggest adding parenthesis to either lhs or whole exponentiation expression, if it can be described in short.
(we could explain the detail in MDN document tho)
Attachment #8792575 -
Flags: feedback?(arai.unmht) → feedback+
Assignee | ||
Comment 13•8 years ago
|
||
The error message has been amended to explain why the operand is invalid ("unparenthesized unary expression").
Drive-by change: Updated JSMSG_ARRAY_INIT_TOO_BIG to use AE/OED instead of BE spelling ("initialiser" -> "initializer").
Attachment #8792575 -
Attachment is obsolete: true
Attachment #8798465 -
Flags: review?(arai.unmht)
Updated•8 years ago
|
Attachment #8798465 -
Flags: review?(arai.unmht) → review+
Assignee | ||
Comment 14•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 15•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/80683e82570c
Disallow unary expression on left-hand side of exponentiation operator. r=arai
Keywords: checkin-needed
Comment 16•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 17•8 years ago
|
||
Docs have already been updated (see comment 1 and following). Thanks all!
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation
https://developer.mozilla.org/en-US/Firefox/Releases/52#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•