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

Unified Diff: Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

Issue 8020005: Merge 95488 - Named property confusion with __proto__ (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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 | « LayoutTests/http/tests/security/window-named-proto-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
===================================================================
--- Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (revision 95814)
+++ Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (working copy)
@@ -549,12 +549,17 @@
return false;
if (key->IsString()) {
+ DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__"));
+
String name = toWebCoreString(key);
// Notice that we can't call HasRealNamedProperty for ACCESS_HAS
// because that would generate infinite recursion.
if (type == v8::ACCESS_HAS && target->tree()->child(name))
return true;
- if (type == v8::ACCESS_GET && target->tree()->child(name) && !host->HasRealNamedProperty(key->ToString()))
+ // We need to explicitly compare against nameOfProtoProperty because
+ // V8's JSObject::LocalLookup finds __proto__ before
+ // interceptors and even when __proto__ isn't a "real named property".
+ if (type == v8::ACCESS_GET && target->tree()->child(name) && !host->HasRealNamedProperty(key->ToString()) && name != nameOfProtoProperty)
return true;
}
« no previous file with comments | « LayoutTests/http/tests/security/window-named-proto-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698