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

Side by Side Diff: src/parser.cc

Issue 14416011: Fix yield inside with (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Add assertion Created 7 years, 8 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/full-codegen.cc ('k') | src/runtime.cc » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 Expect(Token::RPAREN, CHECK_OK); 2564 Expect(Token::RPAREN, CHECK_OK);
2565 2565
2566 top_scope_->DeclarationScope()->RecordWithStatement(); 2566 top_scope_->DeclarationScope()->RecordWithStatement();
2567 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE); 2567 Scope* with_scope = NewScope(top_scope_, WITH_SCOPE);
2568 Statement* stmt; 2568 Statement* stmt;
2569 { BlockState block_state(this, with_scope); 2569 { BlockState block_state(this, with_scope);
2570 with_scope->set_start_position(scanner().peek_location().beg_pos); 2570 with_scope->set_start_position(scanner().peek_location().beg_pos);
2571 stmt = ParseStatement(labels, CHECK_OK); 2571 stmt = ParseStatement(labels, CHECK_OK);
2572 with_scope->set_end_position(scanner().location().end_pos); 2572 with_scope->set_end_position(scanner().location().end_pos);
2573 } 2573 }
2574 return factory()->NewWithStatement(expr, stmt); 2574 return factory()->NewWithStatement(with_scope, expr, stmt);
2575 } 2575 }
2576 2576
2577 2577
2578 CaseClause* Parser::ParseCaseClause(bool* default_seen_ptr, bool* ok) { 2578 CaseClause* Parser::ParseCaseClause(bool* default_seen_ptr, bool* ok) {
2579 // CaseClause :: 2579 // CaseClause ::
2580 // 'case' Expression ':' Statement* 2580 // 'case' Expression ':' Statement*
2581 // 'default' ':' Statement* 2581 // 'default' ':' Statement*
2582 2582
2583 Expression* label = NULL; // NULL expression indicates default case 2583 Expression* label = NULL; // NULL expression indicates default case
2584 if (peek() == Token::CASE) { 2584 if (peek() == Token::CASE) {
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
6036 ASSERT(info()->isolate()->has_pending_exception()); 6036 ASSERT(info()->isolate()->has_pending_exception());
6037 } else { 6037 } else {
6038 result = ParseProgram(); 6038 result = ParseProgram();
6039 } 6039 }
6040 } 6040 }
6041 info()->SetFunction(result); 6041 info()->SetFunction(result);
6042 return (result != NULL); 6042 return (result != NULL);
6043 } 6043 }
6044 6044
6045 } } // namespace v8::internal 6045 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698