()
| 2349 | // https://tc39.github.io/ecma262/#sec-continue-statement |
| 2350 | |
| 2351 | parseContinueStatement(): Node.ContinueStatement { |
| 2352 | const node = this.createNode(); |
| 2353 | this.expectKeyword('continue'); |
| 2354 | |
| 2355 | let label: Node.Identifier | null = null; |
| 2356 | if (this.lookahead.type === Token.Identifier && !this.hasLineTerminator) { |
| 2357 | const id = this.parseVariableIdentifier(); |
| 2358 | label = id; |
| 2359 | |
| 2360 | const key = '$' + id.name; |
| 2361 | if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { |
| 2362 | this.throwError(Messages.UnknownLabel, id.name); |
| 2363 | } |
| 2364 | } |
| 2365 | |
| 2366 | this.consumeSemicolon(); |
| 2367 | if (label === null && !this.context.inIteration) { |
| 2368 | this.throwError(Messages.IllegalContinue); |
| 2369 | } |
| 2370 | |
| 2371 | return this.finalize(node, new Node.ContinueStatement(label)); |
| 2372 | } |
| 2373 | |
| 2374 | // https://tc39.github.io/ecma262/#sec-break-statement |
| 2375 |
no test coverage detected