| Index: src/parsing/token.h
|
| diff --git a/src/parsing/token.h b/src/parsing/token.h
|
| index 7a62b4d9153a399ac546df9496ed5d921d863ed3..f52881b337f81e73b8de10bf4b52bdd85d98950b 100644
|
| --- a/src/parsing/token.h
|
| +++ b/src/parsing/token.h
|
| @@ -146,10 +146,12 @@ namespace internal {
|
| T(IDENTIFIER, NULL, 0) \
|
| \
|
| /* Future reserved words (ECMA-262, section 7.6.1.2). */ \
|
| - T(FUTURE_RESERVED_WORD, NULL, 0) \
|
| T(FUTURE_STRICT_RESERVED_WORD, NULL, 0) \
|
| + /* `await` is a reserved word in module code only */ \
|
| + K(AWAIT, "await", 0) \
|
| K(CLASS, "class", 0) \
|
| K(CONST, "const", 0) \
|
| + K(ENUM, "enum", 0) \
|
| K(EXPORT, "export", 0) \
|
| K(EXTENDS, "extends", 0) \
|
| K(IMPORT, "import", 0) \
|
| @@ -171,7 +173,6 @@ namespace internal {
|
| T(TEMPLATE_SPAN, NULL, 0) \
|
| T(TEMPLATE_TAIL, NULL, 0)
|
|
|
| -
|
| class Token {
|
| public:
|
| // All token values.
|
| @@ -195,7 +196,7 @@ class Token {
|
| }
|
|
|
| static bool IsIdentifier(Value tok, LanguageMode language_mode,
|
| - bool is_generator) {
|
| + bool is_generator, bool is_module) {
|
| switch (tok) {
|
| case IDENTIFIER:
|
| return true;
|
| @@ -206,6 +207,8 @@ class Token {
|
| return is_sloppy(language_mode);
|
| case YIELD:
|
| return !is_generator && is_sloppy(language_mode);
|
| + case AWAIT:
|
| + return !is_module;
|
| default:
|
| return false;
|
| }
|
|
|