| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |