Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust throw operator precedence. Fixes #3.
- Loading branch information
Showing
9 changed files
with
159 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
node_modules | ||
~$*.pptx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<p>Forthcoming</p> | ||
<p>This proposal defines new syntax to throw exceptions from within an expression context.</p> | ||
<p>See <a href="https://github.com/rbuckton/proposal-throw-expressions">the proposal repository</a> for background material and discussion.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!-- es6num="12.5" --> | ||
<emu-clause id="sec-unary-operators"> | ||
<h1>Unary Operators</h1> | ||
<h2>Syntax</h2> | ||
<emu-grammar type="definition"> | ||
UnaryExpression[Yield, Await] : | ||
UpdateExpression[?Yield, ?Await] | ||
`delete` UnaryExpression[?Yield, ?Await] | ||
`void` UnaryExpression[?Yield, ?Await] | ||
`typeof` UnaryExpression[?Yield, ?Await] | ||
<ins>`throw` UnaryExpression[?Yield, ?Await]</ins> | ||
`+` UnaryExpression[?Yield, ?Await] | ||
`-` UnaryExpression[?Yield, ?Await] | ||
`~` UnaryExpression[?Yield, ?Await] | ||
`!` UnaryExpression[?Yield, ?Await] | ||
[+Await] AwaitExpression[?Yield] | ||
</emu-grammar> | ||
|
||
<!-- es6num="12.5.2" --> | ||
<emu-clause id="sec-unary-operators-static-semantics-isfunctiondefinition"> | ||
<h1>Static Semantics: IsFunctionDefinition</h1> | ||
<emu-see-also-para op="IsFunctionDefinition"></emu-see-also-para> | ||
<emu-grammar> | ||
UnaryExpression : | ||
`delete` UnaryExpression | ||
`void` UnaryExpression | ||
`typeof` UnaryExpression | ||
<ins>`throw` UnaryExpression[?Yield, ?Await]</ins> | ||
`+` UnaryExpression | ||
`-` UnaryExpression | ||
`~` UnaryExpression | ||
`!` UnaryExpression | ||
AwaitExpression | ||
</emu-grammar> | ||
<emu-alg> | ||
1. Return *false*. | ||
</emu-alg> | ||
</emu-clause> | ||
</emu-clause> | ||
|
||
<!-- es6num="12.5.3" --> | ||
<emu-clause id="sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget"> | ||
<h1>Static Semantics: IsValidSimpleAssignmentTarget</h1> | ||
<emu-see-also-para op="IsValidSimpleAssignmentTarget"></emu-see-also-para> | ||
<emu-grammar> | ||
UnaryExpression : | ||
`delete` UnaryExpression | ||
`void` UnaryExpression | ||
`typeof` UnaryExpression | ||
<ins>`throw` UnaryExpression[?Yield, ?Await]</ins> | ||
`+` UnaryExpression | ||
`-` UnaryExpression | ||
`~` UnaryExpression | ||
`!` UnaryExpression | ||
AwaitExpression | ||
</emu-grammar> | ||
<emu-alg> | ||
1. Return *false*. | ||
</emu-alg> | ||
</emu-clause> | ||
|
||
<emu-clause id="sec-throw-operator"> | ||
<h1><ins>The `throw` Operator</ins></h1> | ||
<emu-clause id="sec-throw-operator-runtime-semantics-evaluation"> | ||
<h1>Runtime Semantics: Evaluation</h1> | ||
<emu-grammar>UnaryExpression : `throw` UnaryExpression</emu-grammar> | ||
<emu-alg> | ||
1. Let _exprRef_ be the result of evaluating |UnaryExpression|. | ||
1. Let _exprValue_ be ? GetValue(_exprRef_). | ||
1. Return Completion{[[Type]]: ~throw~, [[Value]]: _exprValue_, [[Target]]: ~empty~}. | ||
</emu-alg> | ||
</emu-clause> | ||
</emu-clause> |