fix: parser strictMode option (#13548)

This commit is contained in:
overlookmotel
2021-07-20 15:42:04 +01:00
committed by GitHub
parent 2c6db56696
commit dd942f92af
2 changed files with 64 additions and 1 deletions

View File

@@ -33,7 +33,11 @@ export default class State {
init(options: Options): void {
this.strict =
options.strictMode === false ? false : options.sourceType === "module";
options.strictMode === false
? false
: options.strictMode === true
? true
: options.sourceType === "module";
this.curLine = options.startLine;
this.startLoc = this.endLoc = this.curPosition();