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

Method expect

src/parser.ts:440–445  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

438 // If not, an exception will be thrown.
439
440 expect(value) {
441 const token = this.nextToken();
442 if (token.type !== Token.Punctuator || token.value !== value) {
443 this.throwUnexpectedToken(token);
444 }
445 }
446
447 // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
448

Calls 2

nextTokenMethod · 0.95
throwUnexpectedTokenMethod · 0.95

Tested by

no test coverage detected