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

Early error for arguments in initializer #56

Merged
merged 1 commit into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions spec/modified-productions.htm
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,16 @@ <h1>Runtime Semantics: Evaluation</h1>
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-performeval">
<h1>Runtime Semantics: PerformEval ( _x_, _evalRealm_, _strictCaller_, _direct_ )</h1>
<emu-clause id="sec-performeval-rules-in-initializer">
<h1>Additional Early Error Rules for Eval Inside |Initializer|</h1>
<p>These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer.</p>
<emu-grammar>ScriptBody : StatementList</emu-grammar>
<ul>
<li>It is a Syntax Error if |StatementList| Contains an |IdentifierReference| whose StringValue is `"arguments"`.</li>
<li>The remaining eval rules apply as <a href="https://tc39.github.io/ecma262/#sec-performeval-rules-outside-constructors">outside a constructor</a>, <a href="https://tc39.github.io/ecma262/#sec-performeval-rules-outside-methods">inside a method</a>, and <a href="https://tc39.github.io/ecma262/#sec-performeval-rules-outside-functions">inside a function</a>.</li>
</ul>
</emu-clause>
</emu-clause>
12 changes: 12 additions & 0 deletions spec/new-productions.htm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ <h1>|PublicFieldDefinition|</h1>
PublicFieldDefinition :
PropertyName[?Yield] Initializer?
</emu-grammar>

<emu-clause id="no-arguments">
<h1>Static Semantics: Early Errors</h1>

<emu-grammar>
PublicFieldDefinition :
PropertyName[?Yield] Initializer?
</emu-grammar>
<ul>
<li>It is a Syntax Error if |Initializer| Contains an |IdentifierReference| whose StringValue is `"arguments"`.
</ul>
</emu-clause>
</emu-clause>

<emu-clause id="static-semantics-class-public-fields">
Expand Down