summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/TokenStream.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-02 12:47:28 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-02 12:47:28 +0100
commite547de64c80b98d661999c0788c09210d9d4a37e (patch)
tree19b0f1b8dd67c3cff002ecad5d10de6c5e806801 /js/src/frontend/TokenStream.h
parent278eda6a09e9177678d57a2da2b6a8ddcb503b1c (diff)
downloadUXP-e547de64c80b98d661999c0788c09210d9d4a37e.tar
UXP-e547de64c80b98d661999c0788c09210d9d4a37e.tar.gz
UXP-e547de64c80b98d661999c0788c09210d9d4a37e.tar.lz
UXP-e547de64c80b98d661999c0788c09210d9d4a37e.tar.xz
UXP-e547de64c80b98d661999c0788c09210d9d4a37e.zip
Stage 1-1: Implement Function.prototype.toString revision proposal.
Tag #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