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.h" | 5 #include "src/ast.h" |
6 #include "src/messages.h" | 6 #include "src/messages.h" |
7 #include "src/parser.h" | 7 #include "src/parser.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 | 10 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), | 357 factory()->NewUndefinedLiteral(RelocInfo::kNoPosition), |
358 RelocInfo::kNoPosition); | 358 RelocInfo::kNoPosition); |
359 Expression* value = factory()->NewConditional( | 359 Expression* value = factory()->NewConditional( |
360 is_undefined, node->value(), factory()->NewVariableProxy(temp), | 360 is_undefined, node->value(), factory()->NewVariableProxy(temp), |
361 RelocInfo::kNoPosition); | 361 RelocInfo::kNoPosition); |
362 RecurseIntoSubpattern(node->target(), value); | 362 RecurseIntoSubpattern(node->target(), value); |
363 } | 363 } |
364 | 364 |
365 | 365 |
366 void Parser::PatternRewriter::VisitSpread(Spread* node) { | 366 void Parser::PatternRewriter::VisitSpread(Spread* node) { |
367 // TODO(dslomov): implement. | 367 // TODO(dslomov): implement. |
rossberg
2015/08/25 12:55:56
While you're here, can you change this to UNREACHA
| |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 void Parser::PatternRewriter::VisitEmptyParentheses(EmptyParentheses* node) { | |
372 UNREACHABLE(); | |
373 } | |
374 | |
375 | |
371 // =============== UNREACHABLE ============================= | 376 // =============== UNREACHABLE ============================= |
372 | 377 |
373 void Parser::PatternRewriter::Visit(AstNode* node) { UNREACHABLE(); } | 378 void Parser::PatternRewriter::Visit(AstNode* node) { UNREACHABLE(); } |
374 | 379 |
375 #define NOT_A_PATTERN(Node) \ | 380 #define NOT_A_PATTERN(Node) \ |
376 void Parser::PatternRewriter::Visit##Node(v8::internal::Node*) { \ | 381 void Parser::PatternRewriter::Visit##Node(v8::internal::Node*) { \ |
377 UNREACHABLE(); \ | 382 UNREACHABLE(); \ |
378 } | 383 } |
379 | 384 |
380 NOT_A_PATTERN(BinaryOperation) | 385 NOT_A_PATTERN(BinaryOperation) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 NOT_A_PATTERN(TryFinallyStatement) | 420 NOT_A_PATTERN(TryFinallyStatement) |
416 NOT_A_PATTERN(UnaryOperation) | 421 NOT_A_PATTERN(UnaryOperation) |
417 NOT_A_PATTERN(VariableDeclaration) | 422 NOT_A_PATTERN(VariableDeclaration) |
418 NOT_A_PATTERN(WhileStatement) | 423 NOT_A_PATTERN(WhileStatement) |
419 NOT_A_PATTERN(WithStatement) | 424 NOT_A_PATTERN(WithStatement) |
420 NOT_A_PATTERN(Yield) | 425 NOT_A_PATTERN(Yield) |
421 | 426 |
422 #undef NOT_A_PATTERN | 427 #undef NOT_A_PATTERN |
423 } // namespace internal | 428 } // namespace internal |
424 } // namespace v8 | 429 } // namespace v8 |
OLD | NEW |