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

Unified Diff: src/parser.h

Issue 200473003: Make invalid LHSs a parse-time (reference) error (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment Created 6 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/messages.js ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 9fd636c222b81961c12343a4535d46189a63f252..97b5f7b4bc4913bd8e9f41d2b5a5af7d65ffbe60 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -484,10 +484,10 @@ class ParserTraits {
static void CheckAssigningFunctionLiteralToProperty(Expression* left,
Expression* right);
- // Signal a reference error if the expression is an invalid left-hand side
- // expression. We could report this as a syntax error but for compatibility
- // with JSC we choose to report the error at runtime.
- Expression* ValidateAssignmentLeftHandSide(Expression* expression) const;
+ // Determine whether the expression is a valid assignment left-hand side.
+ static bool IsValidLeftHandSide(Expression* expression) {
+ return expression->IsValidLeftHandSide();
+ }
// Determine if the expression is a variable proxy and mark it as being used
// in an assignment or with a increment/decrement operator. This is currently
@@ -501,11 +501,15 @@ class ParserTraits {
// Reporting errors.
void ReportMessageAt(Scanner::Location source_location,
const char* message,
- Vector<const char*> args);
- void ReportMessage(const char* message, Vector<Handle<String> > args);
+ Vector<const char*> args,
+ bool is_reference_error = false);
+ void ReportMessage(const char* message,
+ Vector<Handle<String> > args,
+ bool is_reference_error = false);
void ReportMessageAt(Scanner::Location source_location,
const char* message,
- Vector<Handle<String> > args);
+ Vector<Handle<String> > args,
+ bool is_reference_error = false);
// "null" return type creators.
static Handle<String> EmptyIdentifier() {
« no previous file with comments | « src/messages.js ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698