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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 ValidateExpression(CHECK_OK); | 847 ValidateExpression(CHECK_OK); |
848 impl()->AccumulateFormalParameterContainmentErrors(); | 848 impl()->AccumulateFormalParameterContainmentErrors(); |
849 } | 849 } |
850 | 850 |
851 ClassLiteralChecker checker(this); | 851 ClassLiteralChecker checker(this); |
852 bool has_seen_constructor = false; | 852 bool has_seen_constructor = false; |
853 | 853 |
854 Expect(Token::LBRACE, CHECK_OK); | 854 Expect(Token::LBRACE, CHECK_OK); |
855 while (peek() != Token::RBRACE) { | 855 while (peek() != Token::RBRACE) { |
856 if (Check(Token::SEMICOLON)) continue; | 856 if (Check(Token::SEMICOLON)) continue; |
857 const bool in_class = true; | |
858 bool is_computed_name = false; // Classes do not care about computed | 857 bool is_computed_name = false; // Classes do not care about computed |
859 // property names here. | 858 // property names here. |
860 Identifier name; | 859 Identifier name; |
861 ExpressionClassifier property_classifier(this); | 860 ExpressionClassifier property_classifier(this); |
862 ParsePropertyDefinition(&checker, in_class, has_extends, &is_computed_name, | 861 ParseClassPropertyDefinition(&checker, has_extends, &is_computed_name, |
863 &has_seen_constructor, &name, CHECK_OK); | 862 &has_seen_constructor, &name, CHECK_OK); |
864 ValidateExpression(CHECK_OK); | 863 ValidateExpression(CHECK_OK); |
865 impl()->AccumulateFormalParameterContainmentErrors(); | 864 impl()->AccumulateFormalParameterContainmentErrors(); |
866 } | 865 } |
867 | 866 |
868 Expect(Token::RBRACE, CHECK_OK); | 867 Expect(Token::RBRACE, CHECK_OK); |
869 | 868 |
870 return Expression::Default(); | 869 return Expression::Default(); |
871 } | 870 } |
872 | 871 |
873 | 872 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 913 |
915 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); | 914 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
916 } | 915 } |
917 | 916 |
918 #undef CHECK_OK | 917 #undef CHECK_OK |
919 #undef CHECK_OK_CUSTOM | 918 #undef CHECK_OK_CUSTOM |
920 | 919 |
921 | 920 |
922 } // namespace internal | 921 } // namespace internal |
923 } // namespace v8 | 922 } // namespace v8 |
OLD | NEW |