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

Unified Diff: src/scanner.cc

Issue 5188009: Merge preparser Scanner with main JavaScript scanner. (Closed)
Patch Set: Address review. Fix thinko in keyword matcher. Created 10 years, 1 month 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/scanner.h ('k') | src/scanner-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index d022f3e21f7bf0a87b7608a9afefcbc325862865..63b2fd807d4d01eb80527be7a59bbdd15d69e688 100755
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -118,8 +118,12 @@ void Scanner::LiteralScope::Complete() {
// ----------------------------------------------------------------------------
// V8JavaScriptScanner
-void V8JavaScriptScanner::Initialize(Handle<String> source) {
+void V8JavaScriptScanner::Initialize(Handle<String> source,
+ int literal_flags) {
source_ = stream_initializer_.Init(source, NULL, 0, source->length());
+ // Need to capture identifiers in order to recognize "get" and "set"
+ // in object literals.
+ literal_flags_ = literal_flags | kLiteralIdentifier;
Init();
// Skip initial whitespace allowing HTML comment ends just like
// after a newline and scan first token.
@@ -130,9 +134,11 @@ void V8JavaScriptScanner::Initialize(Handle<String> source) {
void V8JavaScriptScanner::Initialize(Handle<String> source,
- unibrow::CharacterStream* stream) {
+ unibrow::CharacterStream* stream,
+ int literal_flags) {
source_ = stream_initializer_.Init(source, stream,
0, UTF16Buffer::kNoEndPosition);
+ literal_flags_ = literal_flags | kLiteralIdentifier;
Init();
// Skip initial whitespace allowing HTML comment ends just like
// after a newline and scan first token.
@@ -144,9 +150,11 @@ void V8JavaScriptScanner::Initialize(Handle<String> source,
void V8JavaScriptScanner::Initialize(Handle<String> source,
int start_position,
- int end_position) {
+ int end_position,
+ int literal_flags) {
source_ = stream_initializer_.Init(source, NULL,
start_position, end_position);
+ literal_flags_ = literal_flags | kLiteralIdentifier;
Init();
// Skip initial whitespace allowing HTML comment ends just like
// after a newline and scan first token.
« no previous file with comments | « src/scanner.h ('k') | src/scanner-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698