Chromium Code Reviews| Index: src/contexts.cc |
| diff --git a/src/contexts.cc b/src/contexts.cc |
| index f6031f1d058cc5c135b6d077b45162d37bab3ef0..c9c944c925c2250fa45599b19813936955573320 100644 |
| --- a/src/contexts.cc |
| +++ b/src/contexts.cc |
| @@ -96,7 +96,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, |
| PrintF("\n"); |
| } |
| - // check extension/with object |
| + // Check extension/with/global object. |
| if (context->has_extension()) { |
| Handle<JSObject> extension = Handle<JSObject>(context->extension(), |
| isolate); |
| @@ -119,7 +119,7 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, |
| } |
| } |
| - if (context->is_function_context()) { |
|
Kevin Millikin (Chromium)
2011/06/08 16:35:52
Global contexts used to satisfy this predicate, bu
Mads Ager (chromium)
2011/06/09 07:31:00
Could you add a comment to that effect before the
|
| + if (context->IsFunctionContext()) { |
| // we have context-local slots |
| // check non-parameter locals in context |
| @@ -189,9 +189,8 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags, |
| // proceed with enclosing context |
| if (context->IsGlobalContext()) { |
| follow_context_chain = false; |
| - } else if (context->is_function_context()) { |
|
Kevin Millikin (Chromium)
2011/06/08 16:35:52
Global contexts couldn't reach this site.
|
| - context = Handle<Context>(Context::cast(context->closure()->context()), |
| - isolate); |
| + } else if (context->IsFunctionContext()) { |
| + context = Handle<Context>(context->closure()->context(), isolate); |
| } else { |
| context = Handle<Context>(context->previous(), isolate); |
| } |
| @@ -212,11 +211,12 @@ bool Context::GlobalIfNotShadowedByEval(Handle<String> name) { |
| // before the global context and check that there are no context |
| // extension objects (conservative check for with statements). |
| while (!context->IsGlobalContext()) { |
| - // Check if the context is a potentially a with context. |
| + // Check if the context is a catch or with context, or has called |
| + // non-strict eval. |
| if (context->has_extension()) return false; |
| // Not a with context so it must be a function context. |
| - ASSERT(context->is_function_context()); |
|
Kevin Millikin (Chromium)
2011/06/08 16:35:52
Global contexts couldn't reach this site.
|
| + ASSERT(context->IsFunctionContext()); |
| // Check non-parameter locals. |
| Handle<SerializedScopeInfo> scope_info( |