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

Unified Diff: src/scopes.cc

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/scopes.h ('k') | src/token.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 15534314632ec1d5f70dafdfab2436e0d325f6de..4680a1cf6a8518e0467ae45e4571d70af3ec311e 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -165,7 +165,7 @@ void Scope::SetDefaults(ScopeType scope_type,
asm_module_ = false;
asm_function_ = outer_scope != NULL && outer_scope->asm_module_;
// Inherit the strict mode from the parent scope.
- strict_mode_ = outer_scope != NULL ? outer_scope->strict_mode_ : SLOPPY;
+ language_mode_ = outer_scope != NULL ? outer_scope->language_mode_ : SLOPPY;
outer_scope_calls_sloppy_eval_ = false;
inner_scope_calls_eval_ = false;
inner_scope_uses_arguments_ = false;
@@ -187,7 +187,7 @@ void Scope::SetDefaults(ScopeType scope_type,
end_position_ = RelocInfo::kNoPosition;
if (!scope_info.is_null()) {
scope_calls_eval_ = scope_info->CallsEval();
- strict_mode_ = scope_info->strict_mode();
+ language_mode_ = scope_info->language_mode();
}
}
@@ -888,7 +888,7 @@ void Scope::Print(int n) {
if (HasTrivialOuterContext()) {
Indent(n1, "// scope has trivial outer context\n");
}
- if (strict_mode() == STRICT) {
+ if (is_strict(language_mode())) {
Indent(n1, "// strict mode scope\n");
}
if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n");
@@ -1290,7 +1290,7 @@ void Scope::AllocateParameterLocals() {
// In strict mode 'arguments' does not alias formal parameters.
// Therefore in strict mode we allocate parameters as if 'arguments'
// were not used.
- uses_sloppy_arguments = strict_mode() == SLOPPY;
+ uses_sloppy_arguments = is_sloppy(language_mode());
}
if (rest_parameter_ && !MustAllocate(rest_parameter_)) {
« no previous file with comments | « src/scopes.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698