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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 bool has_seen_constructor = false; | 1244 bool has_seen_constructor = false; |
1245 | 1245 |
1246 Expect(Token::LBRACE, CHECK_OK); | 1246 Expect(Token::LBRACE, CHECK_OK); |
1247 while (peek() != Token::RBRACE) { | 1247 while (peek() != Token::RBRACE) { |
1248 if (Check(Token::SEMICOLON)) continue; | 1248 if (Check(Token::SEMICOLON)) continue; |
1249 const bool in_class = true; | 1249 const bool in_class = true; |
1250 bool is_computed_name = false; // Classes do not care about computed | 1250 bool is_computed_name = false; // Classes do not care about computed |
1251 // property names here. | 1251 // property names here. |
1252 Identifier name; | 1252 Identifier name; |
1253 ExpressionClassifier property_classifier(this); | 1253 ExpressionClassifier property_classifier(this); |
1254 ParsePropertyDefinition(&checker, in_class, has_extends, MethodKind::Normal, | 1254 ParsePropertyDefinition( |
1255 &is_computed_name, &has_seen_constructor, | 1255 &checker, in_class, has_extends, MethodKind::kNormal, &is_computed_name, |
1256 &property_classifier, &name, CHECK_OK); | 1256 &has_seen_constructor, &property_classifier, &name, CHECK_OK); |
1257 ValidateExpression(&property_classifier, CHECK_OK); | 1257 ValidateExpression(&property_classifier, CHECK_OK); |
1258 if (classifier != nullptr) { | 1258 if (classifier != nullptr) { |
1259 classifier->Accumulate(&property_classifier, | 1259 classifier->Accumulate(&property_classifier, |
1260 ExpressionClassifier::ExpressionProductions); | 1260 ExpressionClassifier::ExpressionProductions); |
1261 } | 1261 } |
1262 } | 1262 } |
1263 | 1263 |
1264 Expect(Token::RBRACE, CHECK_OK); | 1264 Expect(Token::RBRACE, CHECK_OK); |
1265 | 1265 |
1266 return Expression::Default(); | 1266 return Expression::Default(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 | 1311 |
1312 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); | 1312 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
1313 } | 1313 } |
1314 | 1314 |
1315 #undef CHECK_OK | 1315 #undef CHECK_OK |
1316 #undef CHECK_OK_CUSTOM | 1316 #undef CHECK_OK_CUSTOM |
1317 | 1317 |
1318 | 1318 |
1319 } // namespace internal | 1319 } // namespace internal |
1320 } // namespace v8 | 1320 } // namespace v8 |
OLD | NEW |