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-literal-reindexer.h" | 5 #include "src/ast/ast-literal-reindexer.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 } | 180 } |
181 | 181 |
182 | 182 |
183 void AstLiteralReindexer::VisitCompareOperation(CompareOperation* node) { | 183 void AstLiteralReindexer::VisitCompareOperation(CompareOperation* node) { |
184 Visit(node->left()); | 184 Visit(node->left()); |
185 Visit(node->right()); | 185 Visit(node->right()); |
186 } | 186 } |
187 | 187 |
188 | 188 |
189 void AstLiteralReindexer::VisitSpread(Spread* node) { | 189 void AstLiteralReindexer::VisitSpread(Spread* node) { |
190 #if 0 | |
191 // This is reachable because ParserBase::ParseArrowFunctionLiteral calls | |
192 // ReindexLiterals before calling RewriteDestructuringAssignments. | |
193 // Breaking test case: var f = ([...a]) => {} | |
194 // TODO(rossberg): Add a proper TODO here as to what needs to be done. | |
195 UNREACHABLE(); | |
196 #else | |
nickie
2016/01/18 11:34:45
Andreas, does this stay?
nickie
2016/01/18 14:25:39
We decided the first two lines of the comment stay
| |
190 Visit(node->expression()); | 197 Visit(node->expression()); |
198 #endif | |
191 } | 199 } |
192 | 200 |
193 | 201 |
194 void AstLiteralReindexer::VisitEmptyParentheses(EmptyParentheses* node) {} | 202 void AstLiteralReindexer::VisitEmptyParentheses(EmptyParentheses* node) {} |
195 | 203 |
196 | 204 |
197 void AstLiteralReindexer::VisitForInStatement(ForInStatement* node) { | 205 void AstLiteralReindexer::VisitForInStatement(ForInStatement* node) { |
198 Visit(node->each()); | 206 Visit(node->each()); |
199 Visit(node->enumerable()); | 207 Visit(node->enumerable()); |
200 Visit(node->body()); | 208 Visit(node->body()); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { | 330 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { |
323 // We don't recurse into the declarations or body of the function literal: | 331 // We don't recurse into the declarations or body of the function literal: |
324 } | 332 } |
325 | 333 |
326 | 334 |
327 void AstLiteralReindexer::Reindex(Expression* pattern) { | 335 void AstLiteralReindexer::Reindex(Expression* pattern) { |
328 pattern->Accept(this); | 336 pattern->Accept(this); |
329 } | 337 } |
330 } // namespace internal | 338 } // namespace internal |
331 } // namespace v8 | 339 } // namespace v8 |
OLD | NEW |