Title: [208564] trunk
Revision
208564
Author
commit-qu...@webkit.org
Date
2016-11-10 14:03:24 -0800 (Thu, 10 Nov 2016)

Log Message

test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
https://bugs.webkit.org/show_bug.cgi?id=164450

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-11-10
Reviewed by Darin Adler.

JSTests:

* stress/dataview-typedarray-toindex.js: Added.
Tests for all cases where ToIndex should be used.

* test262.yaml:
New passing tests.

Source/_javascript_Core:

* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toIndex):
Introduce a method for toIndex, which is used by DataView and TypedArrays
to convert an argument to a number with the possibility of throwing
RangeErrors for negative values. We also throw RangeErrors for large
values, because wherever this is used we expect an unsigned.

* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
Use toIndex instead of toUint32 where required.

LayoutTests:

* fast/canvas/webgl/data-view-crash-expected.txt:
* fast/canvas/webgl/data-view-test-expected.txt:
Better error message.

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (208563 => 208564)


--- trunk/JSTests/ChangeLog	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/JSTests/ChangeLog	2016-11-10 22:03:24 UTC (rev 208564)
@@ -1,3 +1,16 @@
+2016-11-10  Joseph Pecoraro  <pecor...@apple.com>
+
+        test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
+        https://bugs.webkit.org/show_bug.cgi?id=164450
+
+        Reviewed by Darin Adler.
+
+        * stress/dataview-typedarray-toindex.js: Added.
+        Tests for all cases where ToIndex should be used.
+
+        * test262.yaml:
+        New passing tests.
+
 2016-11-10  Mark Lam  <mark....@apple.com>
 
         Graph::methodOfGettingAValueProfileFor() should be returning the profile for the operand node.

Added: trunk/JSTests/stress/dataview-typedarray-toindex.js (0 => 208564)


--- trunk/JSTests/stress/dataview-typedarray-toindex.js	                        (rev 0)
+++ trunk/JSTests/stress/dataview-typedarray-toindex.js	2016-11-10 22:03:24 UTC (rev 208564)
@@ -0,0 +1,121 @@
+function assert(condition) {
+    if (!condition)
+        throw new Error("Bad assertion");
+}
+
+function shouldThrowRangeError(func) {
+    var errorThrown = false;
+    var error = null;
+    try {
+        func();
+    } catch (e) {
+        errorThrown = true;
+        error = e;
+    }
+    if (!errorThrown)
+        throw new Error('not thrown');
+    if (!(error instanceof RangeError))
+        throw new Error(`bad error: ${String(error)}`);
+}
+
+// ToIndex (value) https://tc39.github.io/ecma262/#sec-toindex
+// - Convert undefined to 0.
+// - Convert value to Integer, and throws a RangeError if negative.
+// - _javascript_Core also throws a TypeError for Infinity because that would convert tp 2^53 - 1 which is too large for all cases.
+
+let buffer = new ArrayBuffer(128);
+let dataView = new DataView(buffer);    
+let rangeErrorValues = [-1, -Infinity, Infinity];
+let typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];
+
+// ArrayBuffer(length*) https://tc39.github.io/ecma262/#sec-arraybuffer-length
+assert((new ArrayBuffer).byteLength === 0);
+assert((new ArrayBuffer(undefined)).byteLength === 0);
+assert((new ArrayBuffer(-0.9)).byteLength === 0);
+assert((new ArrayBuffer(2.5)).byteLength === 2);
+for (let badValue of rangeErrorValues)
+    shouldThrowRangeError(() => { new ArrayBuffer(badValue); });
+
+// TypedArray(length*) https://tc39.github.io/ecma262/#sec-typedarray-length
+// TypedArray(buffer, byteOffset*, length*) https://tc39.github.io/ecma262/#sec-typedarray-buffer-byteoffset-length
+for (let typedArray of typedArrays) {
+    assert((new typedArray).length === 0);
+    assert((new typedArray(2.5)).length === 2);
+    assert((new typedArray(-0.9)).length === 0);
+    assert((new typedArray(buffer, typedArray.BYTES_PER_ELEMENT + 0.5)).byteOffset === typedArray.BYTES_PER_ELEMENT);
+    assert((new typedArray(buffer, 0, typedArray.BYTES_PER_ELEMENT + 0.5)).byteLength / typedArray.BYTES_PER_ELEMENT === typedArray.BYTES_PER_ELEMENT);
+
+    for (let badValue of rangeErrorValues) {
+        shouldThrowRangeError(() => { new typedArray(badValue); });
+        shouldThrowRangeError(() => { new typedArray(buffer, badValue); });
+        shouldThrowRangeError(() => { new typedArray(buffer, 0, badValue); });
+    }
+}
+
+// DataView(buffer, byteOffset*, byteLength*) https://tc39.github.io/ecma262/#sec-dataview-buffer-byteoffset-bytelength
+assert((new DataView(buffer)).byteOffset === 0);
+assert((new DataView(buffer, undefined)).byteOffset === 0);
+assert((new DataView(buffer, 2.5)).byteOffset === 2);
+assert((new DataView(buffer, -0.9)).byteOffset === 0);
+assert((new DataView(buffer, 0, 4.5)).byteLength === 4);
+for (let badValue of rangeErrorValues) {
+    shouldThrowRangeError(() => { new DataView(buffer, badValue); });
+    shouldThrowRangeError(() => { new DataView(buffer, 0, badValue); });
+}
+
+// GetViewValue(view, index*, ...) https://tc39.github.io/ecma262/#sec-getviewvalue
+// SetViewValue(view, index*, ...) https://tc39.github.io/ecma262/#sec-setviewvalue
+dataView.setInt8(undefined, 42);
+assert(dataView.getInt8(0) === 42);
+dataView.setInt16(undefined, 42);
+assert(dataView.getInt16(0) === 42);
+dataView.setInt32(undefined, 42);
+assert(dataView.getInt32(0) === 42);
+dataView.setUint8(undefined, 42);
+assert(dataView.getUint8(0) === 42);
+dataView.setUint16(undefined, 42);
+assert(dataView.getUint16(0) === 42);
+dataView.setUint32(undefined, 42);
+assert(dataView.getUint32(0) === 42);
+dataView.setFloat32(undefined, 42);
+assert(dataView.getFloat32(0) === 42);
+dataView.setFloat64(undefined, 42);
+assert(dataView.getFloat64(0) === 42);
+
+dataView.setInt8(2.5, 42);
+assert(dataView.getInt8(2) === 42);
+dataView.setInt16(2.5, 42);
+assert(dataView.getInt16(2) === 42);
+dataView.setInt32(2.5, 42);
+assert(dataView.getInt32(2) === 42);
+dataView.setUint8(2.5, 42);
+assert(dataView.getUint8(2) === 42);
+dataView.setUint16(2.5, 42);
+assert(dataView.getUint16(2) === 42);
+dataView.setUint32(2.5, 42);
+assert(dataView.getUint32(2) === 42);
+dataView.setFloat32(2.5, 42);
+assert(dataView.getFloat32(2) === 42);
+dataView.setFloat64(2.5, 42);
+assert(dataView.getFloat64(2) === 42);
+
+for (let badValue of rangeErrorValues) {
+    shouldThrowRangeError(() => { new DataView(buffer, badValue); });
+    shouldThrowRangeError(() => { new DataView(buffer, 0, badValue); });
+    shouldThrowRangeError(() => { dataView.getInt8(badValue); });
+    shouldThrowRangeError(() => { dataView.getInt16(badValue); });
+    shouldThrowRangeError(() => { dataView.getInt32(badValue); });
+    shouldThrowRangeError(() => { dataView.getUint8(badValue); });
+    shouldThrowRangeError(() => { dataView.getUint16(badValue); });
+    shouldThrowRangeError(() => { dataView.getUint32(badValue); });
+    shouldThrowRangeError(() => { dataView.getFloat32(badValue); });
+    shouldThrowRangeError(() => { dataView.getFloat64(badValue); });
+    shouldThrowRangeError(() => { dataView.setInt8(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setInt16(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setInt32(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setUint8(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setUint16(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setUint32(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setFloat32(badValue, 42); });
+    shouldThrowRangeError(() => { dataView.setFloat64(badValue, 42); });
+}

Modified: trunk/JSTests/test262.yaml (208563 => 208564)


--- trunk/JSTests/test262.yaml	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/JSTests/test262.yaml	2016-11-10 22:03:24 UTC (rev 208564)
@@ -12886,9 +12886,9 @@
 - path: test262/test/built-ins/ArrayBuffer/Symbol.species/symbol-species.js
   cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js", "../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/ArrayBuffer/allocation-limit.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/ArrayBuffer/allocation-limit.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/ArrayBuffer/data-allocation-after-object-creation.js
@@ -12966,13 +12966,13 @@
 - path: test262/test/built-ins/ArrayBuffer/length-is-absent.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/ArrayBuffer/length-is-too-large-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/ArrayBuffer/length-is-too-large-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/ArrayBuffer/negative-length-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/ArrayBuffer/negative-length-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/ArrayBuffer/newtarget-prototype-is-not-object.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/ArrayBuffer/newtarget-prototype-is-not-object.js
@@ -13514,9 +13514,9 @@
 - path: test262/test/built-ins/DataView/buffer-reference.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/byteoffset-is-negative-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/byteoffset-is-negative-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/constructor.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/constructor.js
@@ -13554,13 +13554,13 @@
 - path: test262/test/built-ins/DataView/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/excessive-bytelength-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/excessive-bytelength-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/excessive-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/excessive-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/extensibility.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/extensibility.js
@@ -13578,13 +13578,13 @@
 - path: test262/test/built-ins/DataView/name.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/negative-bytelength-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/negative-bytelength-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/newtarget-undefined-throws.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/newtarget-undefined-throws.js
@@ -13718,9 +13718,9 @@
 - path: test262/test/built-ins/DataView/prototype/getFloat32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat32/length.js
@@ -13734,9 +13734,9 @@
 - path: test262/test/built-ins/DataView/prototype/getFloat32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat32/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat32/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -13794,9 +13794,9 @@
 - path: test262/test/built-ins/DataView/prototype/getFloat64/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat64/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat64/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat64/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat64/length.js
@@ -13810,9 +13810,9 @@
 - path: test262/test/built-ins/DataView/prototype/getFloat64/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat64/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat64/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getFloat64/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getFloat64/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -13870,9 +13870,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt16/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt16/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt16/length.js
@@ -13882,9 +13882,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt16/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt16/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt16/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -13934,9 +13934,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt32/length.js
@@ -13946,9 +13946,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt32/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt32/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -13998,9 +13998,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt8/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt8/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt8/length.js
@@ -14010,9 +14010,9 @@
 - path: test262/test/built-ins/DataView/prototype/getInt8/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getInt8/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getInt8/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -14058,9 +14058,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint16/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint16/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint16/length.js
@@ -14070,9 +14070,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint16/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint16/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint16/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -14122,9 +14122,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint32/length.js
@@ -14134,9 +14134,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint32/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint32/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -14186,9 +14186,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint8/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint8/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint8/length.js
@@ -14198,9 +14198,9 @@
 - path: test262/test/built-ins/DataView/prototype/getUint8/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/getUint8/return-abrupt-from-tonumber-byteoffset-symbol.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/getUint8/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -14250,13 +14250,13 @@
 - path: test262/test/built-ins/DataView/prototype/setFloat32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat32/length.js
@@ -14266,9 +14266,9 @@
 - path: test262/test/built-ins/DataView/prototype/setFloat32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat32/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat32/no-value-arg.js
@@ -14334,13 +14334,13 @@
 - path: test262/test/built-ins/DataView/prototype/setFloat64/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat64/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat64/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat64/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat64/length.js
@@ -14350,9 +14350,9 @@
 - path: test262/test/built-ins/DataView/prototype/setFloat64/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat64/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat64/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setFloat64/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setFloat64/no-value-arg.js
@@ -14418,13 +14418,13 @@
 - path: test262/test/built-ins/DataView/prototype/setInt16/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt16/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt16/length.js
@@ -14434,9 +14434,9 @@
 - path: test262/test/built-ins/DataView/prototype/setInt16/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt16/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt16/no-value-arg.js
@@ -14502,13 +14502,13 @@
 - path: test262/test/built-ins/DataView/prototype/setInt32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt32/length.js
@@ -14518,9 +14518,9 @@
 - path: test262/test/built-ins/DataView/prototype/setInt32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt32/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt32/no-value-arg.js
@@ -14586,13 +14586,13 @@
 - path: test262/test/built-ins/DataView/prototype/setInt8/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt8/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt8/length.js
@@ -14602,9 +14602,9 @@
 - path: test262/test/built-ins/DataView/prototype/setInt8/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setInt8/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setInt8/no-value-arg.js
@@ -14662,13 +14662,13 @@
 - path: test262/test/built-ins/DataView/prototype/setUint16/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint16/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint16/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint16/length.js
@@ -14678,9 +14678,9 @@
 - path: test262/test/built-ins/DataView/prototype/setUint16/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint16/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint16/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint16/no-value-arg.js
@@ -14746,13 +14746,13 @@
 - path: test262/test/built-ins/DataView/prototype/setUint32/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint32/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint32/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint32/length.js
@@ -14762,9 +14762,9 @@
 - path: test262/test/built-ins/DataView/prototype/setUint32/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint32/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint32/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint32/no-value-arg.js
@@ -14830,13 +14830,13 @@
 - path: test262/test/built-ins/DataView/prototype/setUint8/detached-buffer.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/detachArrayBuffer.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint8/index-is-out-of-range.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint8/length.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint8/length.js
@@ -14846,9 +14846,9 @@
 - path: test262/test/built-ins/DataView/prototype/setUint8/name.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint8/negative-byteoffset-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:strict]
 - path: test262/test/built-ins/DataView/prototype/setUint8/no-value-arg.js
   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], []
 - path: test262/test/built-ins/DataView/prototype/setUint8/no-value-arg.js
@@ -48286,9 +48286,9 @@
 - path: test262/test/built-ins/TypedArrays/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size.js
   cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-throws.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-zero.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-zero.js
@@ -48318,9 +48318,9 @@
 - path: test262/test/built-ins/TypedArrays/buffer-arg-defined-length.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/buffer-arg-defined-negative-length.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/buffer-arg-defined-negative-length.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/buffer-arg-defined-offset.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/buffer-arg-defined-offset.js
@@ -48786,13 +48786,13 @@
 - path: test262/test/built-ins/TypedArrays/length-arg-init-zeros.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/length-arg-is-infinity-throws-rangeerror.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/length-arg-is-infinity-throws-rangeerror.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/length-arg-is-negative-integer-throws-rangeerror.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/length-arg-is-negative-integer-throws-rangeerror.js
-  cmd: runTest262 :fail, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
+  cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], [:strict]
 - path: test262/test/built-ins/TypedArrays/length-arg-is-symbol-throws.js
   cmd: runTest262 :normal, "NoException", ["../../../harness/assert.js", "../../../harness/sta.js", "../../../harness/testTypedArray.js"], []
 - path: test262/test/built-ins/TypedArrays/length-arg-is-symbol-throws.js

Modified: trunk/LayoutTests/ChangeLog (208563 => 208564)


--- trunk/LayoutTests/ChangeLog	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/LayoutTests/ChangeLog	2016-11-10 22:03:24 UTC (rev 208564)
@@ -1,3 +1,14 @@
+2016-11-10  Joseph Pecoraro  <pecor...@apple.com>
+
+        test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
+        https://bugs.webkit.org/show_bug.cgi?id=164450
+
+        Reviewed by Darin Adler.
+
+        * fast/canvas/webgl/data-view-crash-expected.txt:
+        * fast/canvas/webgl/data-view-test-expected.txt:
+        Better error message.
+
 2016-11-10  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] apply constraints passed to getUserMedia()

Modified: trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt (208563 => 208564)


--- trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt	2016-11-10 22:03:24 UTC (rev 208564)
@@ -2,8 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-PASS view = new DataView(array.buffer, -4500000000) threw exception RangeError: Length out of range of buffer.
-PASS view = new DataView(array.buffer, -4500000000, 4500000000) threw exception RangeError: Length out of range of buffer.
+PASS view = new DataView(array.buffer, -4500000000) threw exception RangeError: byteOffset cannot be negative.
+PASS view = new DataView(array.buffer, -4500000000, 4500000000) threw exception RangeError: byteOffset cannot be negative.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt (208563 => 208564)


--- trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/LayoutTests/fast/canvas/webgl/data-view-test-expected.txt	2016-11-10 22:03:24 UTC (rev 208564)
@@ -281,28 +281,28 @@
 PASS view.getFloat64(10, false) is -NaN
 
 Test for get methods that read from negative index
-PASS view.getInt8(-1) threw exception RangeError: Out of bounds access.
-PASS view.getInt8(-2) threw exception RangeError: Out of bounds access.
-PASS view.getUint8(-1) threw exception RangeError: Out of bounds access.
-PASS view.getUint8(-2) threw exception RangeError: Out of bounds access.
-PASS view.getInt16(-1) threw exception RangeError: Out of bounds access.
-PASS view.getInt16(-2) threw exception RangeError: Out of bounds access.
-PASS view.getInt16(-3) threw exception RangeError: Out of bounds access.
-PASS view.getUint16(-1) threw exception RangeError: Out of bounds access.
-PASS view.getUint16(-2) threw exception RangeError: Out of bounds access.
-PASS view.getUint16(-3) threw exception RangeError: Out of bounds access.
-PASS view.getInt32(-1) threw exception RangeError: Out of bounds access.
-PASS view.getInt32(-3) threw exception RangeError: Out of bounds access.
-PASS view.getInt32(-5) threw exception RangeError: Out of bounds access.
-PASS view.getUint32(-1) threw exception RangeError: Out of bounds access.
-PASS view.getUint32(-3) threw exception RangeError: Out of bounds access.
-PASS view.getUint32(-5) threw exception RangeError: Out of bounds access.
-PASS view.getFloat32(-1) threw exception RangeError: Out of bounds access.
-PASS view.getFloat32(-3) threw exception RangeError: Out of bounds access.
-PASS view.getFloat32(-5) threw exception RangeError: Out of bounds access.
-PASS view.getFloat64(-1) threw exception RangeError: Out of bounds access.
-PASS view.getFloat64(-5) threw exception RangeError: Out of bounds access.
-PASS view.getFloat64(-9) threw exception RangeError: Out of bounds access.
+PASS view.getInt8(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt8(-2) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint8(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint8(-2) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt16(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt16(-2) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt16(-3) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint16(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint16(-2) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint16(-3) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt32(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt32(-3) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getInt32(-5) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint32(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint32(-3) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getUint32(-5) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat32(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat32(-3) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat32(-5) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat64(-1) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat64(-5) threw exception RangeError: byteOffset cannot be negative.
+PASS view.getFloat64(-9) threw exception RangeError: byteOffset cannot be negative.
 
 Test for wrong arguments passed to get methods
 PASS view.getInt8() threw exception TypeError: Need at least one argument (the byteOffset).
@@ -771,28 +771,28 @@
 PASS view.getFloat64(10, false) is -NaN
 
 Test for set methods that write to negative index
-PASS view.setInt8(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt8(-2, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint8(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint8(-2, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt16(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt16(-2, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt16(-3, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint16(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint16(-2, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint16(-3, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt32(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt32(-3, 0) threw exception RangeError: Out of bounds access.
-PASS view.setInt32(-5, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint32(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint32(-3, 0) threw exception RangeError: Out of bounds access.
-PASS view.setUint32(-5, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat32(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat32(-3, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat32(-5, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat64(-1, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat64(-5, 0) threw exception RangeError: Out of bounds access.
-PASS view.setFloat64(-9, 0) threw exception RangeError: Out of bounds access.
+PASS view.setInt8(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt8(-2, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint8(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint8(-2, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt16(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt16(-2, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt16(-3, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint16(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint16(-2, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint16(-3, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt32(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt32(-3, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setInt32(-5, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint32(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint32(-3, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setUint32(-5, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat32(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat32(-3, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat32(-5, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat64(-1, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat64(-5, 0) threw exception RangeError: byteOffset cannot be negative.
+PASS view.setFloat64(-9, 0) threw exception RangeError: byteOffset cannot be negative.
 
 Test for wrong arguments passed to set methods
 PASS view.setInt8() threw exception TypeError: Need at least two argument (the byteOffset and value).

Modified: trunk/Source/_javascript_Core/ChangeLog (208563 => 208564)


--- trunk/Source/_javascript_Core/ChangeLog	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-11-10 22:03:24 UTC (rev 208564)
@@ -1,3 +1,28 @@
+2016-11-10  Joseph Pecoraro  <pecor...@apple.com>
+
+        test262: DataView / TypedArray methods should throw RangeErrors for negative numbers (ToIndex)
+        https://bugs.webkit.org/show_bug.cgi?id=164450
+
+        Reviewed by Darin Adler.
+
+        * runtime/JSCJSValue.h:
+        * runtime/JSCJSValueInlines.h:
+        (JSC::JSValue::toIndex):
+        Introduce a method for toIndex, which is used by DataView and TypedArrays
+        to convert an argument to a number with the possibility of throwing
+        RangeErrors for negative values. We also throw RangeErrors for large
+        values, because wherever this is used we expect an unsigned.
+
+        * runtime/JSArrayBufferConstructor.cpp:
+        (JSC::constructArrayBuffer):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::getData):
+        (JSC::setData):
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::constructGenericTypedArrayViewWithArguments):
+        (JSC::constructGenericTypedArrayView):
+        Use toIndex instead of toUint32 where required.
+
 2016-11-10  Mark Lam  <mark....@apple.com>
 
         A few bits of minor code clean up.

Modified: trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp (208563 => 208564)


--- trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp	2016-11-10 22:03:24 UTC (rev 208564)
@@ -90,7 +90,7 @@
     
     unsigned length;
     if (exec->argumentCount()) {
-        length = exec->uncheckedArgument(0).toUInt32(exec);
+        length = exec->uncheckedArgument(0).toIndex(exec, "length");
         RETURN_IF_EXCEPTION(scope, encodedJSValue());
     } else {
         // Although the documentation doesn't say so, it is in fact correct to say

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValue.h (208563 => 208564)


--- trunk/Source/_javascript_Core/runtime/JSCJSValue.h	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValue.h	2016-11-10 22:03:24 UTC (rev 208564)
@@ -265,6 +265,7 @@
     JS_EXPORT_PRIVATE double toIntegerPreserveNaN(ExecState*) const;
     int32_t toInt32(ExecState*) const;
     uint32_t toUInt32(ExecState*) const;
+    uint32_t toIndex(ExecState*, const char* errorName) const;
     double toLength(ExecState*) const;
 
     // Floating point conversions (this is a convenience function for WebCore;

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h (208563 => 208564)


--- trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2016-11-10 22:03:24 UTC (rev 208564)
@@ -25,13 +25,14 @@
 
 #pragma once
 
+#include "Error.h"
 #include "ExceptionHelpers.h"
 #include "Identifier.h"
 #include "InternalFunction.h"
 #include "JSCJSValue.h"
 #include "JSCellInlines.h"
+#include "JSFunction.h"
 #include "JSObject.h"
-#include "JSFunction.h"
 #include "JSStringInlines.h"
 #include "MathCommon.h"
 #include <wtf/text/StringImpl.h>
@@ -51,6 +52,27 @@
     return toInt32(exec);
 }
 
+inline uint32_t JSValue::toIndex(ExecState* exec, const char* errorName) const
+{
+    VM& vm = exec->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
+    double d = toNumber(exec);
+
+    if (d <= -1) {
+        throwException(exec, scope, createRangeError(exec, makeString(errorName, " cannot be negative")));
+        return 0;
+    }
+    if (d > std::numeric_limits<unsigned>::max()) {
+        throwException(exec, scope, createRangeError(exec, makeString(errorName, " too large")));
+        return 0;
+    }
+
+    if (isInt32())
+        return asInt32();
+    return JSC::toInt32(d);
+}
+
 inline bool JSValue::isUInt32() const
 {
     return isInt32() && asInt32() >= 0;

Modified: trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp (208563 => 208564)


--- trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2016-11-10 22:03:24 UTC (rev 208564)
@@ -132,7 +132,7 @@
     if (!exec->argumentCount())
         return throwVMTypeError(exec, scope, ASCIILiteral("Need at least one argument (the byteOffset)"));
     
-    unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec);
+    unsigned byteOffset = exec->uncheckedArgument(0).toIndex(exec, "byteOffset");
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     
     bool littleEndian = false;
@@ -178,7 +178,7 @@
     if (exec->argumentCount() < 2)
         return throwVMTypeError(exec, scope, ASCIILiteral("Need at least two argument (the byteOffset and value)"));
     
-    unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec);
+    unsigned byteOffset = exec->uncheckedArgument(0).toIndex(exec, "byteOffset");
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     const unsigned dataSize = sizeof(typename Adaptor::Type);

Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h (208563 => 208564)


--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2016-11-10 21:42:33 UTC (rev 208563)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2016-11-10 22:03:24 UTC (rev 208564)
@@ -129,9 +129,8 @@
             length = lengthOpt.value();
         else {
             if ((buffer->byteLength() - offset) % ViewClass::elementSize)
-                return throwRangeError(exec, scope, "ArrayBuffer length minus the byteOffset is not a multiple of the element size");
+                return throwRangeError(exec, scope, ASCIILiteral("ArrayBuffer length minus the byteOffset is not a multiple of the element size"));
             length = (buffer->byteLength() - offset) / ViewClass::elementSize;
-
         }
 
         return ViewClass::create(exec, structure, buffer, offset, length);
@@ -198,20 +197,12 @@
         
         return result;
     }
-    
-    int length;
-    if (firstValue.isInt32())
-        length = firstValue.asInt32();
-    else if (!firstValue.isNumber())
+
+    if (!firstValue.isNumber())
         return throwTypeError(exec, scope, ASCIILiteral("Invalid array length argument"));
-    else {
-        length = static_cast<int>(firstValue.asNumber());
-        if (length != firstValue.asNumber())
-            return throwTypeError(exec, scope, ASCIILiteral("Invalid array length argument (fractional lengths not allowed)"));
-    }
 
-    if (length < 0)
-        return throwRangeError(exec, scope, "Requested length is negative");
+    unsigned length = firstValue.toIndex(exec, "length");
+    RETURN_IF_EXCEPTION(scope, nullptr);
     return ViewClass::create(exec, structure, length);
 }
 
@@ -242,14 +233,13 @@
     unsigned offset = 0;
     Optional<unsigned> length = Nullopt;
     if (jsDynamicCast<JSArrayBuffer*>(firstValue) && argCount > 1) {
-        offset = exec->uncheckedArgument(1).toUInt32(exec);
+        offset = exec->uncheckedArgument(1).toIndex(exec, "byteOffset");
         RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
         if (argCount > 2) {
-            length = exec->uncheckedArgument(2).toUInt32(exec);
+            length = exec->uncheckedArgument(2).toIndex(exec, ViewClass::TypedArrayStorageType == TypeDataView ? "byteLength" : "length");
             RETURN_IF_EXCEPTION(scope, encodedJSValue());
         }
-
     }
 
     return JSValue::encode(constructGenericTypedArrayViewWithArguments<ViewClass>(exec, structure, JSValue::encode(firstValue), offset, length));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to