| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/ast/ast.h" | 5 #include "src/ast/ast.h" |
| 6 #include "src/ast/ast-expression-rewriter.h" | 6 #include "src/ast/ast-expression-rewriter.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 | 192 |
| 193 void AstExpressionRewriter::VisitFunctionLiteral(FunctionLiteral* node) { | 193 void AstExpressionRewriter::VisitFunctionLiteral(FunctionLiteral* node) { |
| 194 REWRITE_THIS(node); | 194 REWRITE_THIS(node); |
| 195 VisitDeclarations(node->scope()->declarations()); | 195 VisitDeclarations(node->scope()->declarations()); |
| 196 ZoneList<Statement*>* body = node->body(); | 196 ZoneList<Statement*>* body = node->body(); |
| 197 if (body != nullptr) VisitStatements(body); | 197 if (body != nullptr) VisitStatements(body); |
| 198 } | 198 } |
| 199 | 199 |
| 200 | 200 |
| 201 void AstExpressionRewriter::VisitClassLiteral(ClassLiteral* node) { | |
| 202 REWRITE_THIS(node); | |
| 203 // Not visiting `class_variable_proxy_`. | |
| 204 if (node->extends() != nullptr) { | |
| 205 AST_REWRITE_PROPERTY(Expression, node, extends); | |
| 206 } | |
| 207 AST_REWRITE_PROPERTY(FunctionLiteral, node, constructor); | |
| 208 ZoneList<typename ClassLiteral::Property*>* properties = node->properties(); | |
| 209 for (int i = 0; i < properties->length(); i++) { | |
| 210 VisitObjectLiteralProperty(properties->at(i)); | |
| 211 } | |
| 212 } | |
| 213 | |
| 214 | |
| 215 void AstExpressionRewriter::VisitNativeFunctionLiteral( | 201 void AstExpressionRewriter::VisitNativeFunctionLiteral( |
| 216 NativeFunctionLiteral* node) { | 202 NativeFunctionLiteral* node) { |
| 217 REWRITE_THIS(node); | 203 REWRITE_THIS(node); |
| 218 NOTHING(); | 204 NOTHING(); |
| 219 } | 205 } |
| 220 | 206 |
| 221 | 207 |
| 222 void AstExpressionRewriter::VisitConditional(Conditional* node) { | 208 void AstExpressionRewriter::VisitConditional(Conditional* node) { |
| 223 REWRITE_THIS(node); | 209 REWRITE_THIS(node); |
| 224 AST_REWRITE_PROPERTY(Expression, node, condition); | 210 AST_REWRITE_PROPERTY(Expression, node, condition); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 | 378 |
| 393 void AstExpressionRewriter::VisitRewritableExpression( | 379 void AstExpressionRewriter::VisitRewritableExpression( |
| 394 RewritableExpression* node) { | 380 RewritableExpression* node) { |
| 395 REWRITE_THIS(node); | 381 REWRITE_THIS(node); |
| 396 AST_REWRITE(Expression, node->expression(), node->Rewrite(replacement)); | 382 AST_REWRITE(Expression, node->expression(), node->Rewrite(replacement)); |
| 397 } | 383 } |
| 398 | 384 |
| 399 | 385 |
| 400 } // namespace internal | 386 } // namespace internal |
| 401 } // namespace v8 | 387 } // namespace v8 |
| OLD | NEW |