OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 4699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4710 const bool has_extends = extends != nullptr; | 4710 const bool has_extends = extends != nullptr; |
4711 while (peek() != Token::RBRACE) { | 4711 while (peek() != Token::RBRACE) { |
4712 if (Check(Token::SEMICOLON)) continue; | 4712 if (Check(Token::SEMICOLON)) continue; |
4713 FuncNameInferrer::State fni_state(fni_); | 4713 FuncNameInferrer::State fni_state(fni_); |
4714 const bool in_class = true; | 4714 const bool in_class = true; |
4715 bool is_computed_name = false; // Classes do not care about computed | 4715 bool is_computed_name = false; // Classes do not care about computed |
4716 // property names here. | 4716 // property names here. |
4717 ExpressionClassifier property_classifier(this); | 4717 ExpressionClassifier property_classifier(this); |
4718 const AstRawString* property_name = nullptr; | 4718 const AstRawString* property_name = nullptr; |
4719 ObjectLiteral::Property* property = ParsePropertyDefinition( | 4719 ObjectLiteral::Property* property = ParsePropertyDefinition( |
4720 &checker, in_class, has_extends, &is_computed_name, | 4720 &checker, in_class, has_extends, MethodKind::kNormal, &is_computed_name, |
4721 &has_seen_constructor, &property_classifier, &property_name, CHECK_OK); | 4721 &has_seen_constructor, &property_classifier, &property_name, CHECK_OK); |
4722 RewriteNonPattern(&property_classifier, CHECK_OK); | 4722 RewriteNonPattern(&property_classifier, CHECK_OK); |
4723 if (classifier != nullptr) { | 4723 if (classifier != nullptr) { |
4724 classifier->AccumulateFormalParameterContainmentErrors( | 4724 classifier->AccumulateFormalParameterContainmentErrors( |
4725 &property_classifier); | 4725 &property_classifier); |
4726 } | 4726 } |
4727 | 4727 |
4728 if (has_seen_constructor && constructor == nullptr) { | 4728 if (has_seen_constructor && constructor == nullptr) { |
4729 constructor = GetPropertyValue(property)->AsFunctionLiteral(); | 4729 constructor = GetPropertyValue(property)->AsFunctionLiteral(); |
4730 DCHECK_NOT_NULL(constructor); | 4730 DCHECK_NOT_NULL(constructor); |
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6658 node->Print(Isolate::Current()); | 6658 node->Print(Isolate::Current()); |
6659 } | 6659 } |
6660 #endif // DEBUG | 6660 #endif // DEBUG |
6661 | 6661 |
6662 #undef CHECK_OK | 6662 #undef CHECK_OK |
6663 #undef CHECK_OK_VOID | 6663 #undef CHECK_OK_VOID |
6664 #undef CHECK_FAILED | 6664 #undef CHECK_FAILED |
6665 | 6665 |
6666 } // namespace internal | 6666 } // namespace internal |
6667 } // namespace v8 | 6667 } // namespace v8 |
OLD | NEW |