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

Unified Diff: src/scanner.h

Issue 996223003: [es6] support template literals after MemberExpression (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: New tests, delete unneeded code, some comments Created 5 years, 9 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
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/templates.js » ('j') | 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 416b5a11ac3248488eff2f499891accb09bb3356..1ef6aa8f53b09434c75de2b4d356c71143c7e963 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -532,8 +532,11 @@ class Scanner {
}
inline void StartRawLiteral() {
- raw_literal_buffer_.Reset();
- next_.raw_literal_chars = &raw_literal_buffer_;
+ LiteralBuffer* free_buffer =
+ (current_.raw_literal_chars == &raw_literal_buffer1_) ?
+ &raw_literal_buffer2_ : &raw_literal_buffer1_;
+ free_buffer->Reset();
+ next_.raw_literal_chars = free_buffer;
}
INLINE(void AddLiteralChar(uc32 c)) {
@@ -716,7 +719,8 @@ class Scanner {
LiteralBuffer source_mapping_url_;
// Buffer to store raw string values
- LiteralBuffer raw_literal_buffer_;
+ LiteralBuffer raw_literal_buffer1_;
+ LiteralBuffer raw_literal_buffer2_;
TokenDesc current_; // desc for current token (as returned by Next())
TokenDesc next_; // desc for next token (one token look-ahead)
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/templates.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698