зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1185106 - Part 3: Add await token. r=efaust,till
MozReview-Commit-ID: 7O4SayIM9f9
This commit is contained in:
Родитель
9dd768a3e2
Коммит
b576773874
|
@ -107,6 +107,7 @@
|
|||
macro(THROW, "keyword 'throw'") \
|
||||
macro(DEBUGGER, "keyword 'debugger'") \
|
||||
macro(YIELD, "keyword 'yield'") \
|
||||
macro(AWAIT, "keyword 'await'") \
|
||||
macro(EXPORT, "keyword 'export'") \
|
||||
macro(IMPORT, "keyword 'import'") \
|
||||
macro(CLASS, "keyword 'class'") \
|
||||
|
|
|
@ -965,6 +965,12 @@ TokenStream::putIdentInTokenbuf(const char16_t* identStart)
|
|||
bool
|
||||
TokenStream::checkForKeyword(const KeywordInfo* kw, TokenKind* ttp)
|
||||
{
|
||||
if (!awaitIsKeyword && kw->tokentype == TOK_AWAIT) {
|
||||
if (ttp)
|
||||
*ttp = TOK_NAME;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (kw->tokentype == TOK_RESERVED)
|
||||
return reportError(JSMSG_RESERVED_ID, kw->chars);
|
||||
|
||||
|
|
|
@ -430,6 +430,8 @@ class MOZ_STACK_CLASS TokenStream
|
|||
{}
|
||||
};
|
||||
|
||||
bool awaitIsKeyword = false;
|
||||
|
||||
public:
|
||||
typedef Token::Modifier Modifier;
|
||||
static constexpr Modifier None = Token::None;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
macro(ArrayValuesAt, ArrayValuesAt, "ArrayValuesAt") \
|
||||
macro(as, as, "as") \
|
||||
macro(Async, Async, "Async") \
|
||||
macro(await, await, "await") \
|
||||
macro(Bool8x16, Bool8x16, "Bool8x16") \
|
||||
macro(Bool16x8, Bool16x8, "Bool16x8") \
|
||||
macro(Bool32x4, Bool32x4, "Bool32x4") \
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
macro(private, private_, TOK_STRICT_RESERVED) \
|
||||
macro(protected, protected_, TOK_STRICT_RESERVED) \
|
||||
macro(public, public_, TOK_STRICT_RESERVED) \
|
||||
macro(await, await, TOK_AWAIT) \
|
||||
/* \
|
||||
* Yield is a token inside function*. Outside of a function*, it is a \
|
||||
* future reserved keyword in strict mode, but a keyword in JS1.7 even \
|
||||
|
|
Загрузка…
Ссылка в новой задаче