Chromium Code Reviews| Index: src/contexts.cc |
| diff --git a/src/contexts.cc b/src/contexts.cc |
| index a6a61df624a49c9460806a96fee5b166ba65efcd..12eb871e15ddbe5eb9acb67acb4485fcec01c258 100644 |
| --- a/src/contexts.cc |
| +++ b/src/contexts.cc |
| @@ -258,8 +258,13 @@ Handle<Object> Context::Lookup(Handle<String> name, |
| object->IsJSContextExtensionObject()) { |
| maybe = JSReceiver::GetOwnPropertyAttributes(object, name); |
| } else if (context->IsWithContext()) { |
| - LookupIterator it(object, name); |
| - maybe = UnscopableLookup(&it); |
| + // A with context will never bind "this". |
|
rossberg
2015/04/22 15:39:32
Do we have a test for this?
|
| + if (name->Equals(*isolate->factory()->this_string())) { |
| + maybe = Just(ABSENT); |
| + } else { |
| + LookupIterator it(object, name); |
| + maybe = UnscopableLookup(&it); |
| + } |
| } else { |
| maybe = JSReceiver::GetPropertyAttributes(object, name); |
| } |