Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: src/contexts.cc

Issue 384963002: ES6 Unscopables (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/contexts.h ('k') | src/flag-definitions.h » ('j') | src/unscopables.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/contexts.h ('k') | src/flag-definitions.h » ('j') | src/unscopables.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698