(identifierIsOptional?: boolean)
| 3284 | } |
| 3285 | |
| 3286 | parseClassDeclaration(identifierIsOptional?: boolean): Node.ClassDeclaration { |
| 3287 | const node = this.createNode(); |
| 3288 | |
| 3289 | const previousStrict = this.context.strict; |
| 3290 | this.context.strict = true; |
| 3291 | this.expectKeyword('class'); |
| 3292 | |
| 3293 | const id = (identifierIsOptional && (this.lookahead.type !== Token.Identifier)) ? null : this.parseVariableIdentifier(); |
| 3294 | let superClass: Node.Identifier | null = null; |
| 3295 | if (this.matchKeyword('extends')) { |
| 3296 | this.nextToken(); |
| 3297 | superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); |
| 3298 | } |
| 3299 | const classBody = this.parseClassBody(); |
| 3300 | this.context.strict = previousStrict; |
| 3301 | |
| 3302 | return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); |
| 3303 | } |
| 3304 | |
| 3305 | parseClassExpression(): Node.ClassExpression { |
| 3306 | const node = this.createNode(); |
no test coverage detected