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

Side by Side Diff: src/preparser.h

Issue 1255013002: Split off a separate --harmony_sloppy_let flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix flags on mjsunit tests 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.cc ('k') | test/cctest/test-parsing.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 // 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 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 log_(log), 94 log_(log),
95 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. 95 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
96 stack_limit_(stack_limit), 96 stack_limit_(stack_limit),
97 zone_(zone), 97 zone_(zone),
98 scanner_(scanner), 98 scanner_(scanner),
99 stack_overflow_(false), 99 stack_overflow_(false),
100 allow_lazy_(false), 100 allow_lazy_(false),
101 allow_natives_(false), 101 allow_natives_(false),
102 allow_harmony_arrow_functions_(false), 102 allow_harmony_arrow_functions_(false),
103 allow_harmony_sloppy_(false), 103 allow_harmony_sloppy_(false),
104 allow_harmony_sloppy_let_(false),
104 allow_harmony_computed_property_names_(false), 105 allow_harmony_computed_property_names_(false),
105 allow_harmony_rest_params_(false), 106 allow_harmony_rest_params_(false),
106 allow_harmony_spreadcalls_(false), 107 allow_harmony_spreadcalls_(false),
107 allow_harmony_destructuring_(false), 108 allow_harmony_destructuring_(false),
108 allow_harmony_spread_arrays_(false), 109 allow_harmony_spread_arrays_(false),
109 allow_harmony_new_target_(false), 110 allow_harmony_new_target_(false),
110 allow_strong_mode_(false), 111 allow_strong_mode_(false),
111 allow_legacy_const_(true) {} 112 allow_legacy_const_(true) {}
112 113
113 #define ALLOW_ACCESSORS(name) \ 114 #define ALLOW_ACCESSORS(name) \
114 bool allow_##name() const { return allow_##name##_; } \ 115 bool allow_##name() const { return allow_##name##_; } \
115 void set_allow_##name(bool allow) { allow_##name##_ = allow; } 116 void set_allow_##name(bool allow) { allow_##name##_ = allow; }
116 117
117 ALLOW_ACCESSORS(lazy); 118 ALLOW_ACCESSORS(lazy);
118 ALLOW_ACCESSORS(natives); 119 ALLOW_ACCESSORS(natives);
119 ALLOW_ACCESSORS(harmony_arrow_functions); 120 ALLOW_ACCESSORS(harmony_arrow_functions);
120 ALLOW_ACCESSORS(harmony_sloppy); 121 ALLOW_ACCESSORS(harmony_sloppy);
122 ALLOW_ACCESSORS(harmony_sloppy_let);
121 ALLOW_ACCESSORS(harmony_computed_property_names); 123 ALLOW_ACCESSORS(harmony_computed_property_names);
122 ALLOW_ACCESSORS(harmony_rest_params); 124 ALLOW_ACCESSORS(harmony_rest_params);
123 ALLOW_ACCESSORS(harmony_spreadcalls); 125 ALLOW_ACCESSORS(harmony_spreadcalls);
124 ALLOW_ACCESSORS(harmony_destructuring); 126 ALLOW_ACCESSORS(harmony_destructuring);
125 ALLOW_ACCESSORS(harmony_spread_arrays); 127 ALLOW_ACCESSORS(harmony_spread_arrays);
126 ALLOW_ACCESSORS(harmony_new_target); 128 ALLOW_ACCESSORS(harmony_new_target);
127 ALLOW_ACCESSORS(strong_mode); 129 ALLOW_ACCESSORS(strong_mode);
128 ALLOW_ACCESSORS(legacy_const); 130 ALLOW_ACCESSORS(legacy_const);
129 #undef ALLOW_ACCESSORS 131 #undef ALLOW_ACCESSORS
130 132
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 499
498 LanguageMode language_mode() { return scope_->language_mode(); } 500 LanguageMode language_mode() { return scope_->language_mode(); }
499 bool is_generator() const { return function_state_->is_generator(); } 501 bool is_generator() const { return function_state_->is_generator(); }
500 502
501 bool allow_const() { 503 bool allow_const() {
502 return is_strict(language_mode()) || allow_harmony_sloppy() || 504 return is_strict(language_mode()) || allow_harmony_sloppy() ||
503 allow_legacy_const(); 505 allow_legacy_const();
504 } 506 }
505 507
506 bool allow_let() { 508 bool allow_let() {
507 return is_strict(language_mode()) || allow_harmony_sloppy(); 509 return is_strict(language_mode()) || allow_harmony_sloppy_let();
508 } 510 }
509 511
510 // Report syntax errors. 512 // Report syntax errors.
511 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL, 513 void ReportMessage(MessageTemplate::Template message, const char* arg = NULL,
512 ParseErrorType error_type = kSyntaxError) { 514 ParseErrorType error_type = kSyntaxError) {
513 Scanner::Location source_location = scanner()->location(); 515 Scanner::Location source_location = scanner()->location();
514 Traits::ReportMessageAt(source_location, message, arg, error_type); 516 Traits::ReportMessageAt(source_location, message, arg, error_type);
515 } 517 }
516 518
517 void ReportMessageAt(Scanner::Location location, 519 void ReportMessageAt(Scanner::Location location,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 private: 792 private:
791 Zone* zone_; 793 Zone* zone_;
792 794
793 Scanner* scanner_; 795 Scanner* scanner_;
794 bool stack_overflow_; 796 bool stack_overflow_;
795 797
796 bool allow_lazy_; 798 bool allow_lazy_;
797 bool allow_natives_; 799 bool allow_natives_;
798 bool allow_harmony_arrow_functions_; 800 bool allow_harmony_arrow_functions_;
799 bool allow_harmony_sloppy_; 801 bool allow_harmony_sloppy_;
802 bool allow_harmony_sloppy_let_;
800 bool allow_harmony_computed_property_names_; 803 bool allow_harmony_computed_property_names_;
801 bool allow_harmony_rest_params_; 804 bool allow_harmony_rest_params_;
802 bool allow_harmony_spreadcalls_; 805 bool allow_harmony_spreadcalls_;
803 bool allow_harmony_destructuring_; 806 bool allow_harmony_destructuring_;
804 bool allow_harmony_spread_arrays_; 807 bool allow_harmony_spread_arrays_;
805 bool allow_harmony_new_target_; 808 bool allow_harmony_new_target_;
806 bool allow_strong_mode_; 809 bool allow_strong_mode_;
807 bool allow_legacy_const_; 810 bool allow_legacy_const_;
808 }; 811 };
809 812
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4010 *ok = false; 4013 *ok = false;
4011 return; 4014 return;
4012 } 4015 }
4013 has_seen_constructor_ = true; 4016 has_seen_constructor_ = true;
4014 return; 4017 return;
4015 } 4018 }
4016 } 4019 }
4017 } } // v8::internal 4020 } } // v8::internal
4018 4021
4019 #endif // V8_PREPARSER_H 4022 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698