Skip to content

Commit

Permalink
Editorial: Revert "Re-factor ExportSpecifier (#637)" (#796)
Browse files Browse the repository at this point in the history
This reverts commit 5d5fdab.

Fixes #776
  • Loading branch information
anba authored and bterlson committed Feb 6, 2017
1 parent 45e98db commit 9c0c0d2
Showing 1 changed file with 66 additions and 46 deletions.
112 changes: 66 additions & 46 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -22065,30 +22065,42 @@ <h2>Syntax</h2>
<emu-grammar>
ExportDeclaration :
`export` `*` FromClause `;`
`export` ExportClause[~Local] FromClause `;`
`export` ExportClause[+Local] `;`
`export` ExportClause FromClause `;`
`export` ExportClause `;`
`export` VariableStatement[~Yield, ~Await]
`export` Declaration[~Yield, ~Await]
`export` `default` HoistableDeclaration[~Yield, ~Await, +Default]
`export` `default` ClassDeclaration[~Yield, ~Await, +Default]
`export` `default` [lookahead &lt;! {`function`, `async` [no |LineTerminator| here] `function`, `class`}] AssignmentExpression[+In, ~Yield, ~Await] `;`

ExportClause[Local] :
ExportClause :
`{` `}`
`{` ExportsList[?Local] `}`
`{` ExportsList[?Local] `,` `}`

ExportsList[Local] :
ExportSpecifier[?Local]
ExportsList[?Local] `,` ExportSpecifier[?Local]

ExportSpecifier[Local] :
[+Local] IdentifierReference[~Yield, ~Await]
[+Local] IdentifierReference[~Yield, ~Await] `as` IdentifierName
[~Local] IdentifierName
[~Local] IdentifierName `as` IdentifierName
`{` ExportsList `}`
`{` ExportsList `,` `}`

ExportsList :
ExportSpecifier
ExportsList `,` ExportSpecifier

ExportSpecifier :
IdentifierName
IdentifierName `as` IdentifierName
</emu-grammar>

<!-- es6num="15.2.3.1" -->
<emu-clause id="sec-exports-static-semantics-early-errors">
<h1>Static Semantics: Early Errors</h1>
<emu-grammar>ExportDeclaration : `export` ExportClause `;`</emu-grammar>
<ul>
<li>
For each |IdentifierName| _n_ in ReferencedBindings of |ExportClause|: It is a Syntax Error if StringValue of _n_ is a |ReservedWord| or if the StringValue of _n_ is one of: `"implements"`, `"interface"`, `"let"`, `"package"`, `"private"`, `"protected"`, `"public"`, or `"static"`.
</li>
</ul>
<emu-note>
<p>The above rule means that each ReferencedBindings of |ExportClause| is treated as an |IdentifierReference|.</p>
</emu-note>
</emu-clause>

<!-- es6num="15.2.3.2" -->
<emu-clause id="sec-exports-static-semantics-boundnames">
<h1>Static Semantics: BoundNames</h1>
Expand Down Expand Up @@ -22172,14 +22184,6 @@ <h1>Static Semantics: ExportedBindings</h1>
1. Append to _names_ the elements of the ExportedBindings of |ExportSpecifier|.
1. Return _names_.
</emu-alg>
<emu-grammar>
ExportSpecifier : IdentifierReference

ExportSpecifier : IdentifierReference `as` IdentifierName
</emu-grammar>
<emu-alg>
1. Return a List containing the StringValue of |IdentifierReference|.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierName</emu-grammar>
<emu-alg>
1. Return a List containing the StringValue of |IdentifierName|.
Expand Down Expand Up @@ -22234,15 +22238,7 @@ <h1>Static Semantics: ExportedNames</h1>
1. Append to _names_ the elements of the ExportedNames of |ExportSpecifier|.
1. Return _names_.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierReference</emu-grammar>
<emu-alg>
1. Return a List containing the StringValue of |IdentifierReference|.
</emu-alg>
<emu-grammar>
ExportSpecifier : IdentifierReference `as` IdentifierName

ExportSpecifier : IdentifierName
</emu-grammar>
<emu-grammar>ExportSpecifier : IdentifierName</emu-grammar>
<emu-alg>
1. Return a List containing the StringValue of |IdentifierName|.
</emu-alg>
Expand Down Expand Up @@ -22323,27 +22319,28 @@ <h1>Static Semantics: ExportEntriesForModule</h1>
1. Append to _specs_ the elements of the ExportEntriesForModule of |ExportSpecifier| with argument _module_.
1. Return _specs_.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierReference</emu-grammar>
<emu-alg>
1. Let _sourceName_ be the StringValue of |IdentifierReference|.
1. Return a new List containing the Record {[[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _sourceName_, [[ExportName]]: _sourceName_ }.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierName</emu-grammar>
<emu-alg>
1. Let _sourceName_ be the StringValue of |IdentifierName|.
1. Return a new List containing the Record {[[ModuleRequest]]: _module_, [[ImportName]]: _sourceName_, [[LocalName]]: *null*, [[ExportName]]: _sourceName_ }.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierReference `as` IdentifierName</emu-grammar>
<emu-alg>
1. Let _localName_ be the StringValue of |IdentifierReference|.
1. Let _exportName_ be the StringValue of |IdentifierName|.
1. Return a new List containing the Record {[[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _localName_, [[ExportName]]: _exportName_ }.
1. If _module_ is *null*, then
1. Let _localName_ be _sourceName_.
1. Let _importName_ be *null*.
1. Else,
1. Let _localName_ be *null*.
1. Let _importName_ be _sourceName_.
1. Return a new List containing the Record {[[ModuleRequest]]: _module_, [[ImportName]]: _importName_, [[LocalName]]: _localName_, [[ExportName]]: _sourceName_ }.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierName `as` IdentifierName</emu-grammar>
<emu-alg>
1. Let _importName_ be the StringValue of the first |IdentifierName|.
1. Let _sourceName_ be the StringValue of the first |IdentifierName|.
1. Let _exportName_ be the StringValue of the second |IdentifierName|.
1. Return a new List containing the Record {[[ModuleRequest]]: _module_, [[ImportName]]: _importName_, [[LocalName]]: *null*, [[ExportName]]: _exportName_ }.
1. If _module_ is *null*, then
1. Let _localName_ be _sourceName_.
1. Let _importName_ be *null*.
1. Else,
1. Let _localName_ be *null*.
1. Let _importName_ be _sourceName_.
1. Return a new List containing the Record {[[ModuleRequest]]: _module_, [[ImportName]]: _importName_, [[LocalName]]: _localName_, [[ExportName]]: _exportName_ }.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -22424,6 +22421,29 @@ <h1>Static Semantics: ModuleRequests</h1>
</emu-alg>
</emu-clause>

<!-- es6num="15.2.3.10" -->
<emu-clause id="sec-static-semantics-referencedbindings">
<h1>Static Semantics: ReferencedBindings</h1>
<emu-grammar>ExportClause : `{` `}`</emu-grammar>
<emu-alg>
1. Return a new empty List.
</emu-alg>
<emu-grammar>ExportsList : ExportsList `,` ExportSpecifier</emu-grammar>
<emu-alg>
1. Let _names_ be the ReferencedBindings of |ExportsList|.
1. Append to _names_ the elements of the ReferencedBindings of |ExportSpecifier|.
1. Return _names_.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierName</emu-grammar>
<emu-alg>
1. Return a List containing the |IdentifierName|.
</emu-alg>
<emu-grammar>ExportSpecifier : IdentifierName `as` IdentifierName</emu-grammar>
<emu-alg>
1. Return a List containing the first |IdentifierName|.
</emu-alg>
</emu-clause>

<!-- es6num="15.2.3.11" -->
<emu-clause id="sec-exports-runtime-semantics-evaluation">
<h1>Runtime Semantics: Evaluation</h1>
Expand Down

0 comments on commit 9c0c0d2

Please sign in to comment.