| Index: src/scopes.cc
|
| ===================================================================
|
| --- src/scopes.cc (revision 9281)
|
| +++ src/scopes.cc (working copy)
|
| @@ -620,9 +620,9 @@
|
| PrintF("; // ");
|
| if (var->rewrite() != NULL) {
|
| PrintF("%s, ", printer->Print(var->rewrite()));
|
| - if (var->is_accessed_from_inner_function_scope()) PrintF(", ");
|
| + if (var->is_accessed_from_inner_scope()) PrintF(", ");
|
| }
|
| - if (var->is_accessed_from_inner_function_scope()) {
|
| + if (var->is_accessed_from_inner_scope()) {
|
| PrintF("inner scope access");
|
| }
|
| PrintF("\n");
|
| @@ -745,7 +745,7 @@
|
| // another variable that is introduced dynamically via an 'eval' call
|
| // or a 'with' statement).
|
| Variable* Scope::LookupRecursive(Handle<String> name,
|
| - bool from_inner_function,
|
| + bool from_inner_scope,
|
| Variable** invalidated_local) {
|
| // If we find a variable, but the current scope calls 'eval', the found
|
| // variable may not be the correct one (the 'eval' may introduce a
|
| @@ -761,7 +761,7 @@
|
| // (Even if there is an 'eval' in this scope which introduces the
|
| // same variable again, the resulting variable remains the same.
|
| // Note that enclosing 'with' statements are handled at the call site.)
|
| - if (!from_inner_function)
|
| + if (!from_inner_scope)
|
| return var;
|
|
|
| } else {
|
| @@ -777,10 +777,7 @@
|
| var = function_;
|
|
|
| } else if (outer_scope_ != NULL) {
|
| - var = outer_scope_->LookupRecursive(
|
| - name,
|
| - is_function_scope() || from_inner_function,
|
| - invalidated_local);
|
| + var = outer_scope_->LookupRecursive(name, true, invalidated_local);
|
| // We may have found a variable in an outer scope. However, if
|
| // the current scope is inside a 'with', the actual variable may
|
| // be a property introduced via the 'with' statement. Then, the
|
| @@ -797,8 +794,8 @@
|
| ASSERT(var != NULL);
|
|
|
| // If this is a lookup from an inner scope, mark the variable.
|
| - if (from_inner_function) {
|
| - var->MarkAsAccessedFromInnerFunctionScope();
|
| + if (from_inner_scope) {
|
| + var->MarkAsAccessedFromInnerScope();
|
| }
|
|
|
| // If the variable we have found is just a guess, invalidate the
|
| @@ -949,7 +946,7 @@
|
| // via an eval() call. This is only possible if the variable has a
|
| // visible name.
|
| if ((var->is_this() || var->name()->length() > 0) &&
|
| - (var->is_accessed_from_inner_function_scope() ||
|
| + (var->is_accessed_from_inner_scope() ||
|
| scope_calls_eval_ ||
|
| inner_scope_calls_eval_ ||
|
| scope_contains_with_ ||
|
| @@ -972,7 +969,7 @@
|
| // catch-bound variables are always allocated in a context.
|
| if (var->mode() == Variable::TEMPORARY) return false;
|
| if (is_catch_scope() || is_block_scope()) return true;
|
| - return var->is_accessed_from_inner_function_scope() ||
|
| + return var->is_accessed_from_inner_scope() ||
|
| scope_calls_eval_ ||
|
| inner_scope_calls_eval_ ||
|
| scope_contains_with_ ||
|
| @@ -1038,7 +1035,7 @@
|
| if (uses_nonstrict_arguments) {
|
| // Give the parameter a use from an inner scope, to force allocation
|
| // to the context.
|
| - var->MarkAsAccessedFromInnerFunctionScope();
|
| + var->MarkAsAccessedFromInnerScope();
|
| }
|
|
|
| if (MustAllocate(var)) {
|
|
|