diff options
Diffstat (limited to 'test/built-ins/Array/length')
-rw-r--r-- | test/built-ins/Array/length/15.4.5.1-3.d-1.js | 2 | ||||
-rw-r--r-- | test/built-ins/Array/length/15.4.5.1-3.d-2.js | 2 | ||||
-rw-r--r-- | test/built-ins/Array/length/15.4.5.1-3.d-3.js | 4 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js | 6 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js | 6 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js | 6 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js | 6 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js | 8 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js | 2 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js | 2 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js | 66 | ||||
-rw-r--r-- | test/built-ins/Array/length/S15.4.5.2_A3_T4.js | 2 |
12 files changed, 31 insertions, 81 deletions
diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-1.js b/test/built-ins/Array/length/15.4.5.1-3.d-1.js index 952585672..651cf5c11 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-1.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-1.js @@ -11,5 +11,5 @@ description: > assert.throws(RangeError, function() { - [].length = 4294967296; + [].length = 4294967296 ; }); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-2.js b/test/built-ins/Array/length/15.4.5.1-3.d-2.js index 2162edb4a..7e1dc6a25 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-2.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-2.js @@ -11,5 +11,5 @@ description: > assert.throws(RangeError, function() { - [].length = 4294967297; + [].length = 4294967297 ; }); diff --git a/test/built-ins/Array/length/15.4.5.1-3.d-3.js b/test/built-ins/Array/length/15.4.5.1-3.d-3.js index 7c03867da..38e354224 100644 --- a/test/built-ins/Array/length/15.4.5.1-3.d-3.js +++ b/test/built-ins/Array/length/15.4.5.1-3.d-3.js @@ -7,7 +7,7 @@ es5id: 15.4.5.1-3.d-3 description: Set array length property to max value 4294967295 (2**32-1,) ---*/ -var a = []; -a.length = 4294967295; + var a =[]; + a.length = 4294967295 ; assert.sameValue(a.length, 4294967295, 'a.length'); diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js index d0c216a96..0b659bf9b 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T1.js @@ -14,7 +14,7 @@ description: Use try statement. len = -1, 4294967296, 4294967297 try { new Array(-1); $ERROR('#1.1: new Array(-1) throw RangeError. Actual: ' + (new Array(-1))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(-1) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(4294967296); $ERROR('#2.1: new Array(4294967296) throw RangeError. Actual: ' + (new Array(4294967296))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(4294967296) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(4294967297); $ERROR('#3.1: new Array(4294967297) throw RangeError. Actual: ' + (new Array(4294967297))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(4294967297) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js index 3c117d19c..abe3b60e7 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T2.js @@ -14,7 +14,7 @@ description: Use try statement. len = NaN, +/-Infinity try { new Array(NaN); $ERROR('#1.1: new Array(NaN) throw RangeError. Actual: ' + (new Array(NaN))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(NaN) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(Number.POSITIVE_INFINITY); $ERROR('#2.1: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.POSITIVE_INFINITY))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(Number.POSITIVE_INFINITY) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(Number.NEGATIVE_INFINITY); $ERROR('#3.1: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (new Array(Number.NEGATIVE_INFINITY))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(Number.NEGATIVE_INFINITY) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js index 6cd213037..9822c925c 100644 --- a/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js +++ b/test/built-ins/Array/length/S15.4.2.2_A2.2_T3.js @@ -14,7 +14,7 @@ description: Use try statement. len = 1.5, Number.MAX_VALUE, Number.MIN_VALUE try { new Array(1.5); $ERROR('#1.1: new Array(1.5) throw RangeError. Actual: ' + (new Array(1.5))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: new Array(1.5) throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { try { new Array(Number.MAX_VALUE); $ERROR('#2.1: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (new Array(Number.MAX_VALUE))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: new Array(Number.MAX_VALUE) throw RangeError. Actual: ' + (e)); } @@ -34,7 +34,7 @@ try { try { new Array(Number.MIN_VALUE); $ERROR('#3.1: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (new Array(Number.MIN_VALUE))); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: new Array(Number.MIN_VALUE) throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js index c09ba6e72..7435827c6 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T1.js @@ -13,7 +13,7 @@ try { var x = []; x.length = 4294967296; $ERROR('#1.1: x = []; x.length = 4294967296 throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: x = []; x.length = 4294967296 throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { x = []; x.length = -1; $ERROR('#2.1: x = []; x.length = -1 throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = -1 throw RangeError. Actual: ' + (e)); } @@ -35,7 +35,7 @@ try { x = []; x.length = 1.5; $ERROR('#3.1: x = []; x.length = 1.5 throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: x = []; x.length = 1.5 throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js index e8ac8faa9..55ce90487 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.1_T2.js @@ -13,7 +13,7 @@ try { var x = []; x.length = NaN; $ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e)); } @@ -24,7 +24,7 @@ try { x = []; x.length = Number.POSITIVE_INFINITY; $ERROR('#2.1: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#2.2: x = []; x.length = Number.POSITIVE_INFINITY throw RangeError. Actual: ' + (e)); } @@ -35,7 +35,7 @@ try { x = []; x.length = Number.NEGATIVE_INFINITY; $ERROR('#3.1: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#3.2: x = []; x.length = Number.NEGATIVE_INFINITY throw RangeError. Actual: ' + (e)); } @@ -46,7 +46,7 @@ try { x = []; x.length = undefined; $ERROR('#4.1: x = []; x.length = undefined throw RangeError. Actual: x.length === ' + (x.length)); -} catch (e) { +} catch(e) { if ((e instanceof RangeError) !== true) { $ERROR('#4.2: x = []; x.length = undefined throw RangeError. Actual: ' + (e)); } diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js index 24bccec08..d213067fe 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T1.js @@ -13,7 +13,7 @@ description: Change length of array ---*/ //CHECK#1 -var x = [0, , 2, , 4]; +var x = [0,,2,,4]; x.length = 4; if (x[4] !== undefined) { $ERROR('#1: x = [0,,2,,4]; x.length = 4; x[4] === undefined. Actual: ' + (x[4])); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js index f9800a66e..0594a6b6a 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js @@ -14,7 +14,7 @@ description: Checking an inherited property //CHECK#1 Array.prototype[2] = 2; -var x = [0, 1]; +var x = [0,1]; x.length = 3; if (x.hasOwnProperty('2') !== false) { $ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2'))); diff --git a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js index 534484231..c9b7615f9 100644 --- a/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js +++ b/test/built-ins/Array/length/S15.4.5.1_A1.3_T2.js @@ -10,39 +10,21 @@ description: Uint32 use ToNumber and ToPrimitve //CHECK#1 var x = []; -x.length = { - valueOf: function() { - return 2 - } -}; +x.length = {valueOf: function() {return 2}}; if (x.length !== 2) { $ERROR('#1: x = []; x.length = {valueOf: function() {return 2}}; x.length === 2. Actual: ' + (x.length)); } //CHECK#2 x = []; -x.length = { - valueOf: function() { - return 2 - }, - toString: function() { - return 1 - } -}; +x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; if (x.length !== 2) { $ERROR('#0: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return 1}}; x.length === 2. Actual: ' + (x.length)); } //CHECK#3 x = []; -x.length = { - valueOf: function() { - return 2 - }, - toString: function() { - return {} - } -}; +x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; if (x.length !== 2) { $ERROR('#3: x = []; x.length = {valueOf: function() {return 2}, toString: function() {return {}}}; x.length === 2. Actual: ' + (x.length)); } @@ -50,14 +32,7 @@ if (x.length !== 2) { //CHECK#4 try { x = []; - x.length = { - valueOf: function() { - return 2 - }, - toString: function() { - throw "error" - } - }; + x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; if (x.length !== 2) { $ERROR('#4.1: x = []; x.length = {valueOf: function() {return 2}, toString: function() {throw "error"}}; x.length === ",". Actual: ' + (x.length)); } @@ -72,25 +47,14 @@ catch (e) { //CHECK#5 x = []; -x.length = { - toString: function() { - return 1 - } -}; +x.length = {toString: function() {return 1}}; if (x.length !== 1) { $ERROR('#5: x = []; x.length = {toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); } //CHECK#6 x = []; -x.length = { - valueOf: function() { - return {} - }, - toString: function() { - return 1 - } -} +x.length = {valueOf: function() {return {}}, toString: function() {return 1}} if (x.length !== 1) { $ERROR('#6: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return 1}}; x.length === 1. Actual: ' + (x.length)); } @@ -98,14 +62,7 @@ if (x.length !== 1) { //CHECK#7 try { x = []; - x.length = { - valueOf: function() { - throw "error" - }, - toString: function() { - return 1 - } - }; + x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length; $ERROR('#7.1: x = []; x.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; x.length throw "error". Actual: ' + (x.length)); } @@ -118,14 +75,7 @@ catch (e) { //CHECK#8 try { x = []; - x.length = { - valueOf: function() { - return {} - }, - toString: function() { - return {} - } - }; + x.length = {valueOf: function() {return {}}, toString: function() {return {}}}; x.length; $ERROR('#8.1: x = []; x.length = {valueOf: function() {return {}}, toString: function() {return {}}} x.length throw TypeError. Actual: ' + (x.length)); } diff --git a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js index afd9985b1..1bcbb6f97 100644 --- a/test/built-ins/Array/length/S15.4.5.2_A3_T4.js +++ b/test/built-ins/Array/length/S15.4.5.2_A3_T4.js @@ -13,7 +13,7 @@ description: > ---*/ //CHECK#1 -var x = [0, 1, 2]; +var x = [0,1,2]; x[4294967294] = 4294967294; x.length = 2; |