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

Unified Diff: src/preparser.h

Issue 5188006: Push version 2.5.7 to trunk.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: 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/platform-win32.cc ('k') | src/prescanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
===================================================================
--- src/preparser.h (revision 5846)
+++ src/preparser.h (working copy)
@@ -29,6 +29,7 @@
#define V8_PREPARSER_H
#include "unicode.h"
+#include "utils.h"
namespace v8 {
namespace preparser {
@@ -750,15 +751,18 @@
bool catch_or_finally_seen = false;
if (peek() == i::Token::CATCH) {
- Expect(i::Token::CATCH, CHECK_OK);
+ Consume(i::Token::CATCH);
Expect(i::Token::LPAREN, CHECK_OK);
ParseIdentifier(CHECK_OK);
Expect(i::Token::RPAREN, CHECK_OK);
- ParseBlock(CHECK_OK);
+ scope_->EnterWith();
+ ParseBlock(ok);
+ scope_->LeaveWith();
+ if (!*ok) return kUnknownStatement;
catch_or_finally_seen = true;
}
if (peek() == i::Token::FINALLY) {
- Expect(i::Token::FINALLY, CHECK_OK);
+ Consume(i::Token::FINALLY);
ParseBlock(CHECK_OK);
catch_or_finally_seen = true;
}
@@ -1370,6 +1374,7 @@
template <typename Scanner, typename Log>
Identifier PreParser<Scanner, Log>::ParseIdentifier(bool* ok) {
Expect(i::Token::IDENTIFIER, ok);
+ if (!*ok) return kUnknownIdentifier;
return GetIdentifierSymbol();
}
@@ -1380,7 +1385,7 @@
if (i::Token::IsKeyword(next)) {
int pos = scanner_->location().beg_pos;
const char* keyword = i::Token::String(next);
- log_->LogSymbol(pos, keyword, strlen(keyword));
+ log_->LogSymbol(pos, keyword, i::StrLength(keyword));
return kUnknownExpression;
}
if (next == i::Token::IDENTIFIER) {
« no previous file with comments | « src/platform-win32.cc ('k') | src/prescanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698