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

Unified Diff: src/preparser.h

Issue 1219853004: [es6] Initial support for let/const bindings in sloppy mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updated tests and comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 2831266db7a3a206e1a6d00c2fef87bdda17ad4e..aa866647d1eb99ad426b5f7e9dbd116a531edd6f 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -494,7 +494,12 @@ class ParserBase : public Traits {
bool is_generator() const { return function_state_->is_generator(); }
bool allow_const() {
- return is_strict(language_mode()) || allow_legacy_const();
+ return is_strict(language_mode()) || allow_harmony_sloppy() ||
+ allow_legacy_const();
+ }
+
+ bool allow_let() {
+ return is_strict(language_mode()) || allow_harmony_sloppy();
}
// Report syntax errors.

Powered by Google App Engine
This is Rietveld 408576698