()
| 3303 | } |
| 3304 | |
| 3305 | parseClassExpression(): Node.ClassExpression { |
| 3306 | const node = this.createNode(); |
| 3307 | |
| 3308 | const previousStrict = this.context.strict; |
| 3309 | this.context.strict = true; |
| 3310 | this.expectKeyword('class'); |
| 3311 | const id = (this.lookahead.type === Token.Identifier) ? this.parseVariableIdentifier() : null; |
| 3312 | let superClass: Node.Identifier | null = null; |
| 3313 | if (this.matchKeyword('extends')) { |
| 3314 | this.nextToken(); |
| 3315 | superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); |
| 3316 | } |
| 3317 | const classBody = this.parseClassBody(); |
| 3318 | this.context.strict = previousStrict; |
| 3319 | |
| 3320 | return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); |
| 3321 | } |
| 3322 | |
| 3323 | // https://tc39.github.io/ecma262/#sec-scripts |
| 3324 | // https://tc39.github.io/ecma262/#sec-modules |
no test coverage detected