Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: src/scanner.h

Issue 615813004: Allow escape sequences in Constructor/Prototype tokens in PreParserTraits::GetSymbol() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/preparser.cc ('K') | « src/preparser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index 356c8e4a549b0e41b753ab95db4891f164e0bc3d..e1e8f0f560037f67a2b5ace3b157aa14e0928ff5 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -394,6 +394,18 @@ class Scanner {
}
return false;
}
+
+ bool LiteralMatches(const char* data, int length) {
+ if (current_token() == Token::STRING &&
caitp (gmail) 2014/10/01 20:52:18 The check for Token::STRING is simply because I do
+ is_literal_one_byte() &&
+ literal_length() == length) {
+ const char* token =
+ reinterpret_cast<const char*>(literal_one_byte_string().start());
+ return !strncmp(token, data, length);
+ }
+ return UnescapedLiteralMatches(data, length);
caitp (gmail) 2014/10/01 20:52:18 But if it does turn out to be necessary, I want to
arv (Not doing code reviews) 2014/10/01 21:00:35 Is the only difference here is the literal_contain
+ }
+
void IsGetOrSet(bool* is_get, bool* is_set) {
if (is_literal_one_byte() &&
literal_length() == 3 &&
« src/preparser.cc ('K') | « src/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698