Parse class name in strict mode

The specification defines that the whole class declaration is parsed in strict mode
This commit is contained in:
Daniel Tschinder
2019-01-22 00:01:09 -08:00
parent 8071dca9ad
commit f4f5ca2aaa
2 changed files with 2 additions and 18 deletions

View File

@@ -1048,12 +1048,12 @@ export default class StatementParser extends ExpressionParser {
): T {
this.next();
this.takeDecorators(node);
this.parseClassId(node, isStatement, optionalId);
// class bodies and heritages are implicitly strict
// A class definition is always strict mode code.
const oldStrict = this.state.strict;
this.state.strict = true;
this.parseClassId(node, isStatement, optionalId);
this.parseClassSuper(node);
this.parseClassBody(node);