Index: src/contexts.cc |
diff --git a/src/contexts.cc b/src/contexts.cc |
index 60cf93f8d35dce48439c70b035d27cc24b2fed95..58ec94f6730e1bcd866d4eb0d698b5e079b711ce 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>(); |
ASSERT(!isolate->has_pending_exception()); |
*attributes = maybe.value; |