| Index: src/contexts.cc
|
| diff --git a/src/contexts.cc b/src/contexts.cc
|
| index 3447b42f47dc32d3f37055fc36d9fa30f365ab43..71fe7a9b381c726266aff2560e0e7868ecb3394b 100644
|
| --- a/src/contexts.cc
|
| +++ b/src/contexts.cc
|
| @@ -227,6 +227,11 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
|
| (context->IsWithContext() && ((flags & SKIP_WITH_CONTEXT) == 0)) ||
|
| context->IsFunctionContext() || context->IsBlockContext()) &&
|
| context->extension_receiver() != nullptr) {
|
| + // A dynamic context will never bind "this" or a synthetic variable;
|
| + // scope analysis has already ensured that these are resolved
|
| + // statically.
|
| + DCHECK(!ScopeInfo::VariableIsSynthetic(*name));
|
| +
|
| Handle<JSReceiver> object(context->extension_receiver());
|
|
|
| if (context->IsNativeContext()) {
|
| @@ -261,20 +266,15 @@ Handle<Object> Context::Lookup(Handle<String> name, ContextLookupFlags flags,
|
| object->IsJSContextExtensionObject()) {
|
| maybe = JSReceiver::GetOwnPropertyAttributes(object, name);
|
| } else if (context->IsWithContext()) {
|
| - // A with context will never bind "this".
|
| - if (name->Equals(*isolate->factory()->this_string())) {
|
| - maybe = Just(ABSENT);
|
| + LookupIterator it(object, name, object);
|
| + Maybe<bool> found = UnscopableLookup(&it);
|
| + if (found.IsNothing()) {
|
| + maybe = Nothing<PropertyAttributes>();
|
| } else {
|
| - LookupIterator it(object, name, object);
|
| - Maybe<bool> found = UnscopableLookup(&it);
|
| - if (found.IsNothing()) {
|
| - maybe = Nothing<PropertyAttributes>();
|
| - } else {
|
| - // Luckily, consumers of |maybe| only care whether the property
|
| - // was absent or not, so we can return a dummy |NONE| value
|
| - // for its attributes when it was present.
|
| - maybe = Just(found.FromJust() ? NONE : ABSENT);
|
| - }
|
| + // Luckily, consumers of |maybe| only care whether the property
|
| + // was absent or not, so we can return a dummy |NONE| value
|
| + // for its attributes when it was present.
|
| + maybe = Just(found.FromJust() ? NONE : ABSENT);
|
| }
|
| } else {
|
| maybe = JSReceiver::GetPropertyAttributes(object, name);
|
|
|