diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-07-14 16:28:47 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:46 -0400 |
commit | 638a904d0dbe4bcc5a625ea472c7e65ac75dbc06 (patch) | |
tree | 54d1280e2810fce3ecf13605b1c541b748ada39c | |
parent | 6444d5d0ef586bda0a6e2745847fc1228ad7e5a2 (diff) | |
download | UXP-638a904d0dbe4bcc5a625ea472c7e65ac75dbc06.tar UXP-638a904d0dbe4bcc5a625ea472c7e65ac75dbc06.tar.gz UXP-638a904d0dbe4bcc5a625ea472c7e65ac75dbc06.tar.lz UXP-638a904d0dbe4bcc5a625ea472c7e65ac75dbc06.tar.xz UXP-638a904d0dbe4bcc5a625ea472c7e65ac75dbc06.zip |
Refactor Token& nextToken
-rw-r--r-- | js/src/frontend/TokenStream.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index e92de4b03..2744fd144 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -571,6 +571,11 @@ class MOZ_STACK_CLASS TokenStream #endif } + const Token& nextToken() const { + MOZ_ASSERT(hasLookahead()); + return tokens[(cursor + 1) & ntokensMask]; + } + // Advance to the next token. If the token stream encountered an error, // return false. Otherwise return true and store the token kind in |*ttp|. MOZ_MUST_USE bool getToken(TokenKind* ttp, Modifier modifier = None) { @@ -1017,10 +1022,6 @@ class MOZ_STACK_CLASS TokenStream void updateLineInfoForEOL(); void updateFlagsForEOL(); - const Token& nextToken() const { - MOZ_ASSERT(hasLookahead()); - return tokens[(cursor + 1) & ntokensMask]; - } bool hasLookahead() const { return lookahead > 0; } |