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

Unified Diff: src/contexts.cc

Issue 19384004: Proxies: Make 'with' work, plus minor other fixes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « no previous file | src/heap.h » ('j') | src/proxy.js » ('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 58f23e70065c5b88ce936c93c663cdafc9e7f101..0fddfdf5058a1ee35daf5df1b915401bd3f558ba 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -124,7 +124,8 @@ Handle<Object> Context::Lookup(Handle<String> name,
if (context->IsNativeContext() ||
context->IsWithContext() ||
(context->IsFunctionContext() && context->has_extension())) {
- Handle<JSObject> object(JSObject::cast(context->extension()), isolate);
+ Handle<JSReceiver> object(
+ JSReceiver::cast(context->extension()), isolate);
// Context extension objects needs to behave as if they have no
// prototype. So even if we want to follow prototype chains, we need
// to only do a local lookup for context extension objects.
@@ -134,6 +135,8 @@ Handle<Object> Context::Lookup(Handle<String> name,
} else {
*attributes = object->GetPropertyAttribute(*name);
}
+ if (isolate->has_pending_exception()) return Handle<Object>();
+
if (*attributes != ABSENT) {
if (FLAG_trace_contexts) {
PrintF("=> found property in context object %p\n",
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/proxy.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698