Index: src/contexts.cc |
diff --git a/src/contexts.cc b/src/contexts.cc |
index aef58e601e906eb07fbcb35682686a8fb20209f0..4b4b67bed4f03c502bcda513787c321de54cc1e2 100644 |
--- a/src/contexts.cc |
+++ b/src/contexts.cc |
@@ -7,6 +7,7 @@ |
#include "src/bootstrapper.h" |
#include "src/debug.h" |
#include "src/scopeinfo.h" |
+#include "src/unscopables.h" |
namespace v8 { |
namespace internal { |
@@ -110,9 +111,13 @@ Handle<Object> Context::Lookup(Handle<String> name, |
if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || |
object->IsJSContextExtensionObject()) { |
maybe = JSReceiver::GetOwnPropertyAttributes(object, name); |
+ } else if (FLAG_harmony_unscopables && context->IsWithContext()) { |
+ LookupIterator it(object, name); |
+ maybe = UnscopableLookup(&it); |
} else { |
maybe = JSReceiver::GetPropertyAttributes(object, name); |
} |
+ |
if (!maybe.has_value) return Handle<Object>(); |
DCHECK(!isolate->has_pending_exception()); |
*attributes = maybe.value; |