diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 12:12:20 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 12:14:14 +0200 |
commit | a9682a32af09f2fb8ae39c66fdc19ecdee24e591 (patch) | |
tree | 738033a7ad68a052403875d43ade1bf26ee2edf7 /js/src/frontend/TokenStream.h | |
parent | cc07da9cb4d6e7a53f8d953427ffc2bca2e0c2df (diff) | |
parent | a5d22aa6106fbd3c8cec12333b14d4c65cd98647 (diff) | |
download | UXP-a9682a32af09f2fb8ae39c66fdc19ecdee24e591.tar UXP-a9682a32af09f2fb8ae39c66fdc19ecdee24e591.tar.gz UXP-a9682a32af09f2fb8ae39c66fdc19ecdee24e591.tar.lz UXP-a9682a32af09f2fb8ae39c66fdc19ecdee24e591.tar.xz UXP-a9682a32af09f2fb8ae39c66fdc19ecdee24e591.zip |
Merge branch '816'
This merges both the JS Front-end parser changes to better structure
the parser code, and the TC39 `toString()` revision proposal with
the exception of ES6 classes.
Diffstat (limited to 'js/src/frontend/TokenStream.h')
-rw-r--r-- | js/src/frontend/TokenStream.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 5d6b4b795..6ba9fba5a 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -375,8 +375,7 @@ class MOZ_STACK_CLASS TokenStream va_list args); bool reportStrictModeErrorNumberVA(uint32_t offset, bool strictMode, unsigned errorNumber, va_list args); - bool reportStrictWarningErrorNumberVA(uint32_t offset, unsigned errorNumber, - va_list args); + bool reportExtraWarningErrorNumberVA(uint32_t offset, unsigned errorNumber, va_list args); // asm.js reporter void reportAsmJSError(uint32_t offset, unsigned errorNumber, ...); @@ -570,6 +569,14 @@ class MOZ_STACK_CLASS TokenStream return true; } + MOZ_MUST_USE bool peekOffset(uint32_t* offset, Modifier modifier = None) { + TokenPos pos; + if (!peekTokenPos(&pos, modifier)) + return false; + *offset = pos.begin; + return true; + } + // This is like peekToken(), with one exception: if there is an EOL // between the end of the current token and the start of the next token, it // return true and store TOK_EOL in |*ttp|. In that case, no token with |