Consumes the current token if it matches the provided one, otherwise throws
(token)
| 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) |
no test coverage detected