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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 ValidateExpression(CHECK_OK); | 1049 ValidateExpression(CHECK_OK); |
1050 impl()->AccumulateFormalParameterContainmentErrors(); | 1050 impl()->AccumulateFormalParameterContainmentErrors(); |
1051 } | 1051 } |
1052 | 1052 |
1053 ClassLiteralChecker checker(this); | 1053 ClassLiteralChecker checker(this); |
1054 bool has_seen_constructor = false; | 1054 bool has_seen_constructor = false; |
1055 | 1055 |
1056 Expect(Token::LBRACE, CHECK_OK); | 1056 Expect(Token::LBRACE, CHECK_OK); |
1057 while (peek() != Token::RBRACE) { | 1057 while (peek() != Token::RBRACE) { |
1058 if (Check(Token::SEMICOLON)) continue; | 1058 if (Check(Token::SEMICOLON)) continue; |
1059 const bool in_class = true; | |
1060 bool is_computed_name = false; // Classes do not care about computed | 1059 bool is_computed_name = false; // Classes do not care about computed |
1061 // property names here. | 1060 // property names here. |
1062 Identifier name; | 1061 Identifier name; |
1063 ExpressionClassifier property_classifier(this); | 1062 ExpressionClassifier property_classifier(this); |
1064 ParsePropertyDefinition(&checker, in_class, has_extends, &is_computed_name, | 1063 ParseClassPropertyDefinition(&checker, has_extends, &is_computed_name, |
1065 &has_seen_constructor, &name, CHECK_OK); | 1064 &has_seen_constructor, &name, CHECK_OK); |
1066 ValidateExpression(CHECK_OK); | 1065 ValidateExpression(CHECK_OK); |
1067 impl()->AccumulateFormalParameterContainmentErrors(); | 1066 impl()->AccumulateFormalParameterContainmentErrors(); |
1068 } | 1067 } |
1069 | 1068 |
1070 Expect(Token::RBRACE, CHECK_OK); | 1069 Expect(Token::RBRACE, CHECK_OK); |
1071 | 1070 |
1072 return Expression::Default(); | 1071 return Expression::Default(); |
1073 } | 1072 } |
1074 | 1073 |
1075 | 1074 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 | 1115 |
1117 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); | 1116 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
1118 } | 1117 } |
1119 | 1118 |
1120 #undef CHECK_OK | 1119 #undef CHECK_OK |
1121 #undef CHECK_OK_CUSTOM | 1120 #undef CHECK_OK_CUSTOM |
1122 | 1121 |
1123 | 1122 |
1124 } // namespace internal | 1123 } // namespace internal |
1125 } // namespace v8 | 1124 } // namespace v8 |
OLD | NEW |