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

Unified Diff: src/preparser.cc

Issue 149253010: Tests and fixes for (pre)parse errors related to strict reserved words. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index c8a59bf7bd01738fd7266829b6b27341972e88b2..21010ae6d2ca5360de77ffe2f7f0a130db7cafb7 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -121,7 +121,9 @@ void PreParser::ReportUnexpectedToken(Token::Value token) {
return ReportMessageAt(source_location, "unexpected_reserved", NULL);
case Token::FUTURE_STRICT_RESERVED_WORD:
return ReportMessageAt(source_location,
- "unexpected_strict_reserved", NULL);
+ is_classic_mode() ? "unexpected_token_identifier"
+ : "unexpected_strict_reserved",
+ NULL);
default:
const char* name = Token::String(token);
ReportMessageAt(source_location, "unexpected_token", name);
@@ -304,7 +306,7 @@ PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) {
// as name of strict function.
const char* type = "strict_function_name";
if (identifier.IsFutureStrictReserved() || identifier.IsYield()) {
- type = "strict_reserved_word";
+ type = "unexpected_strict_reserved";
}
ReportMessageAt(location, type, NULL);
*ok = false;
@@ -1511,7 +1513,7 @@ PreParser::Identifier PreParser::ParseIdentifier(bool* ok) {
if (!is_classic_mode()) {
Scanner::Location location = scanner()->location();
ReportMessageAt(location.beg_pos, location.end_pos,
- "strict_reserved_word", NULL);
+ "unexpected_strict_reserved", NULL);
*ok = false;
}
// FALLTHROUGH
@@ -1565,7 +1567,7 @@ void PreParser::StrictModeIdentifierViolation(Scanner::Location location,
if (identifier.IsFutureReserved()) {
type = "reserved_word";
} else if (identifier.IsFutureStrictReserved() || identifier.IsYield()) {
- type = "strict_reserved_word";
+ type = "unexpected_strict_reserved";
}
if (!is_classic_mode()) {
ReportMessageAt(location, type, NULL);
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698