Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Ban new.target and arguments from initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
littledan authored and jeffmo committed Jul 26, 2016
1 parent 742831c commit 4fce087
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/new-productions.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ <h1>|PublicFieldDefinition|</h1>
</emu-grammar>
</emu-clause>

<emu-clause id="public-field-definition-early-errors">
<h1>Static Semantics: Early Errors</h1>
<emu-grammar>
PublicFieldDefinition :
PropertyName[?Yield] Initializer?
</emu-grammar>
<emu-alg>
1. It is a SyntaxError if |Initializer| contains |MetaProperty|.
1. It is a SyntaxError if |Initializer| contains an |Identifier| with the StringValue `"arguments"`.
</emu-alg>
</emu-clause>

<emu-clause id="static-semantics-class-public-fields">
<h1>Static Semantics: ClassPublicFields</h1>

Expand Down Expand Up @@ -103,6 +115,8 @@ <h1>InitializePublicInstanceFields ( _O_, _constructor_ )</h1>
1. Let _lex_ be the Lexical Environment of the running execution context.
1. Let _initializerEnv_ be NewFunctionEnvironment ( _constructor_, *undefined* ).
1. Let _initializerEnvRec_ be the value of _initializerEnv_'s EnvironmentRecord.
1. Perform ! _initializerEnvRec_.CreateImmutableBinding(`"arguments"`, ~false~).
1. Perform ! _initializerEnvRec_.InitializeBinding(`"arguments"`, ~undefined~).
1. Perform _initializerER_.BindThisValue ( _O_ ).
1. Set the running execution context's LexicalEnvironment to _initializerEnv_.
1. Let _publicFieldRecords_ be the value of _constructor_'s [[PublicFields]] internal slot.
Expand Down

0 comments on commit 4fce087

Please sign in to comment.