Diff
Modified: trunk/LayoutTests/ChangeLog (202942 => 202943)
--- trunk/LayoutTests/ChangeLog 2016-07-07 23:06:42 UTC (rev 202942)
+++ trunk/LayoutTests/ChangeLog 2016-07-07 23:22:13 UTC (rev 202943)
@@ -1,3 +1,14 @@
+2016-07-07 Benjamin Poulain <[email protected]>
+
+ [JSC] Array.prototype[Symbol.unscopables] should have the "includes" property
+ https://bugs.webkit.org/show_bug.cgi?id=159504
+
+ Reviewed by Keith Miller.
+
+ * js/array-unscopables-properties-expected.txt: Added.
+ * js/array-unscopables-properties.html: Added.
+ * js/script-tests/array-unscopables-properties.js: Added.
+
2016-07-07 Ryan Haddad <[email protected]>
Land test expectations for rdar://problem/27197375.
Added: trunk/LayoutTests/js/array-unscopables-properties-expected.txt (0 => 202943)
--- trunk/LayoutTests/js/array-unscopables-properties-expected.txt (rev 0)
+++ trunk/LayoutTests/js/array-unscopables-properties-expected.txt 2016-07-07 23:22:13 UTC (rev 202943)
@@ -0,0 +1,48 @@
+Verify the various properties of Array.prototype[@@unscopables]
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS typeof Array.prototype[Symbol.unscopables] is "object"
+PASS Object.getPrototypeOf(Array.prototype[Symbol.unscopables]) is null
+PASS Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).writable is false
+PASS Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).enumerable is false
+PASS Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).configurable is true
+PASS Object.getOwnPropertyNames(Array.prototype[Symbol.unscopables]) is expectedEntries
+PASS Object.getOwnPropertySymbols(Array.prototype[Symbol.unscopables]) is []
+PASS Array.prototype[Symbol.unscopables]["copyWithin"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "copyWithin").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "copyWithin").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "copyWithin").configurable is true
+PASS Array.prototype[Symbol.unscopables]["entries"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "entries").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "entries").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "entries").configurable is true
+PASS Array.prototype[Symbol.unscopables]["fill"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "fill").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "fill").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "fill").configurable is true
+PASS Array.prototype[Symbol.unscopables]["find"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "find").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "find").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "find").configurable is true
+PASS Array.prototype[Symbol.unscopables]["findIndex"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findIndex").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findIndex").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "findIndex").configurable is true
+PASS Array.prototype[Symbol.unscopables]["includes"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "includes").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "includes").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "includes").configurable is true
+PASS Array.prototype[Symbol.unscopables]["keys"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "keys").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "keys").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "keys").configurable is true
+PASS Array.prototype[Symbol.unscopables]["values"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "values").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "values").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "values").configurable is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/js/array-unscopables-properties.html (0 => 202943)
--- trunk/LayoutTests/js/array-unscopables-properties.html (rev 0)
+++ trunk/LayoutTests/js/array-unscopables-properties.html 2016-07-07 23:22:13 UTC (rev 202943)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/js/script-tests/array-unscopables-properties.js (0 => 202943)
--- trunk/LayoutTests/js/script-tests/array-unscopables-properties.js (rev 0)
+++ trunk/LayoutTests/js/script-tests/array-unscopables-properties.js 2016-07-07 23:22:13 UTC (rev 202943)
@@ -0,0 +1,27 @@
+description("Verify the various properties of Array.prototype[@@unscopables]");
+
+shouldBeEqualToString("typeof Array.prototype[Symbol.unscopables]", "object");
+shouldBe("Object.getPrototypeOf(Array.prototype[Symbol.unscopables])", "null");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).writable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).enumerable");
+shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).configurable");
+
+let expectedEntries = [
+ "copyWithin",
+ "entries",
+ "fill",
+ "find",
+ "findIndex",
+ "includes",
+ "keys",
+ "values"
+];
+shouldBe("Object.getOwnPropertyNames(Array.prototype[Symbol.unscopables])", "expectedEntries");
+shouldBe("Object.getOwnPropertySymbols(Array.prototype[Symbol.unscopables])", "[]");
+
+for (let entry of expectedEntries) {
+ shouldBeTrue("Array.prototype[Symbol.unscopables][\"" + entry + "\"]");
+ shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").writable");
+ shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").enumerable");
+ shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").configurable");
+}
Modified: trunk/Source/_javascript_Core/ChangeLog (202942 => 202943)
--- trunk/Source/_javascript_Core/ChangeLog 2016-07-07 23:06:42 UTC (rev 202942)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-07-07 23:22:13 UTC (rev 202943)
@@ -1,3 +1,17 @@
+2016-07-07 Benjamin Poulain <[email protected]>
+
+ [JSC] Array.prototype[Symbol.unscopables] should have the "includes" property
+ https://bugs.webkit.org/show_bug.cgi?id=159504
+
+ Reviewed by Keith Miller.
+
+ The property "includes" was missing.
+ Spec: https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
+
+ * runtime/ArrayPrototype.cpp:
+ (JSC::ArrayPrototype::finishCreation):
+ * tests/stress/unscopables.js:
+
2016-07-07 Saam Barati <[email protected]>
ToThis constant folding in DFG is incorrect when the structure indicates that toThis is overridden
Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (202942 => 202943)
--- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2016-07-07 23:06:42 UTC (rev 202942)
+++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2016-07-07 23:22:13 UTC (rev 202943)
@@ -126,6 +126,7 @@
"fill",
"find",
"findIndex",
+ "includes",
"keys",
"values"
};
Modified: trunk/Source/_javascript_Core/tests/stress/unscopables.js (202942 => 202943)
--- trunk/Source/_javascript_Core/tests/stress/unscopables.js 2016-07-07 23:06:42 UTC (rev 202942)
+++ trunk/Source/_javascript_Core/tests/stress/unscopables.js 2016-07-07 23:22:13 UTC (rev 202943)
@@ -9,7 +9,7 @@
test(typeof unscopables, "object");
test(unscopables.__proto__, undefined);
- test(String(Object.keys(unscopables).sort()), "copyWithin,entries,fill,find,findIndex,keys,values");
+ test(String(Object.keys(unscopables).sort()), "copyWithin,entries,fill,find,findIndex,includes,keys,values");
}());
(function () {