Properly parse export default from when exportDefaultFrom is not enabled (#11676)

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
Huáng Jùnliàng
2020-06-05 10:08:21 -04:00
committed by GitHub
parent 3874470841
commit 71d3527ef5
22 changed files with 279 additions and 6 deletions

View File

@@ -190,11 +190,14 @@ export default class Tokenizer extends ParserErrors {
}
nextTokenStart(): number {
const thisTokEnd = this.state.pos;
skipWhiteSpace.lastIndex = thisTokEnd;
return this.nextTokenStartSince(this.state.pos);
}
nextTokenStartSince(pos: number): number {
skipWhiteSpace.lastIndex = pos;
const skip = skipWhiteSpace.exec(this.input);
// $FlowIgnore: The skipWhiteSpace ensures to match any string
return thisTokEnd + skip[0].length;
return pos + skip[0].length;
}
lookaheadCharCode(): number {