| 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 4684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4695 const bool has_extends = extends != nullptr; | 4695 const bool has_extends = extends != nullptr; |
| 4696 while (peek() != Token::RBRACE) { | 4696 while (peek() != Token::RBRACE) { |
| 4697 if (Check(Token::SEMICOLON)) continue; | 4697 if (Check(Token::SEMICOLON)) continue; |
| 4698 FuncNameInferrer::State fni_state(fni_); | 4698 FuncNameInferrer::State fni_state(fni_); |
| 4699 const bool in_class = true; | 4699 const bool in_class = true; |
| 4700 bool is_computed_name = false; // Classes do not care about computed | 4700 bool is_computed_name = false; // Classes do not care about computed |
| 4701 // property names here. | 4701 // property names here. |
| 4702 ExpressionClassifier property_classifier(this); | 4702 ExpressionClassifier property_classifier(this); |
| 4703 const AstRawString* property_name = nullptr; | 4703 const AstRawString* property_name = nullptr; |
| 4704 ObjectLiteral::Property* property = ParsePropertyDefinition( | 4704 ObjectLiteral::Property* property = ParsePropertyDefinition( |
| 4705 &checker, in_class, has_extends, MethodKind::kNormal, &is_computed_name, | 4705 &checker, in_class, has_extends, &is_computed_name, |
| 4706 &has_seen_constructor, &property_classifier, &property_name, CHECK_OK); | 4706 &has_seen_constructor, &property_classifier, &property_name, CHECK_OK); |
| 4707 RewriteNonPattern(&property_classifier, CHECK_OK); | 4707 RewriteNonPattern(&property_classifier, CHECK_OK); |
| 4708 if (classifier != nullptr) { | 4708 if (classifier != nullptr) { |
| 4709 classifier->AccumulateFormalParameterContainmentErrors( | 4709 classifier->AccumulateFormalParameterContainmentErrors( |
| 4710 &property_classifier); | 4710 &property_classifier); |
| 4711 } | 4711 } |
| 4712 | 4712 |
| 4713 if (has_seen_constructor && constructor == nullptr) { | 4713 if (has_seen_constructor && constructor == nullptr) { |
| 4714 constructor = GetPropertyValue(property)->AsFunctionLiteral(); | 4714 constructor = GetPropertyValue(property)->AsFunctionLiteral(); |
| 4715 DCHECK_NOT_NULL(constructor); | 4715 DCHECK_NOT_NULL(constructor); |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6649 node->Print(Isolate::Current()); | 6649 node->Print(Isolate::Current()); |
| 6650 } | 6650 } |
| 6651 #endif // DEBUG | 6651 #endif // DEBUG |
| 6652 | 6652 |
| 6653 #undef CHECK_OK | 6653 #undef CHECK_OK |
| 6654 #undef CHECK_OK_VOID | 6654 #undef CHECK_OK_VOID |
| 6655 #undef CHECK_FAILED | 6655 #undef CHECK_FAILED |
| 6656 | 6656 |
| 6657 } // namespace internal | 6657 } // namespace internal |
| 6658 } // namespace v8 | 6658 } // namespace v8 |
| OLD | NEW |