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

Unified Diff: src/scopes.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) Created 5 years, 11 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
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 9cb7e65a3a86e578d9084078aa6744550e593d13..412ad853f6208a1e94e42c1973f4d759840e478a 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -226,8 +226,10 @@ class Scope: public ZoneObject {
// Inform the scope that the corresponding code uses "this".
void RecordThisUsage() { scope_uses_this_ = true; }
- // Set the strict mode flag (unless disabled by a global flag).
- void SetStrictMode(StrictMode strict_mode) { strict_mode_ = strict_mode; }
+ // Set the language mode flag (unless disabled by a global flag).
+ void SetLanguageMode(LanguageMode language_mode) {
+ language_mode_ = language_mode;
+ }
// Set the ASM module flag.
void SetAsmModule() { asm_module_ = true; }
@@ -291,13 +293,13 @@ class Scope: public ZoneObject {
is_module_scope() || is_script_scope();
}
bool is_strict_eval_scope() const {
- return is_eval_scope() && strict_mode_ == STRICT;
+ return is_eval_scope() && is_strict(language_mode_);
}
// Information about which scopes calls eval.
bool calls_eval() const { return scope_calls_eval_; }
bool calls_sloppy_eval() {
- return scope_calls_eval_ && strict_mode_ == SLOPPY;
+ return scope_calls_eval_ && is_sloppy(language_mode_);
}
bool outer_scope_calls_sloppy_eval() const {
return outer_scope_calls_sloppy_eval_;
@@ -340,7 +342,7 @@ class Scope: public ZoneObject {
ScopeType scope_type() const { return scope_type_; }
// The language mode of this scope.
- StrictMode strict_mode() const { return strict_mode_; }
+ LanguageMode language_mode() const { return language_mode_; }
// The variable corresponding the 'this' value.
Variable* receiver() { return receiver_; }
@@ -547,8 +549,8 @@ class Scope: public ZoneObject {
bool asm_module_;
// This scope's outer context is an asm module.
bool asm_function_;
- // The strict mode of this scope.
- StrictMode strict_mode_;
+ // The language mode of this scope.
+ LanguageMode language_mode_;
// Source positions.
int start_position_;
int end_position_;
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698