Reviewers: Mads Ager, antonm,

Description:
Make sure that post-interceptor property getter doesn't assume name lookup is
enough.

R=ager
TEST=none
BUG=20104



Please review this at http://codereview.chromium.org/629008

SVN Base: http://v8.googlecode.com/svn/trunk/

Affected files:
  M     src/objects.cc


Index: src/objects.cc
===================================================================
--- src/objects.cc      (revision 3836)
+++ src/objects.cc      (working copy)
@@ -6170,7 +6170,13 @@
   // Check local property in holder, ignore interceptor.
   LookupResult result;
   LocalLookupRealNamedProperty(name, &result);
- if (result.IsValid()) return GetProperty(receiver, &result, name, attributes);
+  if (result.IsValid()) {
+    Object* p = GetProperty(receiver, &result, name, attributes);
+    // Successful name lookup doesn't mean the value is there, because the
+ // name could've been introduced by the interceptor. Only return property
+    // if it's not absent.
+    if (*attributes != ABSENT) return p;
+  }
   // Continue searching via the prototype chain.
   Object* pt = GetPrototype();
   *attributes = ABSENT;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to