rescan gt/lt token after TsAsExpression is parsed (#11912)

* refactor: move inType checks to flow plugin

* polish: replace hardcoded char codes

* fix: rescan greater/less token after asExpression is parsed
This commit is contained in:
Huáng Jùnliàng
2020-08-04 17:00:21 -04:00
committed by GitHub
parent c29138fd72
commit a1eabb84ea
5 changed files with 136 additions and 30 deletions

View File

@@ -693,7 +693,7 @@ export default class Tokenizer extends ParserErrors {
// '?'
const next = this.input.charCodeAt(this.state.pos + 1);
const next2 = this.input.charCodeAt(this.state.pos + 2);
if (next === charCodes.questionMark && !this.state.inType) {
if (next === charCodes.questionMark) {
if (next2 === charCodes.equalsTo) {
// '??='
this.finishOp(tt.assign, 3);