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 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 RewriteDestructuringAssignments(); | 3148 RewriteDestructuringAssignments(); |
3149 | 3149 |
3150 *has_duplicate_parameters = | 3150 *has_duplicate_parameters = |
3151 !classifier()->is_valid_formal_parameter_list_without_duplicates(); | 3151 !classifier()->is_valid_formal_parameter_list_without_duplicates(); |
3152 | 3152 |
3153 *materialized_literal_count = function_state.materialized_literal_count(); | 3153 *materialized_literal_count = function_state.materialized_literal_count(); |
3154 *expected_property_count = function_state.expected_property_count(); | 3154 *expected_property_count = function_state.expected_property_count(); |
3155 return body; | 3155 return body; |
3156 } | 3156 } |
3157 | 3157 |
3158 void Parser::DeclareClassVariable(const AstRawString* name, Scope* block_scope, | 3158 void Parser::DeclareClassVariable(const AstRawString* name, |
3159 ClassInfo* class_info, int class_token_pos, | 3159 ClassInfo* class_info, int class_token_pos, |
3160 bool* ok) { | 3160 bool* ok) { |
3161 #ifdef DEBUG | 3161 #ifdef DEBUG |
3162 scope()->SetScopeName(name); | 3162 scope()->SetScopeName(name); |
3163 #endif | 3163 #endif |
3164 | 3164 |
3165 if (name != nullptr) { | 3165 if (name != nullptr) { |
3166 class_info->proxy = factory()->NewVariableProxy(name, NORMAL_VARIABLE); | 3166 class_info->proxy = factory()->NewVariableProxy(name, NORMAL_VARIABLE); |
3167 Declaration* declaration = factory()->NewVariableDeclaration( | 3167 Declaration* declaration = factory()->NewVariableDeclaration( |
3168 class_info->proxy, block_scope, class_token_pos); | 3168 class_info->proxy, scope(), class_token_pos); |
3169 Declare(declaration, DeclarationDescriptor::NORMAL, CONST, | 3169 Declare(declaration, DeclarationDescriptor::NORMAL, CONST, |
3170 Variable::DefaultInitializationFlag(CONST), ok); | 3170 Variable::DefaultInitializationFlag(CONST), ok); |
3171 } | 3171 } |
3172 } | 3172 } |
3173 | 3173 |
3174 // This method declares a property of the given class. It updates the | 3174 // This method declares a property of the given class. It updates the |
3175 // following fields of class_info, as appropriate: | 3175 // following fields of class_info, as appropriate: |
3176 // - constructor | 3176 // - constructor |
3177 // - properties | 3177 // - properties |
3178 void Parser::DeclareClassProperty(const AstRawString* class_name, | 3178 void Parser::DeclareClassProperty(const AstRawString* class_name, |
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5018 | 5018 |
5019 return final_loop; | 5019 return final_loop; |
5020 } | 5020 } |
5021 | 5021 |
5022 #undef CHECK_OK | 5022 #undef CHECK_OK |
5023 #undef CHECK_OK_VOID | 5023 #undef CHECK_OK_VOID |
5024 #undef CHECK_FAILED | 5024 #undef CHECK_FAILED |
5025 | 5025 |
5026 } // namespace internal | 5026 } // namespace internal |
5027 } // namespace v8 | 5027 } // namespace v8 |
OLD | NEW |