Diff
Modified: trunk/LayoutTests/ChangeLog (203045 => 203046)
--- trunk/LayoutTests/ChangeLog 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/LayoutTests/ChangeLog 2016-07-11 04:28:03 UTC (rev 203046)
@@ -1,3 +1,19 @@
+2016-07-10 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r203037.
+ https://bugs.webkit.org/show_bug.cgi?id=159614
+
+ The JSC tests are breaking in elcapitan-debug-tests-jsc and
+ elcapitan-release-tests-jsc (Requested by caiolima on
+ #webkit).
+
+ Reverted changeset:
+
+ "ECMAScript 2016: %TypedArray%.prototype.includes
+ implementation"
+ https://bugs.webkit.org/show_bug.cgi?id=159385
+ http://trac.webkit.org/changeset/203037
+
2016-07-10 Zalan Bujtas <[email protected]>
Fix LogicalSelectionOffsetCaches to work with detached render tree.
Deleted: trunk/LayoutTests/js/script-tests/typed-array-includes.js (203045 => 203046)
--- trunk/LayoutTests/js/script-tests/typed-array-includes.js 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/LayoutTests/js/script-tests/typed-array-includes.js 2016-07-11 04:28:03 UTC (rev 203046)
@@ -1,228 +0,0 @@
-function assertProperError(e) {
- if ((!(e instanceof TypeError)) || e.message.indexOf("Receiver should be a typed array view but was not an object") === -1)
- shouldBeTrue("false");
-}
-
-var tArray;
-
-function testIntTypedArray(TypedArray) {
-
- tArray = new TypedArray([0,2,3]);
- shouldBeTrue("tArray.includes(2)");
- shouldBeTrue("!tArray.includes(4)");
- shouldBeTrue("!tArray.includes(3, 3)");
- shouldBeTrue("tArray.includes(3, -1)");
- shouldBeTrue("tArray.includes(3, {valueOf: () => -1})");
-
- // Test non-array-native values
- shouldBeTrue("tArray.includes(2.0)");
- shouldBeTrue("!tArray.includes(2.5)");
- shouldBeTrue("!tArray.includes(\"abc\")");
- shouldBeTrue("!tArray.includes(null)");
- shouldBeTrue("!tArray.includes(undefined)");
- shouldBeTrue("!tArray.includes({1: ''})");
- shouldBeTrue("!tArray.includes(\"\")");
-
- // Testing TypeError handling
- try {
- tArray = new TypedArray([0, 1, 2]);
- tArray.includes.call(null, 2);
- } catch(e) {
- assertProperError(e);
- }
-
- try {
- tArray = new TypedArray([0, 1, 2]);
- tArray.includes.call(undefined, 2);
- } catch(e) {
- assertProperError(e);
- }
-
-}
-
-testIntTypedArray(Uint8Array);
-testIntTypedArray(Int8Array);
-testIntTypedArray(Uint8ClampedArray);
-testIntTypedArray(Uint16Array);
-testIntTypedArray(Int16Array);
-testIntTypedArray(Uint32Array);
-testIntTypedArray(Int32Array);
-
-var fArray;
-
-function testFloatTypedArray(TypedArray) {
-
- fArray = new TypedArray([1.0, 2.0 , 3.0]);
- shouldBeTrue("fArray.includes(2.0)");
- shouldBeTrue("!fArray.includes(4.0)");
- shouldBeTrue("!fArray.includes(3.0, 3)");
- shouldBeTrue("fArray.includes(3, -1)");
-
- fArray = new TypedArray([NaN]);
- shouldBeTrue("!fArray.includes(\"abc\")");
- shouldBeTrue("!fArray.includes(null)");
- shouldBeTrue("!fArray.includes(undefined)");
- shouldBeTrue("!fArray.includes({1: ''})");
- shouldBeTrue("!fArray.includes(\"\")");
-
- // Testing TypeError handling
- try {
- fArray = new TypedArray([0, 1, 2]);
- fArray.includes.call(null, 2);
- } catch(e) {
- assertProperError(e);
- }
-
- try {
- fArray = new TypedArray([0, 1, 2]);
- fArray.includes.call(undefined, 2);
- } catch(e) {
- assertProperError(e);
- }
-
-}
-
-// NaN handling (only true for Float32 and Float64)
-shouldBeTrue("!(new Uint8Array([NaN]).includes(NaN))");
-shouldBeTrue("new Float32Array([NaN]).includes(NaN)");
-shouldBeTrue("new Float64Array([NaN]).includes(NaN)");
-
-var descriptor;
-var gTypedArray;
-
-function testDescriptor(TypedArray) {
- gTypedArray = TypedArray;
- descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(TypedArray.prototype), "includes");
-
- shouldBeTrue("descriptor.configurable");
- shouldBeTrue("descriptor.writable");
- shouldBeTrue("!descriptor.enumerable");
- shouldBeTrue("descriptor.get === undefined");
- shouldBeTrue("descriptor.set === undefined");
-
- shouldBeTrue("Object.getPrototypeOf(gTypedArray.prototype).includes.name === \"includes\"");
- shouldBeTrue("Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1");
-}
-
-testDescriptor(Uint8Array);
-testDescriptor(Int8Array);
-testDescriptor(Uint8ClampedArray);
-testDescriptor(Uint16Array);
-testDescriptor(Int16Array);
-testDescriptor(Uint32Array);
-testDescriptor(Int32Array);
-testDescriptor(Float32Array);
-testDescriptor(Float64Array);
-
-// Testing boundaries
-
-var arr = new Uint8Array([0, 254]);
-shouldBeTrue("arr.includes(0)");
-shouldBeTrue("arr.includes(254)");
-shouldBeTrue("!arr.includes(255)");
-shouldBeTrue("!arr.includes(-1)");
-
-arr = new Int8Array([-128, 127]);
-shouldBeTrue("arr.includes(-128)");
-shouldBeTrue("arr.includes(127)");
-shouldBeTrue("!arr.includes(128)");
-shouldBeTrue("!arr.includes(-129)");
-
-arr = new Uint8ClampedArray([-128, 256]);
-shouldBeTrue("arr.includes(255)");
-shouldBeTrue("arr.includes(0)");
-shouldBeTrue("!arr.includes(-128)");
-shouldBeTrue("!arr.includes(-256)");
-
-arr = new Uint16Array([0, 65535]);
-shouldBeTrue("arr.includes(0)");
-shouldBeTrue("arr.includes(65535)");
-shouldBeTrue("!arr.includes(65536)");
-shouldBeTrue("!arr.includes(-1)");
-
-arr = new Int16Array([-32768, 32767]);
-shouldBeTrue("arr.includes(-32768)");
-shouldBeTrue("arr.includes(32767)");
-shouldBeTrue("!arr.includes(32768)");
-shouldBeTrue("!arr.includes(-32769)");
-
-arr = new Uint32Array([0, 4294967295]);
-shouldBeTrue("arr.includes(0)");
-shouldBeTrue("arr.includes(4294967295)");
-shouldBeTrue("!arr.includes(4294967296)");
-shouldBeTrue("!arr.includes(-1)");
-
-arr = new Int32Array([-2147483648, 2147483647]);
-shouldBeTrue("arr.includes(-2147483648)");
-shouldBeTrue("arr.includes(2147483647)");
-shouldBeTrue("!arr.includes(2147483648)");
-shouldBeTrue("!arr.includes(-2147483649)");
-
-arr = new Float32Array([-3.402820018375656e+38, 3.402820018375656e+38]);
-shouldBeTrue("arr.includes(-3.402820018375656e+38)");
-shouldBeTrue("arr.includes(3.402820018375656e+38)");
-shouldBeTrue("!arr.includes(3.50282e+38)");
-shouldBeTrue("!arr.includes(-3.50282e+38)");
-
-arr = new Float64Array([-1.79769e+308, 1.79769e+308]);
-shouldBeTrue("arr.includes(-1.79769e+308)");
-shouldBeTrue("arr.includes(1.79769e+308)");
-shouldBeTrue("!arr.includes(-1.89769e+308)");
-shouldBeTrue("!arr.includes(1.89769e+308)");
-
-// Testing Infinity
-
-function testInfinity(TypedArray) {
- arr = new TypedArray([Infinity]);
- shouldBeTrue("arr.includes(Infinity)");
- shouldBeTrue("!arr.includes(-Infinity)");
- shouldBeTrue("!arr.includes(NaN)");
-
- arr = new TypedArray([-Infinity]);
- shouldBeTrue("arr.includes(-Infinity)");
- shouldBeTrue("!arr.includes(Infinity)");
- shouldBeTrue("!arr.includes(NaN)");
-}
-
-testInfinity(Float32Array);
-testInfinity(Float64Array);
-
-// Test float->double precision
-
-shouldBeTrue("!(new Float32Array([2.40282e+38]).includes(2.40282e+38))");
-
-// Checking spec
-var funcCallCount;
-
-function checkingValueOfCall(TypedArray) {
- tArray = new TypedArray([0, 1, 2]);
- funcCallCount = {callCount: 0, valueOf: function() {this.callCount++; return 0;}};
-
- tArray.includes(0, funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 1");
-
- tArray.includes("abc", funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 2");
-
- tArray.includes(null, funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 3");
-
- tArray.includes(undefined, funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 4");
-
- tArray.includes({1: ''}, funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 5");
-
- tArray.includes("", funcCallCount);
- shouldBeTrue("funcCallCount.callCount === 6");
-}
-
-checkingValueOfCall(Uint8Array);
-checkingValueOfCall(Int8Array);
-checkingValueOfCall(Uint8ClampedArray);
-checkingValueOfCall(Uint16Array);
-checkingValueOfCall(Int16Array);
-checkingValueOfCall(Uint32Array);
-checkingValueOfCall(Int32Array);
-checkingValueOfCall(Float32Array);
-checkingValueOfCall(Float64Array);
Deleted: trunk/LayoutTests/js/typed-array-includes-expected.txt (203045 => 203046)
--- trunk/LayoutTests/js/typed-array-includes-expected.txt 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/LayoutTests/js/typed-array-includes-expected.txt 2016-07-11 04:28:03 UTC (rev 203046)
@@ -1,263 +0,0 @@
-JSRegress/typed-array-includes
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS tArray.includes(2) is true
-PASS !tArray.includes(4) is true
-PASS !tArray.includes(3, 3) is true
-PASS tArray.includes(3, -1) is true
-PASS tArray.includes(3, {valueOf: () => -1}) is true
-PASS tArray.includes(2.0) is true
-PASS !tArray.includes(2.5) is true
-PASS !tArray.includes("abc") is true
-PASS !tArray.includes(null) is true
-PASS !tArray.includes(undefined) is true
-PASS !tArray.includes({1: ''}) is true
-PASS !tArray.includes("") is true
-PASS !(new Uint8Array([NaN]).includes(NaN)) is true
-PASS new Float32Array([NaN]).includes(NaN) is true
-PASS new Float64Array([NaN]).includes(NaN) is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS descriptor.configurable is true
-PASS descriptor.writable is true
-PASS !descriptor.enumerable is true
-PASS descriptor.get === undefined is true
-PASS descriptor.set === undefined is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.name === "includes" is true
-PASS Object.getPrototypeOf(gTypedArray.prototype).includes.length === 1 is true
-PASS arr.includes(0) is true
-PASS arr.includes(254) is true
-PASS !arr.includes(255) is true
-PASS !arr.includes(-1) is true
-PASS arr.includes(-128) is true
-PASS arr.includes(127) is true
-PASS !arr.includes(128) is true
-PASS !arr.includes(-129) is true
-PASS arr.includes(255) is true
-PASS arr.includes(0) is true
-PASS !arr.includes(-128) is true
-PASS !arr.includes(-256) is true
-PASS arr.includes(0) is true
-PASS arr.includes(65535) is true
-PASS !arr.includes(65536) is true
-PASS !arr.includes(-1) is true
-PASS arr.includes(-32768) is true
-PASS arr.includes(32767) is true
-PASS !arr.includes(32768) is true
-PASS !arr.includes(-32769) is true
-PASS arr.includes(0) is true
-PASS arr.includes(4294967295) is true
-PASS !arr.includes(4294967296) is true
-PASS !arr.includes(-1) is true
-PASS arr.includes(-2147483648) is true
-PASS arr.includes(2147483647) is true
-PASS !arr.includes(2147483648) is true
-PASS !arr.includes(-2147483649) is true
-PASS arr.includes(-3.402820018375656e+38) is true
-PASS arr.includes(3.402820018375656e+38) is true
-PASS !arr.includes(3.50282e+38) is true
-PASS !arr.includes(-3.50282e+38) is true
-PASS arr.includes(-1.79769e+308) is true
-PASS arr.includes(1.79769e+308) is true
-PASS !arr.includes(-1.89769e+308) is true
-PASS !arr.includes(1.89769e+308) is true
-PASS arr.includes(Infinity) is true
-PASS !arr.includes(-Infinity) is true
-PASS !arr.includes(NaN) is true
-PASS arr.includes(-Infinity) is true
-PASS !arr.includes(Infinity) is true
-PASS !arr.includes(NaN) is true
-PASS arr.includes(Infinity) is true
-PASS !arr.includes(-Infinity) is true
-PASS !arr.includes(NaN) is true
-PASS arr.includes(-Infinity) is true
-PASS !arr.includes(Infinity) is true
-PASS !arr.includes(NaN) is true
-PASS !(new Float32Array([2.40282e+38]).includes(2.40282e+38)) is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS funcCallCount.callCount === 1 is true
-PASS funcCallCount.callCount === 2 is true
-PASS funcCallCount.callCount === 3 is true
-PASS funcCallCount.callCount === 4 is true
-PASS funcCallCount.callCount === 5 is true
-PASS funcCallCount.callCount === 6 is true
-PASS no exception thrown
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/js/typed-array-includes.html (203045 => 203046)
--- trunk/LayoutTests/js/typed-array-includes.html 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/LayoutTests/js/typed-array-includes.html 2016-07-11 04:28:03 UTC (rev 203046)
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
- <head>
- <script src=""
- </head>
- <body>
- <script src=""
- <script src=""
- <script src=""
- <script src=""
- </body>
-</html>
-
Modified: trunk/Source/_javascript_Core/ChangeLog (203045 => 203046)
--- trunk/Source/_javascript_Core/ChangeLog 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-07-11 04:28:03 UTC (rev 203046)
@@ -1,3 +1,19 @@
+2016-07-10 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r203037.
+ https://bugs.webkit.org/show_bug.cgi?id=159614
+
+ The JSC tests are breaking in elcapitan-debug-tests-jsc and
+ elcapitan-release-tests-jsc (Requested by caiolima on
+ #webkit).
+
+ Reverted changeset:
+
+ "ECMAScript 2016: %TypedArray%.prototype.includes
+ implementation"
+ https://bugs.webkit.org/show_bug.cgi?id=159385
+ http://trac.webkit.org/changeset/203037
+
2016-07-10 Caio Lima <[email protected]>
ECMAScript 2016: %TypedArray%.prototype.includes implementation
Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h (203045 => 203046)
--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h 2016-07-11 04:28:03 UTC (rev 203046)
@@ -178,8 +178,6 @@
static ElementType toAdaptorNativeFromValue(ExecState* exec, JSValue jsValue) { return toNativeFromValue<Adaptor>(exec, jsValue); }
- static bool toAdaptorNativeFromValue(ExecState* exec, JSValue jsValue, ElementType& result) { return toNativeFromValue<Adaptor>(exec, jsValue, result); }
-
bool setRangeToValue(ExecState* exec, unsigned start, unsigned end, JSValue jsValue)
{
ASSERT(0 <= start && start <= end && end <= m_length);
Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewPrototypeFunctions.h (203045 => 203046)
--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewPrototypeFunctions.h 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewPrototypeFunctions.h 2016-07-11 04:28:03 UTC (rev 203046)
@@ -202,48 +202,6 @@
}
template<typename ViewClass>
-EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncIncludes(ExecState* exec)
-{
- ViewClass* thisObject = jsCast<ViewClass*>(exec->thisValue());
- if (thisObject->isNeutered())
- return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage);
-
- unsigned length = thisObject->length();
-
- if (!length)
- return JSValue::encode(jsBoolean(false));
-
- JSValue valueToFind = exec->argument(0);
-
- unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
-
- if (!valueToFind.isNumber())
- return JSValue::encode(jsBoolean(false));
-
- typename ViewClass::ElementType* array = thisObject->typedVector();
- typename ViewClass::ElementType target;
- if (!ViewClass::toAdaptorNativeFromValue(exec, valueToFind, target))
- return JSValue::encode(jsBoolean(false));
-
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
-
- if (std::isnan(static_cast<double>(target))) {
- for (; index < length; ++index) {
- if (std::isnan(static_cast<double>(array[index])))
- return JSValue::encode(jsBoolean(true));
- }
- } else {
- for (; index < length; ++index) {
- if (array[index] == target)
- return JSValue::encode(jsBoolean(true));
- }
- }
-
- return JSValue::encode(jsBoolean(false));
-}
-
-template<typename ViewClass>
EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncIndexOf(ExecState* exec)
{
// 22.2.3.13
Modified: trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp (203045 => 203046)
--- trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp 2016-07-11 04:28:03 UTC (rev 203046)
@@ -123,14 +123,6 @@
CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncFill);
}
-static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncIncludes(ExecState* exec)
-{
- JSValue thisValue = exec->thisValue();
- if (!thisValue.isObject())
- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
- CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncIncludes);
-}
-
static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoFuncLastIndexOf(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
@@ -269,7 +261,6 @@
JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("sort", typedArrayPrototypeSortCodeGenerator, DontEnum);
JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->builtinNames().entriesPublicName(), typedArrayPrototypeEntriesCodeGenerator, DontEnum);
JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("fill", typedArrayViewProtoFuncFill, DontEnum, 1);
- JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("includes", typedArrayViewProtoFuncIncludes, DontEnum, 1);
JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("find", typedArrayPrototypeFindCodeGenerator, DontEnum);
JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("findIndex", typedArrayPrototypeFindIndexCodeGenerator, DontEnum);
JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->forEach, typedArrayPrototypeForEachCodeGenerator, DontEnum);
Modified: trunk/Source/_javascript_Core/runtime/ToNativeFromValue.h (203045 => 203046)
--- trunk/Source/_javascript_Core/runtime/ToNativeFromValue.h 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/runtime/ToNativeFromValue.h 2016-07-11 04:28:03 UTC (rev 203046)
@@ -48,16 +48,6 @@
return Adaptor::toNativeFromDouble(value.toNumber(exec));
}
-template<typename Adaptor>
-bool toNativeFromValue(ExecState* exec, JSValue value, typename Adaptor::Type& result)
-{
- if (value.isInt32())
- return Adaptor::toNativeFromInt32(value.asInt32(), result);
- if (value.isNumber())
- return Adaptor::toNativeFromDouble(value.asDouble(), result);
- return Adaptor::toNativeFromDouble(value.toNumber(exec), result);
-}
-
} // namespace JSC
#endif // ToNativeFromValue_h
Modified: trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h (203045 => 203046)
--- trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h 2016-07-11 03:58:49 UTC (rev 203045)
+++ trunk/Source/_javascript_Core/runtime/TypedArrayAdaptors.h 2016-07-11 04:28:03 UTC (rev 203046)
@@ -40,8 +40,6 @@
typedef ViewTypeArg ViewType;
typedef JSViewTypeArg JSViewType;
static const TypedArrayType typeValue = typeValueArg;
- constexpr static const TypeArg minValue = std::numeric_limits<TypeArg>::lowest();
- constexpr static const TypeArg maxValue = std::numeric_limits<TypeArg>::max();
static JSValue toJSValue(Type value)
{
@@ -78,38 +76,6 @@
return OtherAdaptor::toNativeFromUint32(value);
return OtherAdaptor::toNativeFromInt32(value);
}
-
- static bool toNativeFromInt32(int32_t value, Type& result)
- {
- if ((value >= 0 && static_cast<uint32_t>(value) > static_cast<uint32_t>(maxValue)) || value < static_cast<int32_t>(minValue))
- return false;
-
- result = static_cast<Type>(value);
-
- return true;
- }
-
- static bool toNativeFromUint32(uint32_t value, Type& result)
- {
- if (value > static_cast<uint32_t>(maxValue))
- return false;
-
- result = static_cast<Type>(value);
-
- return true;
- }
-
- static bool toNativeFromDouble(double value, Type& result)
- {
- Type integer = static_cast<Type>(value);
- if (static_cast<double>(integer) != value)
- return false;
-
- if (value < 0)
- return toNativeFromInt32(static_cast<int32_t>(value), result);
-
- return toNativeFromUint32(static_cast<uint32_t>(value), result);
- }
};
template<
@@ -120,14 +86,12 @@
typedef ViewTypeArg ViewType;
typedef JSViewTypeArg JSViewType;
static const TypedArrayType typeValue = typeValueArg;
- constexpr static const TypeArg minValue = std::numeric_limits<TypeArg>::lowest();
- constexpr static const TypeArg maxValue = std::numeric_limits<TypeArg>::max();
-
+
static JSValue toJSValue(Type value)
{
return jsDoubleNumber(purifyNaN(value));
}
-
+
static double toDouble(Type value)
{
return static_cast<double>(value);
@@ -137,47 +101,22 @@
{
return static_cast<Type>(value);
}
-
+
static Type toNativeFromUint32(uint32_t value)
{
return static_cast<Type>(value);
}
-
+
static Type toNativeFromDouble(double value)
{
- return static_cast<Type>(value);
+ return value;
}
-
+
template<typename OtherAdaptor>
static typename OtherAdaptor::Type convertTo(Type value)
{
return OtherAdaptor::toNativeFromDouble(value);
}
-
- static bool toNativeFromInt32(int32_t value, Type& result)
- {
- result = static_cast<Type>(value);
- return true;
- }
-
- static Type toNativeFromDouble(double value, Type& result)
- {
- if (std::isnan(value) || std::isinf(value)) {
- result = static_cast<Type>(value);
- return true;
- }
-
- Type valueResult = static_cast<Type>(value);
-
- if (static_cast<double>(valueResult) != value)
- return false;
-
- if (value < minValue || value > maxValue)
- return false;
-
- result = valueResult;
- return true;
- }
};
struct Int8Adaptor;
@@ -226,29 +165,27 @@
typedef Uint8ClampedArray ViewType;
typedef JSUint8ClampedArray JSViewType;
static const TypedArrayType typeValue = TypeUint8Clamped;
- constexpr static const uint8_t minValue = std::numeric_limits<uint8_t>::lowest();
- constexpr static const uint8_t maxValue = std::numeric_limits<uint8_t>::max();
-
+
static JSValue toJSValue(uint8_t value)
{
return jsNumber(value);
}
-
+
static double toDouble(uint8_t value)
{
return static_cast<double>(value);
}
-
+
static Type toNativeFromInt32(int32_t value)
{
return clamp(value);
}
-
+
static Type toNativeFromUint32(uint32_t value)
{
return std::min(static_cast<uint32_t>(255), value);
}
-
+
static Type toNativeFromDouble(double value)
{
if (std::isnan(value) || value < 0)
@@ -257,7 +194,7 @@
return 255;
return static_cast<uint8_t>(lrint(value));
}
-
+
template<typename OtherAdaptor>
static typename OtherAdaptor::Type convertTo(uint8_t value)
{
@@ -264,26 +201,6 @@
return OtherAdaptor::toNativeFromInt32(value);
}
- static bool toNativeFromInt32(int32_t value, Type& result)
- {
- if (value > maxValue || value < minValue)
- return false;
-
- result = static_cast<Type>(value);
-
- return true;
- }
-
- static bool toNativeFromDouble(double value, uint8_t& result)
- {
- uint8_t integer = static_cast<uint8_t>(value);
- if (static_cast<double>(integer) != value)
- return false;
-
- result = integer;
- return true;
- }
-
private:
static uint8_t clamp(int32_t value)
{