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

Unified Diff: src/ast/scopes.cc

Issue 2551023004: [ignition] Fix hole check for dynamic local variables (Closed)
Patch Set: Move shadowed variable check to AccessNeedsHoleCheck Created 4 years 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 | « no previous file | test/mjsunit/regress/regress-crbug-669540.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 1cb3af312d19875ed8c58f927173491f990f6767..4407db13e203a7089b524454492f8f7d2e001da4 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1650,6 +1650,10 @@ void Scope::ResolveVariable(ParseInfo* info, VariableProxy* proxy) {
namespace {
bool AccessNeedsHoleCheck(Variable* var, VariableProxy* proxy, Scope* scope) {
+ if (var->mode() == DYNAMIC_LOCAL) {
+ return AccessNeedsHoleCheck(var->local_if_not_shadowed(), proxy, scope);
adamk 2016/12/07 17:37:41 Can you add a DCHECK here: DCHECK(!var->binding_n
+ }
+
if (!var->binding_needs_init()) {
return false;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-669540.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698