Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: src/typing-asm.cc

Issue 1309813007: [es6] implement destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cache te right scope in DeclareAndInitializeVariables() Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/typing-asm.h" 7 #include "src/typing-asm.h"
8 8
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 FAIL(value, "array component expected to be a function"); 570 FAIL(value, "array component expected to be a function");
571 } 571 }
572 elem_type = Type::Union(elem_type, computed_type_, zone()); 572 elem_type = Type::Union(elem_type, computed_type_, zone());
573 } 573 }
574 array_size_ = values->length(); 574 array_size_ = values->length();
575 IntersectResult(expr, Type::Array(elem_type, zone())); 575 IntersectResult(expr, Type::Array(elem_type, zone()));
576 } 576 }
577 577
578 578
579 void AsmTyper::VisitAssignment(Assignment* expr) { 579 void AsmTyper::VisitAssignment(Assignment* expr) {
580 RETURN_IF_VISIT_NODE(expr->destructuring_assignment());
581
580 // Handle function tables and everything else in different passes. 582 // Handle function tables and everything else in different passes.
581 if (!in_function_) { 583 if (!in_function_) {
582 if (expr->value()->IsArrayLiteral()) { 584 if (expr->value()->IsArrayLiteral()) {
583 if (!building_function_tables_) { 585 if (!building_function_tables_) {
584 return; 586 return;
585 } 587 }
586 } else { 588 } else {
587 if (building_function_tables_) { 589 if (building_function_tables_) {
588 return; 590 return;
589 } 591 }
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 computed_type_->Print(); 1208 computed_type_->Print();
1207 PrintF("Expected type: "); 1209 PrintF("Expected type: ");
1208 expected_type_->Print(); 1210 expected_type_->Print();
1209 #endif 1211 #endif
1210 FAIL(expr, msg); 1212 FAIL(expr, msg);
1211 } 1213 }
1212 expected_type_ = save; 1214 expected_type_ = save;
1213 } 1215 }
1214 } // namespace internal 1216 } // namespace internal
1215 } // namespace v8 1217 } // namespace v8
OLDNEW
« src/preparser.h ('K') | « src/prettyprinter.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698