summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/TokenStream.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-03 08:22:29 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-03 08:23:12 +0100
commitd432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0 (patch)
tree98d5420a48042e47b0d9971d30774b8c82d11486 /js/src/frontend/TokenStream.h
parent278eda6a09e9177678d57a2da2b6a8ddcb503b1c (diff)
parentae4af7b7e598b4fec037254a1fd03ac3495695a4 (diff)
downloadUXP-d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0.tar
UXP-d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0.tar.gz
UXP-d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0.tar.lz
UXP-d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0.tar.xz
UXP-d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0.zip
Stage 1: Fix #960.
Diffstat (limited to 'js/src/frontend/TokenStream.h')
-rw-r--r--js/src/frontend/TokenStream.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h
index 5d6b4b795..77eea3d81 100644
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -570,6 +570,13 @@ 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