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

Side by Side Diff: src/parser.cc

Issue 658423002: Unship ES6 iteration and unscopables on 3.28 (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.28
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/flag-definitions.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/v8.h" 5 #include "src/v8.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/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 pending_error_message_(NULL), 722 pending_error_message_(NULL),
723 pending_error_arg_(NULL), 723 pending_error_arg_(NULL),
724 pending_error_char_arg_(NULL) { 724 pending_error_char_arg_(NULL) {
725 DCHECK(!script_.is_null()); 725 DCHECK(!script_.is_null());
726 isolate_->set_ast_node_id(0); 726 isolate_->set_ast_node_id(0);
727 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping); 727 set_allow_harmony_scoping(!info->is_native() && FLAG_harmony_scoping);
728 set_allow_modules(!info->is_native() && FLAG_harmony_modules); 728 set_allow_modules(!info->is_native() && FLAG_harmony_modules);
729 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native()); 729 set_allow_natives_syntax(FLAG_allow_natives_syntax || info->is_native());
730 set_allow_lazy(false); // Must be explicitly enabled. 730 set_allow_lazy(false); // Must be explicitly enabled.
731 set_allow_generators(FLAG_harmony_generators); 731 set_allow_generators(FLAG_harmony_generators);
732 set_allow_for_of(FLAG_harmony_iteration);
732 set_allow_arrow_functions(FLAG_harmony_arrow_functions); 733 set_allow_arrow_functions(FLAG_harmony_arrow_functions);
733 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals); 734 set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals);
734 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; 735 for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
735 ++feature) { 736 ++feature) {
736 use_counts_[feature] = 0; 737 use_counts_[feature] = 0;
737 } 738 }
738 } 739 }
739 740
740 741
741 FunctionLiteral* Parser::ParseProgram() { 742 FunctionLiteral* Parser::ParseProgram() {
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after
2751 if (loop != NULL) loop->Initialize(cond, body); 2752 if (loop != NULL) loop->Initialize(cond, body);
2752 return loop; 2753 return loop;
2753 } 2754 }
2754 2755
2755 2756
2756 bool Parser::CheckInOrOf(bool accept_OF, 2757 bool Parser::CheckInOrOf(bool accept_OF,
2757 ForEachStatement::VisitMode* visit_mode) { 2758 ForEachStatement::VisitMode* visit_mode) {
2758 if (Check(Token::IN)) { 2759 if (Check(Token::IN)) {
2759 *visit_mode = ForEachStatement::ENUMERATE; 2760 *visit_mode = ForEachStatement::ENUMERATE;
2760 return true; 2761 return true;
2761 } else if (accept_OF && CheckContextualKeyword(CStrVector("of"))) { 2762 } else if (allow_for_of() && accept_OF &&
2763 CheckContextualKeyword(CStrVector("of"))) {
2762 *visit_mode = ForEachStatement::ITERATE; 2764 *visit_mode = ForEachStatement::ITERATE;
2763 return true; 2765 return true;
2764 } 2766 }
2765 return false; 2767 return false;
2766 } 2768 }
2767 2769
2768 2770
2769 void Parser::InitializeForEachStatement(ForEachStatement* stmt, 2771 void Parser::InitializeForEachStatement(ForEachStatement* stmt,
2770 Expression* each, 2772 Expression* each,
2771 Expression* subject, 2773 Expression* subject,
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
3732 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); 3734 DCHECK_EQ(Token::LBRACE, scanner()->current_token());
3733 3735
3734 if (reusable_preparser_ == NULL) { 3736 if (reusable_preparser_ == NULL) {
3735 intptr_t stack_limit = isolate()->stack_guard()->real_climit(); 3737 intptr_t stack_limit = isolate()->stack_guard()->real_climit();
3736 reusable_preparser_ = new PreParser(&scanner_, NULL, stack_limit); 3738 reusable_preparser_ = new PreParser(&scanner_, NULL, stack_limit);
3737 reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping()); 3739 reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping());
3738 reusable_preparser_->set_allow_modules(allow_modules()); 3740 reusable_preparser_->set_allow_modules(allow_modules());
3739 reusable_preparser_->set_allow_natives_syntax(allow_natives_syntax()); 3741 reusable_preparser_->set_allow_natives_syntax(allow_natives_syntax());
3740 reusable_preparser_->set_allow_lazy(true); 3742 reusable_preparser_->set_allow_lazy(true);
3741 reusable_preparser_->set_allow_generators(allow_generators()); 3743 reusable_preparser_->set_allow_generators(allow_generators());
3744 reusable_preparser_->set_allow_for_of(allow_for_of());
3742 reusable_preparser_->set_allow_arrow_functions(allow_arrow_functions()); 3745 reusable_preparser_->set_allow_arrow_functions(allow_arrow_functions());
3743 reusable_preparser_->set_allow_harmony_numeric_literals( 3746 reusable_preparser_->set_allow_harmony_numeric_literals(
3744 allow_harmony_numeric_literals()); 3747 allow_harmony_numeric_literals());
3745 } 3748 }
3746 PreParser::PreParseResult result = 3749 PreParser::PreParseResult result =
3747 reusable_preparser_->PreParseLazyFunction(strict_mode(), 3750 reusable_preparser_->PreParseLazyFunction(strict_mode(),
3748 is_generator(), 3751 is_generator(),
3749 logger); 3752 logger);
3750 return result; 3753 return result;
3751 } 3754 }
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
4802 info()->SetAstValueFactory(ast_value_factory_); 4805 info()->SetAstValueFactory(ast_value_factory_);
4803 } 4806 }
4804 ast_value_factory_ = NULL; 4807 ast_value_factory_ = NULL;
4805 4808
4806 InternalizeUseCounts(); 4809 InternalizeUseCounts();
4807 4810
4808 return (result != NULL); 4811 return (result != NULL);
4809 } 4812 }
4810 4813
4811 } } // namespace v8::internal 4814 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698