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

Unified Diff: third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html

Issue 1936433002: Use [[DefineOwnProperty]] when converting IDL array values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ToV8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html
diff --git a/third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html b/third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html
new file mode 100644
index 0000000000000000000000000000000000000000..7d69910c3d7bcb17374e88fbcdecc08bd4e12466
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<body>
+<div></div>
+<script>
+
+ test(function () {
+
+ var div = document.querySelector("div");
+ var clickEvent = null;
+
+ div.addEventListener("click", function (ev) { clickEvent = ev; });
+ div.click();
+
+ assert_not_equals(clickEvent, null, "click event captured");
+
+ var getter_called = false;
+ var setter_called = false;
+
+ Object.defineProperty(Array.prototype, "0", {
+ get: function () { getter_called = true; },
+ set: function () { setter_called = true; }
+ });
+
+ var path = clickEvent.path;
+
+ delete Array.prototype["0"];
+
+ assert_false(getter_called, "Array.prototype[0] getter called");
+ assert_false(setter_called, "Array.prototype[0] setter called");
+
+ assert_equals(clickEvent.path.length, 5, "click event path length");
+
+ }, "conversion should use [[DefineOwnProperty]]");
+
+</script>
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ToV8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698