test262: DataView / TypedArray methods should throw RangeErrors for negative numbers...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 22:03:24 +0000 (22:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 22:03:24 +0000 (22:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164450

Patch by Joseph Pecoraro <pecoraro@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/JavaScriptCore:

* 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208564 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
JSTests/ChangeLog
JSTests/stress/dataview-typedarray-toindex.js [new file with mode: 0644]
JSTests/test262.yaml
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/data-view-crash-expected.txt
LayoutTests/fast/canvas/webgl/data-view-test-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/runtime/JSCJSValueInlines.h
Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp
Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h

index 135a420..cb49d15 100644 (file)
@@ -1,3 +1,16 @@
+2016-11-10  Joseph Pecoraro  <pecoraro@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.lam@apple.com>
 
         Graph::methodOfGettingAValueProfileFor() should be returning the profile for the operand node.
diff --git a/JSTests/stress/dataview-typedarray-toindex.js b/JSTests/stress/dataview-typedarray-toindex.js
new file mode 100644 (file)
index 0000000..5e1a41b
--- /dev/null
@@ -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.
+// - JavaScriptCore 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); });
+}
index 3e419d9..da448b4 100644 (file)
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
 - 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
index 0dc3d72..784b108 100644 (file)
@@ -1,3 +1,14 @@
+2016-11-10  Joseph Pecoraro  <pecoraro@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.carlson@apple.com>
 
         [MediaStream] apply constraints passed to getUserMedia()
index 7b797a6..216999b 100644 (file)
@@ -2,8 +2,8 @@ Test that DataView does not crash with bad offset or length.
 
 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
index 937d763..7f203b8 100644 (file)
@@ -281,28 +281,28 @@ PASS view.getFloat64(7, false) is -NaN
 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.setFloat64(10, -NaN, false) is undefined.
 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).
index cb7e1ba..b78c27c 100644 (file)
@@ -1,3 +1,28 @@
+2016-11-10  Joseph Pecoraro  <pecoraro@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.lam@apple.com>
 
         A few bits of minor code clean up.
index 8d30160..0f5bba0 100644 (file)
@@ -90,7 +90,7 @@ static EncodedJSValue JSC_HOST_CALL constructArrayBuffer(ExecState* exec)
     
     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
index 202a1f7..d40c3fc 100644 (file)
@@ -265,6 +265,7 @@ public:
     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;
index 8e463f9..bf9f59f 100644 (file)
 
 #pragma once
 
+#include "Error.h"
 #include "ExceptionHelpers.h"
 #include "Identifier.h"
 #include "InternalFunction.h"
 #include "JSCJSValue.h"
 #include "JSCellInlines.h"
-#include "JSObject.h"
 #include "JSFunction.h"
+#include "JSObject.h"
 #include "JSStringInlines.h"
 #include "MathCommon.h"
 #include <wtf/text/StringImpl.h>
@@ -51,6 +52,27 @@ inline uint32_t JSValue::toUInt32(ExecState* exec) const
     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;
index 6855a5c..2f8b033 100644 (file)
@@ -132,7 +132,7 @@ EncodedJSValue getData(ExecState* exec)
     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 @@ EncodedJSValue setData(ExecState* exec)
     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);
index 38af69b..6f3e910 100644 (file)
@@ -129,9 +129,8 @@ inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, St
             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 @@ inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, St
         
         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 @@ EncodedJSValue JSC_HOST_CALL constructGenericTypedArrayView(ExecState* exec)
     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));