From 17e3115a6ce1b22f32e479cbcb4e29706abced53 Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Mon, 13 Jun 2016 14:53:58 -0400 Subject: [PATCH] fixup! toindex-values --- .../getFloat32/toindex-byteoffset.js | 2 +- .../getFloat64/toindex-byteoffset.js | 15 ++++++----- .../prototype/getInt16/toindex-byteoffset.js | 14 +++++----- .../prototype/getInt32/toindex-byteoffset.js | 15 ++++++----- .../prototype/getInt8/toindex-byteoffset.js | 14 +++++----- .../prototype/getUint16/toindex-byteoffset.js | 15 ++++++----- .../prototype/getUint32/toindex-byteoffset.js | 14 +++++----- .../prototype/getUint8/toindex-byteoffset.js | 14 +++++----- .../setFloat32/toindex-byteoffset.js | 26 +++++++++---------- .../setFloat64/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setInt16/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setInt32/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setInt8/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setUint16/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setUint32/toindex-byteoffset.js | 24 ++++++++--------- .../prototype/setUint8/toindex-byteoffset.js | 24 ++++++++--------- 16 files changed, 157 insertions(+), 140 deletions(-) diff --git a/test/built-ins/DataView/prototype/getFloat32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getFloat32/toindex-byteoffset.js index f27d209aff3..280a11d46b5 100644 --- a/test/built-ins/DataView/prototype/getFloat32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat32/toindex-byteoffset.js @@ -49,7 +49,7 @@ assert.sameValue(sample.getFloat32(obj1), 53292336, "object's valueOf"); assert.sameValue(sample.getFloat32(obj2), 53554476, "object's toString"); assert.sameValue(sample.getFloat32(""), 13323340, "the Empty string"); assert.sameValue(sample.getFloat32("0"), 13323340, "string '0'"); -assert.sameValue(sample.getFloat32("1"), 13388875, "string '1'"); +assert.sameValue(sample.getFloat32("2"), 53554476, "string '2'"); assert.sameValue(sample.getFloat32(true), 13388875, "true"); assert.sameValue(sample.getFloat32(false), 13323340, "false"); assert.sameValue(sample.getFloat32(NaN), 13323340, "NaN"); diff --git a/test/built-ins/DataView/prototype/getFloat64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getFloat64/toindex-byteoffset.js index e3a422796a0..966630a1e69 100644 --- a/test/built-ins/DataView/prototype/getFloat64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat64/toindex-byteoffset.js @@ -21,7 +21,7 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(9); +var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); sample.setUint8(0, 67); @@ -33,25 +33,28 @@ sample.setUint8(5, 67); sample.setUint8(6, 68); sample.setUint8(7, 68); sample.setUint8(8, 67); +sample.setUint8(9, 68); +sample.setUint8(10, 68); +sample.setUint8(11, 68); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getFloat64(-0), 10846169068898440, "-0"); -assert.sameValue(sample.getFloat64(obj1), 11409110432516230, "object's valueOf"); -assert.sameValue(sample.getFloat64(obj2), 11409110432516230, "object's toString"); +assert.sameValue(sample.getFloat64(obj1), 747563348316297600000, "{}.valueOf"); +assert.sameValue(sample.getFloat64(obj2), 710670423110275600000, "{}.toString"); assert.sameValue(sample.getFloat64(""), 10846169068898440, "the Empty string"); assert.sameValue(sample.getFloat64("0"), 10846169068898440, "string '0'"); -assert.sameValue(sample.getFloat64("1"), 11409110432516230, "string '1'"); +assert.sameValue(sample.getFloat64("2"), 747563348316297600000, "string '2'"); assert.sameValue(sample.getFloat64(true), 11409110432516230, "true"); assert.sameValue(sample.getFloat64(false), 10846169068898440, "false"); assert.sameValue(sample.getFloat64(NaN), 10846169068898440, "NaN"); diff --git a/test/built-ins/DataView/prototype/getInt16/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getInt16/toindex-byteoffset.js index 5b6103211ca..c8edfbbc051 100644 --- a/test/built-ins/DataView/prototype/getInt16/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt16/toindex-byteoffset.js @@ -20,31 +20,33 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(3); +var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(0, 127); sample.setUint8(1, 255); sample.setUint8(2, 1); +sample.setUint8(3, 127); +sample.setUint8(4, 255); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getInt16(-0), 32767, "-0"); -assert.sameValue(sample.getInt16(obj1), -255, "object's valueOf"); -assert.sameValue(sample.getInt16(obj2), -255, "object's toString"); +assert.sameValue(sample.getInt16(obj1), 383, "object's valueOf"); +assert.sameValue(sample.getInt16(obj2), 32767, "object's toString"); assert.sameValue(sample.getInt16(""), 32767, "the Empty string"); assert.sameValue(sample.getInt16("0"), 32767, "string '0'"); -assert.sameValue(sample.getInt16("1"), -255, "string '1'"); +assert.sameValue(sample.getInt16("2"), 383, "string '2'"); assert.sameValue(sample.getInt16(true), -255, "true"); assert.sameValue(sample.getInt16(false), 32767, "false"); assert.sameValue(sample.getInt16(NaN), 32767, "NaN"); diff --git a/test/built-ins/DataView/prototype/getInt32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getInt32/toindex-byteoffset.js index 7882bb873cf..4e1b88547a6 100644 --- a/test/built-ins/DataView/prototype/getInt32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt32/toindex-byteoffset.js @@ -20,7 +20,7 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(5); +var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(0, 127); @@ -28,25 +28,28 @@ sample.setUint8(1, 255); sample.setUint8(2, 255); sample.setUint8(3, 255); sample.setUint8(4, 128); +sample.setUint8(5, 255); +sample.setUint8(6, 255); +sample.setUint8(7, 255); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getInt32(-0), 2147483647, "-0"); -assert.sameValue(sample.getInt32(obj1), -128, "object's valueOf"); -assert.sameValue(sample.getInt32(obj2), -128, "object's toString"); +assert.sameValue(sample.getInt32(obj1), -32513, "object's valueOf"); +assert.sameValue(sample.getInt32(obj2), -8323073, "object's toString"); assert.sameValue(sample.getInt32(""), 2147483647, "the Empty string"); assert.sameValue(sample.getInt32("0"), 2147483647, "string '0'"); -assert.sameValue(sample.getInt32("1"), -128, "string '1'"); +assert.sameValue(sample.getInt32("2"), -32513, "string '2'"); assert.sameValue(sample.getInt32(true), -128, "true"); assert.sameValue(sample.getInt32(false), 2147483647, "false"); assert.sameValue(sample.getInt32(NaN), 2147483647, "NaN"); diff --git a/test/built-ins/DataView/prototype/getInt8/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getInt8/toindex-byteoffset.js index e2e62f94929..465d414a167 100644 --- a/test/built-ins/DataView/prototype/getInt8/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt8/toindex-byteoffset.js @@ -19,30 +19,32 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(2); +var buffer = new ArrayBuffer(4); var sample = new DataView(buffer, 0); sample.setUint8(0, 39); sample.setUint8(1, 42); +sample.setUint8(2, 7); +sample.setUint8(3, 77); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getInt8(-0), 39, "-0"); -assert.sameValue(sample.getInt8(obj1), 42, "object's valueOf"); -assert.sameValue(sample.getInt8(obj2), 42, "object's toString"); +assert.sameValue(sample.getInt8(obj1), 7, "object's valueOf"); +assert.sameValue(sample.getInt8(obj2), 77, "object's toString"); assert.sameValue(sample.getInt8(""), 39, "the Empty string"); assert.sameValue(sample.getInt8("0"), 39, "string '0'"); -assert.sameValue(sample.getInt8("1"), 42, "string '1'"); +assert.sameValue(sample.getInt8("2"), 7, "string '2'"); assert.sameValue(sample.getInt8(true), 42, "true"); assert.sameValue(sample.getInt8(false), 39, "false"); assert.sameValue(sample.getInt8(NaN), 39, "NaN"); diff --git a/test/built-ins/DataView/prototype/getUint16/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getUint16/toindex-byteoffset.js index c4a9ade196f..4958f26bf99 100644 --- a/test/built-ins/DataView/prototype/getUint16/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint16/toindex-byteoffset.js @@ -20,31 +20,34 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(3); +var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(0, 127); sample.setUint8(1, 255); sample.setUint8(2, 1); +sample.setUint8(3, 127); +sample.setUint8(4, 255); +sample.setUint8(5, 1); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getUint16(-0), 32767, "-0"); -assert.sameValue(sample.getUint16(obj1), 65281, "object's valueOf"); -assert.sameValue(sample.getUint16(obj2), 65281, "object's toString"); +assert.sameValue(sample.getUint16(obj1), 383, "object's valueOf"); +assert.sameValue(sample.getUint16(obj2), 32767, "object's toString"); assert.sameValue(sample.getUint16(""), 32767, "the Empty string"); assert.sameValue(sample.getUint16("0"), 32767, "string '0'"); -assert.sameValue(sample.getUint16("1"), 65281, "string '1'"); +assert.sameValue(sample.getUint16("2"), 383, "string '2'"); assert.sameValue(sample.getUint16(true), 65281, "true"); assert.sameValue(sample.getUint16(false), 32767, "false"); assert.sameValue(sample.getUint16(NaN), 32767, "NaN"); diff --git a/test/built-ins/DataView/prototype/getUint32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getUint32/toindex-byteoffset.js index 4fb5d7bcaea..2f9e2fb29ed 100644 --- a/test/built-ins/DataView/prototype/getUint32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint32/toindex-byteoffset.js @@ -20,7 +20,7 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(5); +var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); sample.setUint8(0, 127); @@ -28,25 +28,27 @@ sample.setUint8(1, 255); sample.setUint8(2, 255); sample.setUint8(3, 255); sample.setUint8(4, 128); +sample.setUint8(5, 255); +sample.setUint8(6, 128); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getUint32(-0), 2147483647, "-0"); -assert.sameValue(sample.getUint32(obj1), 4294967168, "object's valueOf"); -assert.sameValue(sample.getUint32(obj2), 4294967168, "object's toString"); +assert.sameValue(sample.getUint32(obj1), 4294934783, "object's valueOf"); +assert.sameValue(sample.getUint32(obj2), 4286644096, "object's toString"); assert.sameValue(sample.getUint32(""), 2147483647, "the Empty string"); assert.sameValue(sample.getUint32("0"), 2147483647, "string '0'"); -assert.sameValue(sample.getUint32("1"), 4294967168, "string '1'"); +assert.sameValue(sample.getUint32("2"), 4294934783, "string '2'"); assert.sameValue(sample.getUint32(true), 4294967168, "true"); assert.sameValue(sample.getUint32(false), 2147483647, "false"); assert.sameValue(sample.getUint32(NaN), 2147483647, "NaN"); diff --git a/test/built-ins/DataView/prototype/getUint8/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getUint8/toindex-byteoffset.js index 19c06354ee4..3f684c83d8c 100644 --- a/test/built-ins/DataView/prototype/getUint8/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint8/toindex-byteoffset.js @@ -19,30 +19,32 @@ info: | features: [DataView.prototype.setUint8] ---*/ -var buffer = new ArrayBuffer(2); +var buffer = new ArrayBuffer(4); var sample = new DataView(buffer, 0); sample.setUint8(0, 39); sample.setUint8(1, 42); +sample.setUint8(2, 7); +sample.setUint8(3, 77); var obj1 = { valueOf: function() { - return 1; + return 2; } }; var obj2 = { toString: function() { - return 1; + return 3; } }; assert.sameValue(sample.getUint8(-0), 39, "-0"); -assert.sameValue(sample.getUint8(obj1), 42, "object's valueOf"); -assert.sameValue(sample.getUint8(obj2), 42, "object's toString"); +assert.sameValue(sample.getUint8(obj1), 7, "object's valueOf"); +assert.sameValue(sample.getUint8(obj2), 77, "object's toString"); assert.sameValue(sample.getUint8(""), 39, "the Empty string"); assert.sameValue(sample.getUint8("0"), 39, "string '0'"); -assert.sameValue(sample.getUint8("1"), 42, "string '1'"); +assert.sameValue(sample.getUint8("2"), 7, "string '1'"); assert.sameValue(sample.getUint8(true), 42, "true"); assert.sameValue(sample.getUint8(false), 39, "false"); assert.sameValue(sample.getUint8(NaN), 39, "NaN"); diff --git a/test/built-ins/DataView/prototype/setFloat32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setFloat32/toindex-byteoffset.js index d73c581de2e..c35276f0a09 100644 --- a/test/built-ins/DataView/prototype/setFloat32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat32/toindex-byteoffset.js @@ -20,18 +20,18 @@ info: | features: [DataView.prototype.getFloat32] ---*/ -var buffer = new ArrayBuffer(5); +var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -39,13 +39,13 @@ sample.setFloat32(0, 0); sample.setFloat32(-0, 42); assert.sameValue(sample.getFloat32(0), 42, "-0"); -sample.setFloat32(0, 0); +sample.setFloat32(3, 0); sample.setFloat32(obj1, 42); -assert.sameValue(sample.getFloat32(1), 42, "object's valueOf"); +assert.sameValue(sample.getFloat32(3), 42, "object's valueOf"); -sample.setFloat32(0, 0); +sample.setFloat32(4, 0); sample.setFloat32(obj2, 42); -assert.sameValue(sample.getFloat32(1), 42, "object's toString"); +assert.sameValue(sample.getFloat32(4), 42, "object's toString"); sample.setFloat32(0, 0); sample.setFloat32("", 42); @@ -55,11 +55,11 @@ sample.setFloat32(0, 0); sample.setFloat32("0", 42); assert.sameValue(sample.getFloat32(0), 42, "string '0'"); -sample.setFloat32(0, 0); -sample.setFloat32("1", 42); -assert.sameValue(sample.getFloat32(1), 42, "string '1'"); +sample.setFloat32(2, 0); +sample.setFloat32("2", 42); +assert.sameValue(sample.getFloat32(2), 42, "string '2'"); -sample.setFloat32(0, 0); +sample.setFloat32(1, 0); sample.setFloat32(true, 42); assert.sameValue(sample.getFloat32(1), 42, "true"); @@ -83,11 +83,11 @@ sample.setFloat32(0, 0); sample.setFloat32(0.9, 42); assert.sameValue(sample.getFloat32(0), 42, "0.9"); -sample.setFloat32(0, 0); +sample.setFloat32(1, 0); sample.setFloat32(1.1, 42); assert.sameValue(sample.getFloat32(1), 42, "1.1"); -sample.setFloat32(0, 0); +sample.setFloat32(1, 0); sample.setFloat32(1.9, 42); assert.sameValue(sample.getFloat32(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setFloat64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setFloat64/toindex-byteoffset.js index 637848ad3f5..d09773c3581 100644 --- a/test/built-ins/DataView/prototype/setFloat64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat64/toindex-byteoffset.js @@ -26,13 +26,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setFloat64(0, 0); sample.setFloat64(-0, 42); assert.sameValue(sample.getFloat64(0), 42, "-0"); -sample.setFloat64(0, 0); +sample.setFloat64(3, 0); sample.setFloat64(obj1, 42); -assert.sameValue(sample.getFloat64(1), 42, "object's valueOf"); +assert.sameValue(sample.getFloat64(3), 42, "object's valueOf"); -sample.setFloat64(0, 0); +sample.setFloat64(4, 0); sample.setFloat64(obj2, 42); -assert.sameValue(sample.getFloat64(1), 42, "object's toString"); +assert.sameValue(sample.getFloat64(4), 42, "object's toString"); sample.setFloat64(0, 0); sample.setFloat64("", 42); @@ -56,11 +56,11 @@ sample.setFloat64(0, 0); sample.setFloat64("0", 42); assert.sameValue(sample.getFloat64(0), 42, "string '0'"); -sample.setFloat64(0, 0); -sample.setFloat64("1", 42); -assert.sameValue(sample.getFloat64(1), 42, "string '1'"); +sample.setFloat64(2, 0); +sample.setFloat64("2", 42); +assert.sameValue(sample.getFloat64(2), 42, "string '2'"); -sample.setFloat64(0, 0); +sample.setFloat64(1, 0); sample.setFloat64(true, 42); assert.sameValue(sample.getFloat64(1), 42, "true"); @@ -84,11 +84,11 @@ sample.setFloat64(0, 0); sample.setFloat64(0.9, 42); assert.sameValue(sample.getFloat64(0), 42, "0.9"); -sample.setFloat64(0, 0); +sample.setFloat64(1, 0); sample.setFloat64(1.1, 42); assert.sameValue(sample.getFloat64(1), 42, "1.1"); -sample.setFloat64(0, 0); +sample.setFloat64(1, 0); sample.setFloat64(1.9, 42); assert.sameValue(sample.getFloat64(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setInt16/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setInt16/toindex-byteoffset.js index 9ca302fc8d0..33864075fee 100644 --- a/test/built-ins/DataView/prototype/setInt16/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt16/toindex-byteoffset.js @@ -26,13 +26,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setInt16(0, 0); sample.setInt16(-0, 42); assert.sameValue(sample.getInt16(0), 42, "-0"); -sample.setInt16(0, 0); +sample.setInt16(3, 0); sample.setInt16(obj1, 42); -assert.sameValue(sample.getInt16(1), 42, "object's valueOf"); +assert.sameValue(sample.getInt16(3), 42, "object's valueOf"); -sample.setInt16(0, 0); +sample.setInt16(4, 0); sample.setInt16(obj2, 42); -assert.sameValue(sample.getInt16(1), 42, "object's toString"); +assert.sameValue(sample.getInt16(4), 42, "object's toString"); sample.setInt16(0, 0); sample.setInt16("", 42); @@ -56,11 +56,11 @@ sample.setInt16(0, 0); sample.setInt16("0", 42); assert.sameValue(sample.getInt16(0), 42, "string '0'"); -sample.setInt16(0, 0); -sample.setInt16("1", 42); -assert.sameValue(sample.getInt16(1), 42, "string '1'"); +sample.setInt16(2, 0); +sample.setInt16("2", 42); +assert.sameValue(sample.getInt16(2), 42, "string '2'"); -sample.setInt16(0, 0); +sample.setInt16(1, 0); sample.setInt16(true, 42); assert.sameValue(sample.getInt16(1), 42, "true"); @@ -84,11 +84,11 @@ sample.setInt16(0, 0); sample.setInt16(0.9, 42); assert.sameValue(sample.getInt16(0), 42, "0.9"); -sample.setInt16(0, 0); +sample.setInt16(1, 0); sample.setInt16(1.1, 42); assert.sameValue(sample.getInt16(1), 42, "1.1"); -sample.setInt16(0, 0); +sample.setInt16(1, 0); sample.setInt16(1.9, 42); assert.sameValue(sample.getInt16(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js index 4d5381918ea..f5b45a5ae97 100644 --- a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js @@ -26,13 +26,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setInt32(0, 0); sample.setInt32(-0, 42); assert.sameValue(sample.getInt32(0), 42, "-0"); -sample.setInt32(0, 0); +sample.setInt32(3, 0); sample.setInt32(obj1, 42); -assert.sameValue(sample.getInt32(1), 42, "object's valueOf"); +assert.sameValue(sample.getInt32(3), 42, "object's valueOf"); -sample.setInt32(0, 0); +sample.setInt32(4, 0); sample.setInt32(obj2, 42); -assert.sameValue(sample.getInt32(1), 42, "object's toString"); +assert.sameValue(sample.getInt32(4), 42, "object's toString"); sample.setInt32(0, 0); sample.setInt32("", 42); @@ -56,11 +56,11 @@ sample.setInt32(0, 0); sample.setInt32("0", 42); assert.sameValue(sample.getInt32(0), 42, "string '0'"); -sample.setInt32(0, 0); -sample.setInt32("1", 42); -assert.sameValue(sample.getInt32(1), 42, "string '1'"); +sample.setInt32(2, 0); +sample.setInt32("2", 42); +assert.sameValue(sample.getInt32(2), 42, "string '2'"); -sample.setInt32(0, 0); +sample.setInt32(1, 0); sample.setInt32(true, 42); assert.sameValue(sample.getInt32(1), 42, "true"); @@ -84,11 +84,11 @@ sample.setInt32(0, 0); sample.setInt32(0.9, 42); assert.sameValue(sample.getInt32(0), 42, "0.9"); -sample.setInt32(0, 0); +sample.setInt32(1, 0); sample.setInt32(1.1, 42); assert.sameValue(sample.getInt32(1), 42, "1.1"); -sample.setInt32(0, 0); +sample.setInt32(1, 0); sample.setInt32(1.9, 42); assert.sameValue(sample.getInt32(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setInt8/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setInt8/toindex-byteoffset.js index 0385288e575..b9022740c2a 100644 --- a/test/built-ins/DataView/prototype/setInt8/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt8/toindex-byteoffset.js @@ -25,13 +25,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -39,13 +39,13 @@ sample.setInt8(0, 0); sample.setInt8(-0, 42); assert.sameValue(sample.getInt8(0), 42, "-0"); -sample.setInt8(0, 0); +sample.setInt8(3, 0); sample.setInt8(obj1, 42); -assert.sameValue(sample.getInt8(1), 42, "object's valueOf"); +assert.sameValue(sample.getInt8(3), 42, "object's valueOf"); -sample.setInt8(0, 0); +sample.setInt8(4, 0); sample.setInt8(obj2, 42); -assert.sameValue(sample.getInt8(1), 42, "object's toString"); +assert.sameValue(sample.getInt8(4), 42, "object's toString"); sample.setInt8(0, 0); sample.setInt8("", 42); @@ -55,11 +55,11 @@ sample.setInt8(0, 0); sample.setInt8("0", 42); assert.sameValue(sample.getInt8(0), 42, "string '0'"); -sample.setInt8(0, 0); -sample.setInt8("1", 42); -assert.sameValue(sample.getInt8(1), 42, "string '1'"); +sample.setInt8(2, 0); +sample.setInt8("2", 42); +assert.sameValue(sample.getInt8(2), 42, "string '2'"); -sample.setInt8(0, 0); +sample.setInt8(1, 0); sample.setInt8(true, 42); assert.sameValue(sample.getInt8(1), 42, "true"); @@ -83,11 +83,11 @@ sample.setInt8(0, 0); sample.setInt8(0.9, 42); assert.sameValue(sample.getInt8(0), 42, "0.9"); -sample.setInt8(0, 0); +sample.setInt8(1, 0); sample.setInt8(1.1, 42); assert.sameValue(sample.getInt8(1), 42, "1.1"); -sample.setInt8(0, 0); +sample.setInt8(1, 0); sample.setInt8(1.9, 42); assert.sameValue(sample.getInt8(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setUint16/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setUint16/toindex-byteoffset.js index 22b6f5f2587..703fdedba8b 100644 --- a/test/built-ins/DataView/prototype/setUint16/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint16/toindex-byteoffset.js @@ -26,13 +26,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setUint16(0, 0); sample.setUint16(-0, 42); assert.sameValue(sample.getUint16(0), 42, "-0"); -sample.setUint16(0, 0); +sample.setUint16(3, 0); sample.setUint16(obj1, 42); -assert.sameValue(sample.getUint16(1), 42, "object's valueOf"); +assert.sameValue(sample.getUint16(3), 42, "object's valueOf"); -sample.setUint16(0, 0); +sample.setUint16(4, 0); sample.setUint16(obj2, 42); -assert.sameValue(sample.getUint16(1), 42, "object's toString"); +assert.sameValue(sample.getUint16(4), 42, "object's toString"); sample.setUint16(0, 0); sample.setUint16("", 42); @@ -56,11 +56,11 @@ sample.setUint16(0, 0); sample.setUint16("0", 42); assert.sameValue(sample.getUint16(0), 42, "string '0'"); -sample.setUint16(0, 0); -sample.setUint16("1", 42); -assert.sameValue(sample.getUint16(1), 42, "string '1'"); +sample.setUint16(2, 0); +sample.setUint16("2", 42); +assert.sameValue(sample.getUint16(2), 42, "string '2'"); -sample.setUint16(0, 0); +sample.setUint16(1, 0); sample.setUint16(true, 42); assert.sameValue(sample.getUint16(1), 42, "true"); @@ -84,11 +84,11 @@ sample.setUint16(0, 0); sample.setUint16(0.9, 42); assert.sameValue(sample.getUint16(0), 42, "0.9"); -sample.setUint16(0, 0); +sample.setUint16(1, 0); sample.setUint16(1.1, 42); assert.sameValue(sample.getUint16(1), 42, "1.1"); -sample.setUint16(0, 0); +sample.setUint16(1, 0); sample.setUint16(1.9, 42); assert.sameValue(sample.getUint16(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setUint32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setUint32/toindex-byteoffset.js index 60f55dbf4d2..c048f39c9d9 100644 --- a/test/built-ins/DataView/prototype/setUint32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint32/toindex-byteoffset.js @@ -26,13 +26,13 @@ var sample = new DataView(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setUint32(0, 0); sample.setUint32(-0, 42); assert.sameValue(sample.getUint32(0), 42, "-0"); -sample.setUint32(0, 0); +sample.setUint32(3, 0); sample.setUint32(obj1, 42); -assert.sameValue(sample.getUint32(1), 42, "object's valueOf"); +assert.sameValue(sample.getUint32(3), 42, "object's valueOf"); -sample.setUint32(0, 0); +sample.setUint32(4, 0); sample.setUint32(obj2, 42); -assert.sameValue(sample.getUint32(1), 42, "object's toString"); +assert.sameValue(sample.getUint32(4), 42, "object's toString"); sample.setUint32(0, 0); sample.setUint32("", 42); @@ -56,11 +56,11 @@ sample.setUint32(0, 0); sample.setUint32("0", 42); assert.sameValue(sample.getUint32(0), 42, "string '0'"); -sample.setUint32(0, 0); -sample.setUint32("1", 42); -assert.sameValue(sample.getUint32(1), 42, "string '1'"); +sample.setUint32(2, 0); +sample.setUint32("2", 42); +assert.sameValue(sample.getUint32(2), 42, "string '2'"); -sample.setUint32(0, 0); +sample.setUint32(1, 0); sample.setUint32(true, 42); assert.sameValue(sample.getUint32(1), 42, "true"); @@ -84,11 +84,11 @@ sample.setUint32(0, 0); sample.setUint32(0.9, 42); assert.sameValue(sample.getUint32(0), 42, "0.9"); -sample.setUint32(0, 0); +sample.setUint32(1, 0); sample.setUint32(1.1, 42); assert.sameValue(sample.getUint32(1), 42, "1.1"); -sample.setUint32(0, 0); +sample.setUint32(1, 0); sample.setUint32(1.9, 42); assert.sameValue(sample.getUint32(1), 42, "1.9"); diff --git a/test/built-ins/DataView/prototype/setUint8/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setUint8/toindex-byteoffset.js index a41054d8b65..426d43befe5 100644 --- a/test/built-ins/DataView/prototype/setUint8/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint8/toindex-byteoffset.js @@ -26,13 +26,13 @@ var typedArray = new Uint8Array(buffer, 0); var obj1 = { valueOf: function() { - return 1; + return 3; } }; var obj2 = { toString: function() { - return 1; + return 4; } }; @@ -40,13 +40,13 @@ sample.setUint8(0, 0); sample.setUint8(-0, 42); assert.sameValue(typedArray[0], 42, "-0"); -sample.setUint8(0, 0); +sample.setUint8(3, 0); sample.setUint8(obj1, 42); -assert.sameValue(typedArray[1], 42, "object's valueOf"); +assert.sameValue(typedArray[3], 42, "object's valueOf"); -sample.setUint8(0, 0); +sample.setUint8(4, 0); sample.setUint8(obj2, 42); -assert.sameValue(typedArray[1], 42, "object's toString"); +assert.sameValue(typedArray[4], 42, "object's toString"); sample.setUint8(0, 0); sample.setUint8("", 42); @@ -56,11 +56,11 @@ sample.setUint8(0, 0); sample.setUint8("0", 42); assert.sameValue(typedArray[0], 42, "string '0'"); -sample.setUint8(0, 0); -sample.setUint8("1", 42); -assert.sameValue(typedArray[1], 42, "string '1'"); +sample.setUint8(2, 0); +sample.setUint8("2", 42); +assert.sameValue(typedArray[2], 42, "string '2'"); -sample.setUint8(0, 0); +sample.setUint8(1, 0); sample.setUint8(true, 42); assert.sameValue(typedArray[1], 42, "true"); @@ -84,11 +84,11 @@ sample.setUint8(0, 0); sample.setUint8(0.9, 42); assert.sameValue(typedArray[0], 42, "0.9"); -sample.setUint8(0, 0); +sample.setUint8(1, 0); sample.setUint8(1.1, 42); assert.sameValue(typedArray[1], 42, "1.1"); -sample.setUint8(0, 0); +sample.setUint8(1, 0); sample.setUint8(1.9, 42); assert.sameValue(typedArray[1], 42, "1.9");