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

Unified Diff: src/ast/scopes.cc

Issue 2551023004: [ignition] Fix hole check for dynamic local variables (Closed)
Patch Set: Add a DCHECK and a comment 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 c351f1d0d6f50d3ac39216ab3754f045b34b72a4..8530d6cc90fc5b4cc8ad6b9317d6f83e793dbe6a 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1707,6 +1707,15 @@ void Scope::ResolveVariable(ParseInfo* info, VariableProxy* proxy) {
namespace {
bool AccessNeedsHoleCheck(Variable* var, VariableProxy* proxy, Scope* scope) {
+ if (var->mode() == DYNAMIC_LOCAL) {
+ // Dynamically introduced variables never need a hole check (since they're
+ // VAR bindings, either from var or function declarations), but the variable
+ // they shadow might need a hole check, which we want to do if we decide
+ // that no shadowing variable was dynamically introoduced.
+ DCHECK(!var->binding_needs_init());
+ return AccessNeedsHoleCheck(var->local_if_not_shadowed(), proxy, scope);
+ }
+
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