Chromium Code Reviews| Index: src/scopes.cc |
| diff --git a/src/scopes.cc b/src/scopes.cc |
| index 859cbd1ae61c8323c4f9edfb215ac1b8bfd53cc8..0913489eb4dd97cc1ff736effd60139cd2cc0bb4 100644 |
| --- a/src/scopes.cc |
| +++ b/src/scopes.cc |
| @@ -388,14 +388,17 @@ Variable* Scope::LocalLookup(Handle<String> name) { |
| // Check context slot lookup. |
| VariableMode mode; |
| + Variable::Location location = Variable::CONTEXT; |
| InitializationFlag init_flag; |
| int index = scope_info_->ContextSlotIndex(*name, &mode, &init_flag); |
| if (index < 0) { |
| // Check parameters. |
| - mode = VAR; |
| - init_flag = kCreatedInitialized; |
| index = scope_info_->ParameterIndex(*name); |
| if (index < 0) return NULL; |
| + |
| + mode = DYNAMIC; |
| + location = Variable::LOOKUP; |
| + init_flag = kCreatedInitialized; |
| } |
| Variable* var = |
| @@ -405,7 +408,7 @@ Variable* Scope::LocalLookup(Handle<String> name) { |
| true, |
| Variable::NORMAL, |
| init_flag); |
| - var->AllocateTo(Variable::CONTEXT, index); |
| + var->AllocateTo(location, index); |
| return var; |
| } |
| @@ -953,6 +956,8 @@ bool Scope::ResolveVariable(CompilationInfo* info, |
| // by 'eval' introduced variable bindings. |
| if (var->is_global()) { |
| var = NonLocal(proxy->name(), DYNAMIC_GLOBAL); |
| + } else if (var->is_dynamic()) { |
|
Kevin Millikin (Google)
2012/04/12 15:43:15
This is kind of subtle and doesn't jive with the c
|
| + var = NonLocal(proxy->name(), DYNAMIC); |
| } else { |
| Variable* invalidated = var; |
| var = NonLocal(proxy->name(), DYNAMIC_LOCAL); |