| 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 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2832 private: | 2832 private: |
| 2833 // This is required so that the overriden Visit* methods can be | 2833 // This is required so that the overriden Visit* methods can be |
| 2834 // called by the base class (template). | 2834 // called by the base class (template). |
| 2835 friend class AstTraversalVisitor<InitializerRewriter>; | 2835 friend class AstTraversalVisitor<InitializerRewriter>; |
| 2836 | 2836 |
| 2837 // Just rewrite destructuring assignments wrapped in RewritableExpressions. | 2837 // Just rewrite destructuring assignments wrapped in RewritableExpressions. |
| 2838 void VisitRewritableExpression(RewritableExpression* to_rewrite) { | 2838 void VisitRewritableExpression(RewritableExpression* to_rewrite) { |
| 2839 if (to_rewrite->is_rewritten()) return; | 2839 if (to_rewrite->is_rewritten()) return; |
| 2840 Parser::PatternRewriter::RewriteDestructuringAssignment(parser_, to_rewrite, | 2840 Parser::PatternRewriter::RewriteDestructuringAssignment(parser_, to_rewrite, |
| 2841 scope_); | 2841 scope_); |
| 2842 AstTraversalVisitor::VisitRewritableExpression(to_rewrite); |
| 2842 } | 2843 } |
| 2843 | 2844 |
| 2844 // Code in function literals does not need to be eagerly rewritten, it will be | 2845 // Code in function literals does not need to be eagerly rewritten, it will be |
| 2845 // rewritten when scheduled. | 2846 // rewritten when scheduled. |
| 2846 void VisitFunctionLiteral(FunctionLiteral* expr) {} | 2847 void VisitFunctionLiteral(FunctionLiteral* expr) {} |
| 2847 | 2848 |
| 2848 Parser* parser_; | 2849 Parser* parser_; |
| 2849 Scope* scope_; | 2850 Scope* scope_; |
| 2850 }; | 2851 }; |
| 2851 | 2852 |
| (...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5129 | 5130 |
| 5130 return final_loop; | 5131 return final_loop; |
| 5131 } | 5132 } |
| 5132 | 5133 |
| 5133 #undef CHECK_OK | 5134 #undef CHECK_OK |
| 5134 #undef CHECK_OK_VOID | 5135 #undef CHECK_OK_VOID |
| 5135 #undef CHECK_FAILED | 5136 #undef CHECK_FAILED |
| 5136 | 5137 |
| 5137 } // namespace internal | 5138 } // namespace internal |
| 5138 } // namespace v8 | 5139 } // namespace v8 |
| OLD | NEW |