MCPcopy Create free account
hub / github.com/aurelia/binding / expect

Method expect

src/parser.js:551–557  ·  view source on GitHub ↗

Consumes the current token if it matches the provided one, otherwise throws

(token)

Source from the content-addressed store, hash-verified

549
550 /** Consumes the current token if it matches the provided one, otherwise throws */
551 expect(token) {
552 if (this.tkn === token) {
553 this.nextToken();
554 } else {
555 this.err(`Missing expected token ${TokenValues[token & T$TokenMask]}`, this.idx);
556 }
557 }
558}
559
560// todo: we're missing a few here (https://tc39.github.io/ecma262/#table-34)

Callers 5

parseConditionalMethod · 0.95
parseLeftHandSideMethod · 0.95
parseTemplateMethod · 0.95
aurelia-binding.jsFile · 0.80
aurelia-binding.jsFile · 0.80

Calls 2

nextTokenMethod · 0.95
errMethod · 0.95

Tested by

no test coverage detected