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

Side by Side Diff: src/preparser.cc

Issue 1290013002: [es6] Make assignment to new.target an early ReferenceError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a few more tests Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/preparser.h ('k') | test/message/new-target-assignment.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 Expect(Token::RPAREN, CHECK_OK); 911 Expect(Token::RPAREN, CHECK_OK);
912 ParseSubStatement(CHECK_OK); 912 ParseSubStatement(CHECK_OK);
913 return Statement::Default(); 913 return Statement::Default();
914 } 914 }
915 } else { 915 } else {
916 Expression lhs = ParseExpression(false, CHECK_OK); 916 Expression lhs = ParseExpression(false, CHECK_OK);
917 is_let_identifier_expression = 917 is_let_identifier_expression =
918 lhs.IsIdentifier() && lhs.AsIdentifier().IsLet(); 918 lhs.IsIdentifier() && lhs.AsIdentifier().IsLet();
919 if (CheckInOrOf(lhs.IsIdentifier(), &mode, ok)) { 919 if (CheckInOrOf(lhs.IsIdentifier(), &mode, ok)) {
920 if (!*ok) return Statement::Default(); 920 if (!*ok) return Statement::Default();
921 // TODO(adamk): Should call CheckAndRewriteReferenceExpression here
922 // to catch early errors if lhs is not a valid reference expression.
921 ParseExpression(true, CHECK_OK); 923 ParseExpression(true, CHECK_OK);
922 Expect(Token::RPAREN, CHECK_OK); 924 Expect(Token::RPAREN, CHECK_OK);
923 ParseSubStatement(CHECK_OK); 925 ParseSubStatement(CHECK_OK);
924 return Statement::Default(); 926 return Statement::Default();
925 } 927 }
926 } 928 }
927 } 929 }
928 930
929 // Parsed initializer at this point. 931 // Parsed initializer at this point.
930 // Detect attempts at 'let' declarations in sloppy mode. 932 // Detect attempts at 'let' declarations in sloppy mode.
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1201
1200 DCHECK(!spread_pos.IsValid()); 1202 DCHECK(!spread_pos.IsValid());
1201 1203
1202 return Expression::Default(); 1204 return Expression::Default();
1203 } 1205 }
1204 1206
1205 #undef CHECK_OK 1207 #undef CHECK_OK
1206 1208
1207 1209
1208 } } // v8::internal 1210 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | test/message/new-target-assignment.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698