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

Side by Side Diff: src/parser.cc

Issue 1168643005: [es6] parse destructuring assignment (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP #1 Created 5 years, 4 months 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
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 3477 matching lines...) Expand 10 before | Expand all | Expand 10 after
3488 3488
3489 inner_scope->set_end_position(scanner()->location().end_pos); 3489 inner_scope->set_end_position(scanner()->location().end_pos);
3490 inner_block->set_scope(inner_scope); 3490 inner_block->set_scope(inner_scope);
3491 scope_ = for_scope; 3491 scope_ = for_scope;
3492 3492
3493 outer_loop->Initialize(NULL, NULL, NULL, inner_block); 3493 outer_loop->Initialize(NULL, NULL, NULL, inner_block);
3494 return outer_block; 3494 return outer_block;
3495 } 3495 }
3496 3496
3497 3497
3498 Expression* Parser::DesugarDestructuringAssignment(Expression* expr) {
3499 // TODO(caitp): implement the desugaring
3500 DCHECK(expr->IsAssignment());
3501 Assignment* assign = expr->AsAssignment();
3502 while (assign->value()->IsAssignment()) {
3503 assign = assign->value()->AsAssignment();
3504 }
3505 return assign->value();
3506 }
3507
3508
3498 Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, 3509 Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
3499 bool* ok) { 3510 bool* ok) {
3500 // ForStatement :: 3511 // ForStatement ::
3501 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement 3512 // 'for' '(' Expression? ';' Expression? ';' Expression? ')' Statement
3502 3513
3503 int stmt_pos = peek_position(); 3514 int stmt_pos = peek_position();
3504 bool is_const = false; 3515 bool is_const = false;
3505 Statement* init = NULL; 3516 Statement* init = NULL;
3506 ZoneList<const AstRawString*> lexical_bindings(1, zone()); 3517 ZoneList<const AstRawString*> lexical_bindings(1, zone());
3507 3518
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 Expression* Parser::SpreadCallNew(Expression* function, 6053 Expression* Parser::SpreadCallNew(Expression* function,
6043 ZoneList<v8::internal::Expression*>* args, 6054 ZoneList<v8::internal::Expression*>* args,
6044 int pos) { 6055 int pos) {
6045 args->InsertAt(0, function, zone()); 6056 args->InsertAt(0, function, zone());
6046 6057
6047 return factory()->NewCallRuntime( 6058 return factory()->NewCallRuntime(
6048 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 6059 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
6049 } 6060 }
6050 } // namespace internal 6061 } // namespace internal
6051 } // namespace v8 6062 } // namespace v8
OLDNEW
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698