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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 2816743002: v8binding: Implements an alternative of WindowProxy.[[DefineOwnProperty]]. (Closed)
Patch Set: Fixed tests. Created 3 years, 8 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
Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
index fa9d7601038597b8aaacb573e1d15af92a3308b4..311259e0d8ceed702c94615e060d26e66876b196 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -115,6 +115,18 @@ DOMWindow* DOMWindow::AnonymousIndexedGetter(uint32_t index) const {
return child ? child->DomWindow() : nullptr;
}
+bool DOMWindow::AnonymousIndexedSetter(uint32_t index,
+ const ScriptValue& value) {
+ // https://html.spec.whatwg.org/C/browsers.html#windowproxy-defineownproperty
+ // step 2 - 1. If P is an array index property name, return false.
+ //
+ // As an alternative way to implement WindowProxy.[[DefineOwnProperty]] for
+ // array index property names, we always intercept and ignore the set
+ // operation for indexed properties, i.e. [[DefineOwnProperty]] for array
+ // index property names has always no effect.
+ return true; // Intercept unconditionally but do nothing.
+}
+
bool DOMWindow::IsCurrentlyDisplayedInFrame() const {
if (GetFrame())
SECURITY_CHECK(GetFrame()->DomWindow() == this);

Powered by Google App Engine
This is Rietveld 408576698