Index: src/contexts.cc |
diff --git a/src/contexts.cc b/src/contexts.cc |
index 3447b42f47dc32d3f37055fc36d9fa30f365ab43..4fb3c833b773195f706c52bcec56cddd8d932ebe 100644 |
--- a/src/contexts.cc |
+++ b/src/contexts.cc |
@@ -261,8 +261,14 @@ 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())) { |
+ // A with context will never bind "this", but debug-eval may look into |
+ // a with context when resolving "this". Other synthetic variables such |
+ // as new.target may be resolved as DYNAMIC_LOCAL due to bug v8:5405 , |
+ // skipping them here serves as a workaround until a more thorough |
+ // fix can be applied. |
+ // TODO(v8:5405): Replace this check with a DCHECK when resolution of |
+ // of synthetic variables does not go through this code path. |
+ if (ScopeInfo::VariableIsSynthetic(*name)) { |
maybe = Just(ABSENT); |
} else { |
LookupIterator it(object, name, object); |