Skip to content

Commit

Permalink
Normative: Early error for class decorators in sloppy mode (#207)
Browse files Browse the repository at this point in the history
Closes #204
  • Loading branch information
littledan authored Jan 14, 2019
1 parent d898a40 commit 32616d1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,25 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if |DecoratorList| is present and PropName of |MethodDefinition| is `"constructor"`.
</li>
</ul>


<emu-grammar>
ClassDeclaration[Yield, Await, Default] :
<ins>DecoratorList[?Yield, ?Await]?</ins> `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await]

ClassExpression[Yield, Await] :
<ins>DecoratorList[?Yield, ?Await]?</ins> `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await]
</emu-grammar>
<ul>
<li>
It is a Syntax Error if |DecoratorList| is present and |ClassExpression| or |ClassDeclaration| is directly contained in non-strict code.
</li>
</ul>

<emu-note>
|DecoratorList| is always interpreted as strict mode code, as it is part of a |ClassDeclaration| or |ClassExpression|.
</emu-note>

</emu-clause>
</emu-clause>

Expand Down

0 comments on commit 32616d1

Please sign in to comment.