Unify reserved word checking and update error messages (#9402)
* Unify reserved word checking and update error messages * Fix test
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user