Diff
Modified: trunk/JSTests/ChangeLog (218081 => 218082)
--- trunk/JSTests/ChangeLog 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/JSTests/ChangeLog 2017-06-12 02:40:43 UTC (rev 218082)
@@ -1,3 +1,15 @@
+2017-06-11 Keith Miller <[email protected]>
+
+ TypedArray constructor with string shouldn't throw
+ https://bugs.webkit.org/show_bug.cgi?id=173181
+
+ Reviewed by JF Bastien.
+
+ We should be coercing primitive arguments to numbers in the various
+ TypedArray constructors.
+
+ * stress/typedarray-constructor.js:
+
2017-06-11 Yusuke Suzuki <[email protected]>
Unreviewed, update test results part 3
Modified: trunk/JSTests/stress/typedarray-constructor.js (218081 => 218082)
--- trunk/JSTests/stress/typedarray-constructor.js 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/JSTests/stress/typedarray-constructor.js 2017-06-12 02:40:43 UTC (rev 218082)
@@ -63,4 +63,7 @@
shouldBeTrue("testConstructor('(foo)', [1,2])");
+shouldBeTrue("testConstructor('(true)', [0])");
+shouldBeTrue("testConstructor('(`hi`)', [])");
+
finishJSTest();
Modified: trunk/LayoutTests/ChangeLog (218081 => 218082)
--- trunk/LayoutTests/ChangeLog 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/ChangeLog 2017-06-12 02:40:43 UTC (rev 218082)
@@ -1,3 +1,18 @@
+2017-06-11 Keith Miller <[email protected]>
+
+ TypedArray constructor with string shouldn't throw
+ https://bugs.webkit.org/show_bug.cgi?id=173181
+
+ Reviewed by JF Bastien.
+
+ Update tests to allow null buffers.
+
+ * fast/canvas/webgl/array-unit-tests-expected.txt:
+ * fast/canvas/webgl/array-unit-tests.html:
+ * fast/canvas/webgl/webgl-array-invalid-ranges-expected.txt:
+ * fast/canvas/webgl/webgl-array-invalid-ranges.html:
+ * webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
+
2017-06-11 Antoine Quint <[email protected]>
Rebaseline media/modern-media-controls/scrubber
Modified: trunk/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt (218081 => 218082)
--- trunk/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt 2017-06-12 02:40:43 UTC (rev 218082)
@@ -23,9 +23,9 @@
PASS negativeTest Float32Array Subarray
PASS test Float32Array SetBoundaryConditions
PASS test Float32Array ConstructionBoundaryConditions
-PASS Construction of Float32Array with null buffer threw exception
-PASS Construction of Float32Array with (null buffer, 0) threw exception
-PASS Construction of Float32Array with (null buffer, 0, 0) threw exception
+PASS Construction of Float32Array with null buffer shouldn't throw exception
+PASS Construction of Float32Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Float32Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Float32Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Float32Array with out-of-range number of elements threw an exception
PASS Construction of Float32Array with out-of-range offset threw an exception
@@ -79,9 +79,9 @@
PASS negativeTest Float64Array Subarray
PASS test Float64Array SetBoundaryConditions
PASS test Float64Array ConstructionBoundaryConditions
-PASS Construction of Float64Array with null buffer threw exception
-PASS Construction of Float64Array with (null buffer, 0) threw exception
-PASS Construction of Float64Array with (null buffer, 0, 0) threw exception
+PASS Construction of Float64Array with null buffer shouldn't throw exception
+PASS Construction of Float64Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Float64Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Float64Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Float64Array with out-of-range number of elements threw an exception
PASS Construction of Float64Array with out-of-range offset threw an exception
@@ -136,9 +136,9 @@
PASS negativeTest Int8Array Subarray
PASS test Int8Array SetBoundaryConditions
PASS test Int8Array ConstructionBoundaryConditions
-PASS Construction of Int8Array with null buffer threw exception
-PASS Construction of Int8Array with (null buffer, 0) threw exception
-PASS Construction of Int8Array with (null buffer, 0, 0) threw exception
+PASS Construction of Int8Array with null buffer shouldn't throw exception
+PASS Construction of Int8Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Int8Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Int8Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Int8Array with out-of-range number of elements threw an exception
PASS Construction of Int8Array with out-of-range offset threw an exception
@@ -188,9 +188,9 @@
PASS negativeTest Int16Array Subarray
PASS test Int16Array SetBoundaryConditions
PASS test Int16Array ConstructionBoundaryConditions
-PASS Construction of Int16Array with null buffer threw exception
-PASS Construction of Int16Array with (null buffer, 0) threw exception
-PASS Construction of Int16Array with (null buffer, 0, 0) threw exception
+PASS Construction of Int16Array with null buffer shouldn't throw exception
+PASS Construction of Int16Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Int16Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Int16Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Int16Array with out-of-range number of elements threw an exception
PASS Construction of Int16Array with out-of-range offset threw an exception
@@ -245,9 +245,9 @@
PASS negativeTest Int32Array Subarray
PASS test Int32Array SetBoundaryConditions
PASS test Int32Array ConstructionBoundaryConditions
-PASS Construction of Int32Array with null buffer threw exception
-PASS Construction of Int32Array with (null buffer, 0) threw exception
-PASS Construction of Int32Array with (null buffer, 0, 0) threw exception
+PASS Construction of Int32Array with null buffer shouldn't throw exception
+PASS Construction of Int32Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Int32Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Int32Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Int32Array with out-of-range number of elements threw an exception
PASS Construction of Int32Array with out-of-range offset threw an exception
@@ -302,9 +302,9 @@
PASS negativeTest Uint8Array Subarray
PASS test Uint8Array SetBoundaryConditions
PASS test Uint8Array ConstructionBoundaryConditions
-PASS Construction of Uint8Array with null buffer threw exception
-PASS Construction of Uint8Array with (null buffer, 0) threw exception
-PASS Construction of Uint8Array with (null buffer, 0, 0) threw exception
+PASS Construction of Uint8Array with null buffer shouldn't throw exception
+PASS Construction of Uint8Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Uint8Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Uint8Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Uint8Array with out-of-range number of elements threw an exception
PASS Construction of Uint8Array with out-of-range offset threw an exception
@@ -354,9 +354,9 @@
PASS negativeTest Uint8ClampedArray Subarray
PASS test Uint8ClampedArray SetBoundaryConditions
PASS test Uint8ClampedArray ConstructionBoundaryConditions
-PASS Construction of Uint8ClampedArray with null buffer threw exception
-PASS Construction of Uint8ClampedArray with (null buffer, 0) threw exception
-PASS Construction of Uint8ClampedArray with (null buffer, 0, 0) threw exception
+PASS Construction of Uint8ClampedArray with null buffer shouldn't throw exception
+PASS Construction of Uint8ClampedArray with (null buffer, 0) shouldn't throw exception
+PASS Construction of Uint8ClampedArray with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Uint8ClampedArray with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Uint8ClampedArray with out-of-range number of elements threw an exception
PASS Construction of Uint8ClampedArray with out-of-range offset threw an exception
@@ -406,9 +406,9 @@
PASS negativeTest Uint16Array Subarray
PASS test Uint16Array SetBoundaryConditions
PASS test Uint16Array ConstructionBoundaryConditions
-PASS Construction of Uint16Array with null buffer threw exception
-PASS Construction of Uint16Array with (null buffer, 0) threw exception
-PASS Construction of Uint16Array with (null buffer, 0, 0) threw exception
+PASS Construction of Uint16Array with null buffer shouldn't throw exception
+PASS Construction of Uint16Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Uint16Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Uint16Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Uint16Array with out-of-range number of elements threw an exception
PASS Construction of Uint16Array with out-of-range offset threw an exception
@@ -463,9 +463,9 @@
PASS negativeTest Uint32Array Subarray
PASS test Uint32Array SetBoundaryConditions
PASS test Uint32Array ConstructionBoundaryConditions
-PASS Construction of Uint32Array with null buffer threw exception
-PASS Construction of Uint32Array with (null buffer, 0) threw exception
-PASS Construction of Uint32Array with (null buffer, 0, 0) threw exception
+PASS Construction of Uint32Array with null buffer shouldn't throw exception
+PASS Construction of Uint32Array with (null buffer, 0) shouldn't throw exception
+PASS Construction of Uint32Array with (null buffer, 0, 0) shouldn't throw exception
PASS Construction of Uint32Array with exception-throwing array-like object didn't crash unexpectedly
PASS Construction of Uint32Array with out-of-range number of elements threw an exception
PASS Construction of Uint32Array with out-of-range offset threw an exception
Modified: trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html (218081 => 218082)
--- trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/fast/canvas/webgl/array-unit-tests.html 2017-06-12 02:40:43 UTC (rev 218082)
@@ -544,21 +544,21 @@
var array;
try {
array = new type(null);
- testFailed("Construction of " + name + " with null buffer should throw exception");
+ testPassed("Construction of " + name + " with null buffer shouldn't throw exception");
} catch (e) {
testPassed("Construction of " + name + " with null buffer threw exception");
}
try {
- array = new type(null, 0, 0);
- testFailed("Construction of " + name + " with (null buffer, 0) should throw exception");
+ array = new type(null, 0);
+ testPassed("Construction of " + name + " with (null buffer, 0) shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with (null buffer, 0) threw exception");
+ testFailed("Construction of " + name + " with (null buffer, 0) threw exception");
}
try {
array = new type(null, 0, 0);
- testFailed("Construction of " + name + " with (null buffer, 0, 0) should throw exception");
+ testPassed("Construction of " + name + " with (null buffer, 0, 0) shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with (null buffer, 0, 0) threw exception");
+ testFailed("Construction of " + name + " with (null buffer, 0, 0) threw exception");
}
}
Modified: trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges-expected.txt (218081 => 218082)
--- trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges-expected.txt 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges-expected.txt 2017-06-12 02:40:43 UTC (rev 218082)
@@ -2,7 +2,7 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS Construction of Int8Array with null buffer threw exception
+PASS Construction of Int8Array with null buffer shouldn't throw exception
PASS Construction of Int8Array with out-of-range values threw exception
PASS Construction of Int8Array with negative out-of-range values threw exception
Testing subarray of Int8Array
@@ -12,7 +12,7 @@
PASS Setting Int8Array from array with out-of-range offset was caught
PASS Setting Int8Array from fake array with invalid length was caught
PASS Setting Int8Array from Int8Array with out-of-range offset was caught
-PASS Construction of Uint8Array with null buffer threw exception
+PASS Construction of Uint8Array with null buffer shouldn't throw exception
PASS Construction of Uint8Array with out-of-range values threw exception
PASS Construction of Uint8Array with negative out-of-range values threw exception
Testing subarray of Uint8Array
@@ -22,7 +22,7 @@
PASS Setting Uint8Array from array with out-of-range offset was caught
PASS Setting Uint8Array from fake array with invalid length was caught
PASS Setting Uint8Array from Uint8Array with out-of-range offset was caught
-PASS Construction of Int16Array with null buffer threw exception
+PASS Construction of Int16Array with null buffer shouldn't throw exception
PASS Construction of Int16Array with out-of-range values threw exception
PASS Construction of Int16Array with negative out-of-range values threw exception
PASS Construction of huge Int16Array threw exception
@@ -33,7 +33,7 @@
PASS Setting Int16Array from array with out-of-range offset was caught
PASS Setting Int16Array from fake array with invalid length was caught
PASS Setting Int16Array from Int16Array with out-of-range offset was caught
-PASS Construction of Uint16Array with null buffer threw exception
+PASS Construction of Uint16Array with null buffer shouldn't throw exception
PASS Construction of Uint16Array with out-of-range values threw exception
PASS Construction of Uint16Array with negative out-of-range values threw exception
PASS Construction of huge Uint16Array threw exception
@@ -44,7 +44,7 @@
PASS Setting Uint16Array from array with out-of-range offset was caught
PASS Setting Uint16Array from fake array with invalid length was caught
PASS Setting Uint16Array from Uint16Array with out-of-range offset was caught
-PASS Construction of Int32Array with null buffer threw exception
+PASS Construction of Int32Array with null buffer shouldn't throw exception
PASS Construction of Int32Array with out-of-range values threw exception
PASS Construction of Int32Array with negative out-of-range values threw exception
PASS Construction of huge Int32Array threw exception
@@ -55,7 +55,7 @@
PASS Setting Int32Array from array with out-of-range offset was caught
PASS Setting Int32Array from fake array with invalid length was caught
PASS Setting Int32Array from Int32Array with out-of-range offset was caught
-PASS Construction of Uint32Array with null buffer threw exception
+PASS Construction of Uint32Array with null buffer shouldn't throw exception
PASS Construction of Uint32Array with out-of-range values threw exception
PASS Construction of Uint32Array with negative out-of-range values threw exception
PASS Construction of huge Uint32Array threw exception
@@ -66,7 +66,7 @@
PASS Setting Uint32Array from array with out-of-range offset was caught
PASS Setting Uint32Array from fake array with invalid length was caught
PASS Setting Uint32Array from Uint32Array with out-of-range offset was caught
-PASS Construction of Float32Array with null buffer threw exception
+PASS Construction of Float32Array with null buffer shouldn't throw exception
PASS Construction of Float32Array with out-of-range values threw exception
PASS Construction of Float32Array with negative out-of-range values threw exception
PASS Construction of huge Float32Array threw exception
Modified: trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges.html (218081 => 218082)
--- trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges.html 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/fast/canvas/webgl/webgl-array-invalid-ranges.html 2017-06-12 02:40:43 UTC (rev 218082)
@@ -15,9 +15,9 @@
var array;
try {
array = new type(null, 0, 0);
- testFailed("Construction of " + name + " with null buffer should throw exception");
+ testPassed("Construction of " + name + " with null buffer shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with null buffer threw exception");
+ testFailed("Construction of " + name + " with null buffer threw exception");
}
}
Modified: trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html (218081 => 218082)
--- trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/LayoutTests/webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html 2017-06-12 02:40:43 UTC (rev 218082)
@@ -610,21 +610,21 @@
var array;
try {
array = new type(null);
- testFailed("Construction of " + name + " with null buffer should throw exception");
+ testPassed("Construction of " + name + " with null buffer shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with null buffer threw exception");
+ testFailed("Construction of " + name + " with null buffer threw exception");
}
try {
array = new type(null, 0, 0);
- testFailed("Construction of " + name + " with (null buffer, 0) should throw exception");
+ testPassed("Construction of " + name + " with (null buffer, 0) shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with (null buffer, 0) threw exception");
+ testFailed("Construction of " + name + " with (null buffer, 0) threw exception");
}
try {
array = new type(null, 0, 0);
- testFailed("Construction of " + name + " with (null buffer, 0, 0) should throw exception");
+ testPassed("Construction of " + name + " with (null buffer, 0, 0) shouldn't throw exception");
} catch (e) {
- testPassed("Construction of " + name + " with (null buffer, 0, 0) threw exception");
+ testFailed("Construction of " + name + " with (null buffer, 0, 0) threw exception");
}
}
Modified: trunk/Source/_javascript_Core/ChangeLog (218081 => 218082)
--- trunk/Source/_javascript_Core/ChangeLog 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-06-12 02:40:43 UTC (rev 218082)
@@ -1,3 +1,16 @@
+2017-06-11 Keith Miller <[email protected]>
+
+ TypedArray constructor with string shouldn't throw
+ https://bugs.webkit.org/show_bug.cgi?id=173181
+
+ Reviewed by JF Bastien.
+
+ We should be coercing primitive arguments to numbers in the various
+ TypedArray constructors.
+
+ * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+ (JSC::constructGenericTypedArrayViewWithArguments):
+
2017-06-11 Yusuke Suzuki <[email protected]>
[WTF] Make ThreadMessage portable
Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h (218081 => 218082)
--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h 2017-06-12 01:57:30 UTC (rev 218081)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h 2017-06-12 02:40:43 UTC (rev 218082)
@@ -144,7 +144,7 @@
// For everything but DataView, we allow construction with any of:
// - Another array. This creates a copy of the of that array.
- // - An integer. This creates a new typed array of that length and zero-initializes it.
+ // - A primitive. This creates a new typed array of that length and zero-initializes it.
if (JSObject* object = jsDynamicCast<JSObject*>(vm, firstValue)) {
unsigned length;
@@ -202,9 +202,6 @@
return result;
}
- if (!firstValue.isNumber())
- return throwTypeError(exec, scope, ASCIILiteral("Invalid array length argument"));
-
unsigned length = firstValue.toIndex(exec, "length");
RETURN_IF_EXCEPTION(scope, nullptr);
scope.release();