Unify reserved word checking and update error messages (#9402)

* Unify reserved word checking and update error messages

* Fix test
This commit is contained in:
Daniel Tschinder
2019-01-31 19:02:32 -08:00
committed by GitHub
parent 7e9029e337
commit 9eb010da50
172 changed files with 347 additions and 331 deletions

View File

@@ -1,8 +1,6 @@
// @flow
import type { Options } from "../options";
import { isES2015ReservedWord } from "../util/identifier";
import type State from "../tokenizer/state";
import type { PluginsMap } from "./index";
@@ -17,14 +15,6 @@ export default class BaseParser {
// Initialized by Tokenizer
state: State;
isReservedWord(word: string): boolean {
if (word === "await") {
return this.inModule;
} else {
return isES2015ReservedWord(word);
}
}
hasPlugin(name: string): boolean {
return this.plugins.has(name);
}