MCPcopy
hub / github.com/jquery/esprima / parseContinueStatement

Method parseContinueStatement

src/parser.ts:2351–2372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

parseStatementMethod · 0.95

Calls 6

createNodeMethod · 0.95
expectKeywordMethod · 0.95
throwErrorMethod · 0.95
consumeSemicolonMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected