diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object')
286 files changed, 11487 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T1.js new file mode 100644 index 000000000..123dfc05f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T1; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length > end > start = 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(0,3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T2.js new file mode 100644 index 000000000..63d1b852e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T2; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length > end = start > 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(3,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(3,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(3,3); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T3.js new file mode 100644 index 000000000..ccecc6585 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T3; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length > start > end > 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(4,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(4,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(4,3); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T4.js new file mode 100644 index 000000000..e8a0fe05a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T4; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length = end = start > 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(5,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(5,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(5,5); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(5,5); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T5.js new file mode 100644 index 000000000..28e7f0b22 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T5.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T5; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length = end > start > 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(3,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 3) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr[0] === 3. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 4) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr[1] === 4. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[3] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(3,5); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T6.js new file mode 100644 index 000000000..710cf15da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T6.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T6; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: length > end > start > 0; + * +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(2,4); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[3] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(2,4); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T7.js new file mode 100644 index 000000000..a42f7e1fa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.1_T7.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.1_T7; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is positive, use min(end, length); + * @description: end > length > start > 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(3,6); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 3) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr[0] === 3. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 4) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr[1] === 4. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[3] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(3,6); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T1.js new file mode 100644 index 000000000..06aa4d3d4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.2_T1; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is positive, use min(end, length); + * @description: length > end = abs(start), start < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-3,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 1) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== undefined) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-3,3); arr[1] === undefined. Actual: ' + (arr[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T2.js new file mode 100644 index 000000000..0bf4eb496 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T2.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.2_T2; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is positive, use min(end, length); + * @description: length = end > abs(start), start < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-1,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 1) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 4) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr[0] === 4. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== undefined) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-1,5); arr[1] === undefined. Actual: ' + (arr[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T3.js new file mode 100644 index 000000000..53049294b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T3.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.2_T3; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is positive, use min(end, length); + * @description: abs(start) = length > end > 0, start < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-5,1); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 1) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== undefined) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-5,1); arr[1] === undefined. Actual: ' + (arr[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T4.js new file mode 100644 index 000000000..cc70aa9d1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.2_T4.js @@ -0,0 +1,54 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.2_T4; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is positive, use min(end, length); + * @description: abs(start) > length = end > 0, start < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-9,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 5) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr.length === 5. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (arr[4] !== 4) { + $ERROR('#7: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[4] === 4. Actual: ' + (arr[4])); +} + +//CHECK#8 +if (arr[5] !== undefined) { + $ERROR('#8: var x = [0,1,2,3,4]; var arr = x.slice(-9,5); arr[5] === undefined. Actual: ' + (arr[5])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T1.js new file mode 100644 index 000000000..414352ce8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.3_T1; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is negative, use max(end + length, 0); + * @description: length > abs(end) > start = 0, end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,-2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(0,-2); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T2.js new file mode 100644 index 000000000..93b010c45 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.3_T2; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is negative, use max(end + length, 0); + * @description: length > abs(end) > start > 0, end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(1,-4); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(1,-4); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(1,-4); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(1,-4); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T3.js new file mode 100644 index 000000000..3ec1f1fa6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.3_T3; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is negative, use max(end + length, 0); + * @description: length = abs(end) > start = 0, end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,-5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,-5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,-5); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,-5); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T4.js new file mode 100644 index 000000000..a3a1fdb7a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.3_T4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.3_T4; + * @section: 15.4.4.10; + * @assertion: If start is positive, use min(start, length). + * If end is negative, use max(end + length, 0); + * @description: abs(end) > length > start > 0, end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(4,-9); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(4,-9); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(4,-9); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(4,-9); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T1.js new file mode 100644 index 000000000..575f435cc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.4_T1; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is negative, use max(end + length, 0); + * @description: -length = start < end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-5,-2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(-5,-2); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T2.js new file mode 100644 index 000000000..58463b997 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.4_T2; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is negative, use max(end + length, 0); + * @description: -length < start < end < 0; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-3,-1); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-3,-1); arr[2] === undefined. Actual: ' + (arr[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T3.js new file mode 100644 index 000000000..1fa2b1f56 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T3.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.4_T3; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is negative, use max(end + length, 0); + * @description: start < -length < end < 0; +*/ + + +var x = [0,1,2,3,4]; +var arr = x.slice(-9,-1); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (arr[4] !== undefined) { + $ERROR('#7: var x = [0,1,2,3,4]; var arr = x.slice(-9,-1); arr[4] === undefined. Actual: ' + (arr[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T4.js new file mode 100644 index 000000000..b5e066ddc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.4_T4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.4_T4; + * @section: 15.4.4.10; + * @assertion: If start is negative, use max(start + length, 0). + * If end is negative, use max(end + length, 0); + * @description: start = end < -length; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-6,-6); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-6,-6); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-6,-6); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-6,-6); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T1.js new file mode 100644 index 000000000..cc85371d7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T1.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.5_T1; + * @section: 15.4.4.10; + * @assertion: If end is undefined use length; + * @description: end === undefined; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(3, undefined); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 3) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr[0] === 3. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 4) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr[1] === 4. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(3, undefined); arr[2] === undefined. Actual: ' + (arr[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T2.js new file mode 100644 index 000000000..ee6d41129 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A1.5_T2.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A1.5_T2; + * @section: 15.4.4.10; + * @assertion: If end is undefined use length; + * @description: end is absent; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(-2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 3) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr[0] === 3. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 4) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr[1] === 4. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(-2); arr[2] === undefined. Actual: ' + (arr[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T1.js new file mode 100644 index 000000000..8eb1c1397 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T1.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.1_T1; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from start; + * @description: start is not integer; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(2.5,4); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[3] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(2.5,4); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T2.js new file mode 100644 index 000000000..894e50dd6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T2.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.1_T2; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from start; + * @description: start = NaN; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(NaN,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(NaN,3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T3.js new file mode 100644 index 000000000..b8fe8a091 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T3.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.1_T3; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from start; + * @description: start = Infinity; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(Number.POSITIVE_INFINITY,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(Number.POSITIVE_INFINITY,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.POSITIVE_INFINITY,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(Number.POSITIVE_INFINITY,3); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T4.js new file mode 100644 index 000000000..75b9c9525 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T4.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.1_T4; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from start; + * @description: start = -Infinity; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(Number.NEGATIVE_INFINITY,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(Number.NEGATIVE_INFINITY,3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T5.js new file mode 100644 index 000000000..dddc5c630 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.1_T5.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.1_T5; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from start; + * @description: ToInteger use ToNumber; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T1.js new file mode 100644 index 000000000..9a4997d7f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T1.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.2_T1; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from end; + * @description: end is not integer; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(2,4.5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 2) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[3] !== undefined) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(2,4.5); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T2.js new file mode 100644 index 000000000..740a9e8af --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.2_T2; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from end; + * @description: end = NaN; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,NaN); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,NaN); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,NaN); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,NaN); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T3.js new file mode 100644 index 000000000..0fd7cc242 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T3.js @@ -0,0 +1,53 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.2_T3; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from end; + * @description: end = Infinity; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,Number.POSITIVE_INFINITY); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 5) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr.length === 5. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (arr[4] !== 4) { + $ERROR('#7: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[4] === 4. Actual: ' + (arr[4])); +} + +//CHECK#8 +if (arr[5] !== undefined) { + $ERROR('#8: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.POSITIVE_INFINITY); arr[5] === undefined. Actual: ' + (arr[5])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T4.js new file mode 100644 index 000000000..7a8b9fbd8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T4.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.2_T4; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from end; + * @description: end = -Infinity; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,Number.NEGATIVE_INFINITY); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.NEGATIVE_INFINITY); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.NEGATIVE_INFINITY); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== undefined) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,Number.NEGATIVE_INFINITY); arr[0] === undefined. Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T5.js new file mode 100644 index 000000000..d47420c59 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2.2_T5.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2.2_T5; + * @section: 15.4.4.10; + * @assertion: Operator use ToInteger from end; + * @description: ToInteger use ToNumber; +*/ + +var x = [0,1,2,3,4]; +var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var x = [0,1,2,3,4]; var arr = x.slice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T1.js new file mode 100644 index 000000000..2a744d8ec --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T1.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T1; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is positive, use min(start, length). + * If end is positive, use min(end, length); +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(0,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T2.js new file mode 100644 index 000000000..27ea34de5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T2.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T2; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is negative, use max(start + length, 0). + * If end is positive, use min(end, length); +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(-5,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,3); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T3.js new file mode 100644 index 000000000..458c70320 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T3.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T3; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is positive, use min(start, length). + * If end is negative, use max(end + length, 0); +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(0,-2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(0,-2); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T4.js new file mode 100644 index 000000000..90912c6d8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T4.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T4; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is negative, use max(start + length, 0). + * If end is negative, use max(end + length, 0); +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(-5,-2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(-5,-2); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T5.js new file mode 100644 index 000000000..2ed85ac9f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T5.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T5; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If end is undefined use length; +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(2); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 4) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[2] === 4. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T6.js new file mode 100644 index 000000000..9ffbb48d0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A2_T6.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A2_T6; + * @section: 15.4.4.10; + * @assertion: The slice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If end is undefined use length; +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = 0; +obj[1] = 1; +obj[2] = 2; +obj[3] = 3; +obj[4] = 4; +obj.length = 5; +var arr = obj.slice(2, undefined); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 2) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[0] === 2. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 3) { + $ERROR('#4: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[1] === 3. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 4) { + $ERROR('#5: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[2] === 4. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== undefined) { + $ERROR('#6: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = 0; obj[1] = 1; obj[2] = 2; obj[3] = 3; obj[4] = 4; obj.length = 5; var arr = obj.slice(2, undefined); arr[3] === undefined. Actual: ' + (arr[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T1.js new file mode 100644 index 000000000..019c7abbf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A3_T1; + * @section: 15.4.4.10; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; +var arr = obj.slice(0,4294967296); + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== undefined) { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr[0] === undefined. Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[4294967295] !== undefined) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.slice(0,4294967296); arr[4294967295] === undefined. Actual: ' + (arr[4294967295])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T2.js new file mode 100644 index 000000000..691b389db --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A3_T2; + * @section: 15.4.4.10; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967297; +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[0] = "x"; +obj[4294967296] = "y"; +obj.length = 4294967297; +var arr = obj.slice(0,4294967297); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== "x") { + $ERROR('#2: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr[0] === "x". Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[4294967296] !== undefined) { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; var arr = obj.slice(0,4294967297); arr[4294967296] === undefined. Actual: ' + (arr[4294967296])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T3.js new file mode 100644 index 000000000..4e42e684f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A3_T3.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A3_T3; + * @section: 15.4.4.10; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -1; +*/ + +var obj = {}; +obj.slice = Array.prototype.slice; +obj[4294967294] = "x"; +obj.length = -1; +var arr = obj.slice(4294967294,4294967295); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== "x") { + $ERROR('#3: var obj = {}; obj.slice = Array.prototype.slice; obj[4294967294] = "x"; obj.length = 4294967295; var arr = obj.slice(4294967294,4294967295); arr[0] === "x". Actual: ' + (arr[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A4_T1.js new file mode 100644 index 000000000..f6028058a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A4_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.10_A4_T1; + * @section: 15.4.4.10, 8.6.2.1, 15.2.4.5; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype; +*/ + + +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; +var arr = x.slice(); + +//CHECK#1 +if (arr[0] !== 0) { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== 1) { + $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr.hasOwnProperty('1') !== true) { + $ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.slice(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1'))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.1.js new file mode 100644 index 000000000..c7ff2f42c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.1; +* @section: 15.4.4.10, 15.2.4.7, 12.6.4; +* @assertion: The length property of slice has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.slice.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.slice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.slice.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.slice){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.slice) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.2.js new file mode 100644 index 000000000..a590a4f40 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.2; +* @section: 15.4.4.10, 15.2.4.5, 11.4.1; +* @assertion: The length property of slice has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +*/ + +//CHECK#1 +if (Array.prototype.slice.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.slice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); +} + +delete Array.prototype.slice.length; + +//CHECK#2 +if (Array.prototype.slice.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.slice.length; Array.prototype.slice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.slice.length === undefined) { + $ERROR('#3: delete Array.prototype.slice.length; Array.prototype.slice.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.3.js new file mode 100644 index 000000000..177c68450 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.3; +* @section: 15.4.4.10; +* @assertion: The length property of slice has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.slice.length; +Array.prototype.slice.length = Infinity; +if (Array.prototype.slice.length !== x) { + $ERROR('#1: x = Array.prototype.slice.length; Array.prototype.slice.length = Infinity; Array.prototypeslice.length === x. Actual: ' + (Array.prototypeslice.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.4.js new file mode 100644 index 000000000..a6323a86f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.4; +* @section: 15.4.4.10; +* @assertion: The length property of slice is 2; +* @description: slice.length === 2; +*/ + +//CHECK#1 +if (Array.prototype.slice.length !== 2) { + $ERROR('#1: Array.prototype.slice.length === 2. Actual: ' + (Array.prototype.slice.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.5.js new file mode 100644 index 000000000..668b980da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.5; +* @section: 15.4.4.10, 15.2.4.7, 12.6.4; +* @assertion: The slice property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('slice') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'slice\') === false. Actual: ' + (Array.propertyIsEnumerable('slice'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "slice") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "slice") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.6.js new file mode 100644 index 000000000..119ff79d1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.6; +* @section: 15.4.4.10; +* @assertion: The slice property of Array has not prototype property; +* @description: Checking Array.prototype.slice.prototype; +*/ + +//CHECK#1 +if (Array.prototype.slice.prototype !== undefined) { + $ERROR('#1: Array.prototype.slice.prototype === undefined. Actual: ' + (Array.prototype.slice.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.7.js new file mode 100644 index 000000000..e04a41214 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.10_Array_prototype_slice/S15.4.4.10_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.10_A5.7; +* @section: 15.4.4.10, 11.2.2; +* @assertion: The slice property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.slice(); + $ERROR('#1.1: new Array.prototype.slice() throw TypeError. Actual: ' + (new Array.prototype.slice())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.slice() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.1_T1.js new file mode 100644 index 000000000..63e485e28 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.1_T1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.1_T1; + * @section: 15.4.4.11; + * @assertion: If this object does not have a property named by ToString(j), + * and this object does not have a property named by ToString(k), return +0; + * @description: If comparefn is undefined, use SortCompare operator; +*/ + +var x = new Array(2); +x.sort(); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(2); x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== undefined) { + $ERROR('#2: var x = new Array(2); x.sort(); x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(2); x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T1.js new file mode 100644 index 000000000..01114e3c0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.2_T1; + * @section: 15.4.4.11; + * @assertion: If this object does not have a property named by + * ToString(j), return 1. If this object does not have a property + * named by ToString(k), return -1; + * @description: If comparefn is undefined, use SortCompare operator; +*/ + +var x = new Array(2); +x[1] = 1; +x.sort(); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(2); x[1] = 1; x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: var x = new Array(2); x[1] = 1; x.sort(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(2); x[1] = 1; x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} + +var x = new Array(2); +x[0] = 1; +x.sort(); + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: var x = new Array(2); x[0] = 1; x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: var x = new Array(2); x[0] = 1; x.sort(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== undefined) { + $ERROR('#6: var x = new Array(2); x[0] = 1; x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T2.js new file mode 100644 index 000000000..5875e8422 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.2_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.2_T2; + * @section: 15.4.4.11; + * @assertion: If this object does not have a property named by + * ToString(j), return 1. If this object does not have a property + * named by ToString(k), return -1; + * @description: If comparefn is not undefined; +*/ + +var myComparefn = function(x,y) { + if (x === undefined) return -1; + if (y === undefined) return 1; + return 0; +} + +var x = new Array(2); +x[1] = 1; +x.sort(myComparefn); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(2); x[1] = 1; x.sort(myComparefn); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: var x = new Array(2); x[1] = 1; x.sort(myComparefn); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(2); x[1] = 1; x.sort(myComparefn); x[1] === undefined. Actual: ' + (x[1])); +} + +var x = new Array(2); +x[0] = 1; +x.sort(myComparefn); + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: var x = new Array(2); x[0] = 1; x.sort(myComparefn); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: var x = new Array(2); x[0] = 1; x.sort(myComparefn); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== undefined) { + $ERROR('#6: var x = new Array(2); x[0] = 1; x.sort(myComparefn); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.3_T1.js new file mode 100644 index 000000000..ef19564cc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.3_T1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.3_T1; + * @section: 15.4.4.11; + * @assertion: If [[Get]] ToString(j) and [[Get]] ToString(k) + * are both undefined, return +0; + * @description: If comparefn is undefined, use SortCompare operator; +*/ + +var x = new Array(undefined, undefined); +x.sort(); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(undefined, undefined); x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== undefined) { + $ERROR('#2: var x = new Array(undefined, undefined); x.sort(); x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(undefined, undefined); x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T1.js new file mode 100644 index 000000000..35b48a554 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T1.js @@ -0,0 +1,46 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.4_T1; + * @section: 15.4.4.11; + * @assertion: If [[Get]] ToString(j) is undefined, return 1. + * If [[]Get] ToString(k) is undefined, return -1; + * @description: If comparefn is undefined, use SortCompare operator; +*/ + +var x = new Array(undefined, 1); +x.sort(); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(undefined, 1); x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: var x = new Array(undefined, 1); x.sort(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(undefined, 1); x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} + +var x = new Array(1, undefined); +x.sort(); + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: var x = new Array(1, undefined); x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: var x = new Array(1, undefined); x.sort(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== undefined) { + $ERROR('#6: var x = new Array(1, undefined); x.sort(); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T2.js new file mode 100644 index 000000000..9fba05147 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.4_T2.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.4_T2; + * @section: 15.4.4.11; + * @assertion: If [[Get]] ToString(j) is undefined, return 1. + * If [[]Get] ToString(k) is undefined, return -1; + * @description: If comparefn is not undefined; +*/ + +var myComparefn = function(x,y) { + if (x === undefined) return -1; + if (y === undefined) return 1; + return 0; +} + +var x = new Array(undefined, 1); +x.sort(myComparefn); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(undefined, 1); x.sort(myComparefn); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: var x = new Array(undefined, 1); x.sort(myComparefn); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== undefined) { + $ERROR('#3: var x = new Array(undefined, 1); x.sort(myComparefn); x[1] === undefined. Actual: ' + (x[1])); +} + +var x = new Array(1, undefined); +x.sort(myComparefn); + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: var x = new Array(1, undefined); x.sort(myComparefn); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: var x = new Array(1, undefined); x.sort(myComparefn); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== undefined) { + $ERROR('#6: var x = new Array(1, undefined); x.sort(myComparefn); x[1] === undefined. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.5_T1.js new file mode 100644 index 000000000..43a1ffd51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A1.5_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A1.5_T1; + * @section: 15.4.4.11; + * @assertion: If comparefn is undefined, use SortCompare operator; + * @description: Checking sort() and sort(undefined); +*/ + +var x = new Array(1,0); +x.sort(); + +//CHECK#1 +if (x.length !== 2) { + $ERROR('#1: var x = new Array(1,0); x.sort(); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#2 +if (x[0] !== 0) { + $ERROR('#2: var x = new Array(1,0); x.sort(); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== 1) { + $ERROR('#3: var x = new Array(1,0); x.sort(); x[1] === 1. Actual: ' + (x[1])); +} + +var x = new Array(1,0); +x.sort(undefined); + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: var x = new Array(1,0); x.sort(undefined); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 0) { + $ERROR('#5: var x = new Array(1,0); x.sort(undefined); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 1) { + $ERROR('#6: var x = new Array(1,0); x.sort(undefined); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T1.js new file mode 100644 index 000000000..6bb97776d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.1_T1; + * @section: 15.4.4.11; + * @assertion: + * If ToString([[Get]] ToString(j)) < ToString([[Get]] ToString(k)), return -1. + * If ToString([[Get]] ToString(j)) > ToString([[Get]] ToString(k)), return 1; + * return -1 + * @description: Checking ENGLISH ALPHABET; +*/ + + +var alphabetR = ["z", "y", "x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n", "M", "L", "K", "J", "I", "H", "G", "F", "E", "D", "C", "B", "A"]; +var alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; + +//CHECK#1 +alphabetR.sort(); +var result = true; +for (var i = 0; i < 26; i++) { + if (alphabetR[i] !== alphabet[i]) result = false; +} + +if (result !== true) { + $ERROR('#1: CHECK ENGLISH ALPHABET'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T2.js new file mode 100644 index 000000000..63d218c9e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.1_T2; + * @section: 15.4.4.11; + * @assertion: + * If ToString([[Get]] ToString(j)) < ToString([[Get]] ToString(k)), return -1. + * If ToString([[Get]] ToString(j)) > ToString([[Get]] ToString(k)), return 1; + * return -1 + * @description: Checking RUSSIAN ALPHABET; +*/ + +var alphabetR = ["ё", "я", "ю", "э", "ь", "ы", "ъ", "щ", "ш", "ч", "ц", "х", "ф", "у", "т", "с", "р", "П", "О", "Н", "М", "Л", "К", "Й", "И", "З", "Ж", "Е", "Д", "Г", "В", "Б", "А"]; +var alphabet = ["А", "Б", "В", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я", "ё"]; + +//CHECK#1 +alphabetR.sort(); +var result = true; +for (var i = 0; i < 26; i++) { + if (alphabetR[i] !== alphabet[i]) result = false; +} + +if (result !== true) { + $ERROR('#1: CHECK RUSSIAN ALPHABET'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T3.js new file mode 100644 index 000000000..2baae9b9b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.1_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.1_T3; + * @section: 15.4.4.11; + * @assertion: + * If ToString([[Get]] ToString(j)) < ToString([[Get]] ToString(k)), return -1. + * If ToString([[Get]] ToString(j)) > ToString([[Get]] ToString(k)), return 1; + * return -1 + * @description: Checking ToString operator; +*/ + +var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var alphabetR = [undefined, 2, 1, "X", -1, "a", true, obj, NaN, Infinity]; +var alphabet = [-1, obj, 1, 2, Infinity, NaN, "X", "a", true, undefined]; + +//CHECK#1 +alphabetR.sort(); +var result = true; +for (var i = 0; i < 10; i++) { + if (!(isNaN(alphabetR[i]) && isNaN(alphabet[i]))) { + if (alphabetR[i] !== alphabet[i]) result = false; + } +} + +if (result !== true) { + $ERROR('#1: Check ToString operator'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T1.js new file mode 100644 index 000000000..9daf50dcf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T1.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.2_T1; + * @section: 15.4.4.11; + * @assertion: My comparefn is inverse implementation comparefn; + * @description: Checking ENGLISH ALPHABET; +*/ + +var alphabetR = ["z", "y", "x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n", "M", "L", "K", "J", "I", "H", "G", "F", "E", "D", "C", "B", "A"]; +var alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; + +var myComparefn = function(x,y) { + var xS = String(x); + var yS = String(y); + if (xS < yS) return 1 + if (xS > yS) return -1; + return 0; +} + +//CHECK#1 +alphabet.sort(myComparefn); +var result = true; +for (var i = 0; i < 26; i++) { + if (alphabetR[i] !== alphabet[i]) result = false; +} + +if (result !== true) { + $ERROR('#1: CHECK ENGLISH ALPHABET'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T2.js new file mode 100644 index 000000000..5f99da67a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.2_T2; + * @section: 15.4.4.11; + * @assertion: My comparefn is inverse implementation comparefn; + * @description: Checking RUSSIAN ALPHABET; +*/ + +var alphabetR = ["ё", "я", "ю", "э", "ь", "ы", "ъ", "щ", "ш", "ч", "ц", "х", "ф", "у", "т", "с", "р", "П", "О", "Н", "М", "Л", "К", "Й", "И", "З", "Ж", "Е", "Д", "Г", "В", "Б", "А"]; +var alphabet = ["А", "Б", "В", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я", "ё"]; + +var myComparefn = function(x,y) { + var xS = String(x); + var yS = String(y); + if (xS < yS) return 1 + if (xS > yS) return -1; + return 0; +} + +//CHECK#1 +alphabet.sort(myComparefn); +var result = true; +for (var i = 0; i < 26; i++) { + if (alphabetR[i] !== alphabet[i]) result = false; +} + +if (result !== true) { + $ERROR('#1: CHECK RUSSIAN ALPHABET'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T3.js new file mode 100644 index 000000000..634555759 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A2.2_T3.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A2.2_T3; + * @section: 15.4.4.11; + * @assertion: My comparefn is inverse implementation comparefn; + * @description: Checking ToString operator; +*/ + +var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var alphabetR = [undefined, 2, 1, "X", -1, "a", true, obj, NaN, Infinity]; +var alphabet = [true, "a", "X", NaN, Infinity, 2, 1, obj, -1, undefined]; + +var myComparefn = function(x,y) { + var xS = String(x); + var yS = String(y); + if (xS < yS) return 1 + if (xS > yS) return -1; + return 0; +} + +//CHECK#1 +alphabetR.sort(myComparefn); +var result = true; +for (var i = 0; i < 10; i++) { + if (!(isNaN(alphabetR[i]) && isNaN(alphabet[i]))) { + if (alphabetR[i] !== alphabet[i]) result = false; + } +} + +if (result !== true) { + $ERROR('#1: Check ToString operator'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T1.js new file mode 100644 index 000000000..eccbd02c7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T1.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A3_T1; + * @section: 15.4.4.11; + * @assertion: The sort function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If comparefn is undefined, use SortCompare operator; +*/ + + +var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var alphabetR = {0:undefined, 1:2, 2:1, 3:"X", 4:-1, 5:"a", 6:true, 7:obj, 8:NaN, 9:Infinity}; +alphabetR.sort = Array.prototype.sort; +alphabetR.length = 10; +var alphabet = [-1, obj, 1, 2, Infinity, NaN, "X", "a", true, undefined]; + +alphabetR.sort(); + + //CHECK#0 +alphabetR.getClass = Object.prototype.toString; +if (alphabetR.getClass() !== "[object " + "Object" + "]") { + $ERROR('#0: alphabetR.sort() is Object object, not Array object'); +} + +//CHECK#1 +var result = true; +for (var i = 0; i < 10; i++) { + if (!(isNaN(alphabetR[i]) && isNaN(alphabet[i]))) { + if (alphabetR[i] !== alphabet[i]) result = false; + } +} + +if (result !== true) { + $ERROR('#1: Check ToString operator'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T2.js new file mode 100644 index 000000000..a5cb70873 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A3_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A3_T2; + * @section: 15.4.4.11; + * @assertion: The sort function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If comparefn is not undefined; +*/ + + +var obj = {valueOf: function() {return 1}, toString: function() {return -2}}; +var alphabetR = {0:undefined, 1:2, 2:1, 3:"X", 4:-1, 5:"a", 6:true, 7:obj, 8:NaN, 9:Infinity}; +alphabetR.sort = Array.prototype.sort; +alphabetR.length = 10; +var alphabet = [true, "a", "X", NaN, Infinity, 2, 1, obj, -1, undefined]; + + var myComparefn = function(x,y) { + var xS = String(x); + var yS = String(y); + if (xS < yS) return 1 + if (xS > yS) return -1; + return 0; +} + +alphabetR.sort(myComparefn); + + //CHECK#0 +alphabetR.getClass = Object.prototype.toString; +if (alphabetR.getClass() !== "[object " + "Object" + "]") { + $ERROR('#0: alphabetR.sort() is Object object, not Array object'); +} + +//CHECK#1 +var result = true; +for (var i = 0; i < 10; i++) { + if (!(isNaN(alphabetR[i]) && isNaN(alphabet[i]))) { + if (alphabetR[i] !== alphabet[i]) result = false; + } +} + +if (result !== true) { + $ERROR('#1: Check ToString operator'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T1.js new file mode 100644 index 000000000..4ca5ba757 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A4_T1; + * @section: 15.4.4.11; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.sort = Array.prototype.sort; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; + +//CHECK#1 +if (obj.sort() !== obj) { + $ERROR('#1: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.sort() === obj. Actual: ' + (obj.sort())); +} + +//CHECK#2 +if (obj.length !== 4294967296) { + $ERROR('#2: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.sort(); obj.length === 4294967296. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.sort(); obj[0] == "x"'); +} + +//CHECK#4 +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.sort = Array.prototype.sort; obj[] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.sort(); obj[4294967295] == "y"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T2.js new file mode 100644 index 000000000..5cc1714ed --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T2.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A4_T2; + * @section: 15.4.4.11; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967298; +*/ + +var obj = {}; +obj.sort = Array.prototype.sort; +obj[0] = "z"; +obj[1] = "y"; +obj[4294967297] = "x"; +obj.length = 4294967298; + +//CHECK#1 +if (obj.sort() !== obj) { + $ERROR('#1: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[4294967297] = "x"; obj.length = 4294967298; obj.sort() === obj. Actual: ' + (obj.sort())); +} + +//CHECK#2 +if (obj.length !== 4294967298) { + $ERROR('#2: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[4294967297] = "x"; obj.length = 4294967298; obj.sort(); obj.length === 4294967298. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[4294967297] = "x"; obj.length = 4294967298; obj.sort(); obj[0] === "y". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "z") { + $ERROR('#4: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[4294967297] = "x"; obj.length = 4294967298; obj.sort(); obj[1] === "z". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[4294967297] !== "x") { + $ERROR('#5: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[4294967297] = "x"; obj.length = 4294967298; obj.sort(); obj[4294967297] === "x". Actual: ' + (obj[4294967297])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T3.js new file mode 100644 index 000000000..20300e3c5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A4_T3.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A4_T3; + * @section: 15.4.4.11; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -4294967294; +*/ + +var obj = {}; +obj.sort = Array.prototype.sort; +obj[0] = "z"; +obj[1] = "y"; +obj[2] = "x"; +obj.length = -4294967294; + +//CHECK#1 +if (obj.sort() !== obj) { + $ERROR('#1: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort() === obj. Actual: ' + (obj.sort())); +} + +//CHECK#2 +if (obj.length !== -4294967294) { + $ERROR('#2: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj.length === -4294967294. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[0] === "y". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "z") { + $ERROR('#4: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[1] === "z". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "x") { + $ERROR('#5: var obj = {}; obj.sort = Array.prototype.sort; obj[0] = "z"; obj[1] = "y"; obj[2] = "x"; obj.length = -4294967294; obj.sort(); obj[2] === "x". Actual: ' + (obj[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A5_T1.js new file mode 100644 index 000000000..a1784629e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A5_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A5_T1; + * @section: 15.4.4.11; + * @assertion: Array.sort should not eat exceptions; + * @description: comparefn function throw "error"; +*/ + +//CHECK#1 +var myComparefn = function(x,y) { + throw "error"; +} +var x = [1,0]; +try { + x.sort(myComparefn) + $ERROR('#1.1: Array.sort should not eat exceptions'); +} catch(e) { + if (e !== "error") { + $ERROR('#1.2: Array.sort should not eat exceptions'); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A6_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A6_T2.js new file mode 100644 index 000000000..daca89499 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A6_T2.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.11_A6_T2; + * @section: 15.4.4.11, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [1,0]; +x.length = 2; +x.sort(); + +//CHECK#1 +if (x[0] !== 0) { + $ERROR('#1: Array.prototype[1] = -1; x = [1,0]; x.length = 2; x.sort(); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#2 +if (x[1] !== 1) { + $ERROR('#2: Array.prototype[1] = -1; x = [1,0]; x.length = 2; x.sort(); x[1] === 1. Actual: ' + (x[1])); +} + +x.length = 0; + +//CHECK#3 +if (x[0] !== undefined) { + $ERROR('#3: Array.prototype[1] = -1; x = [1,0]; x.length = 2; x.sort(); x.length = 0; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== -1) { + $ERROR('#4: Array.prototype[1] = -1; x = [1,0]; x.length = 2; x.sort(); x.length = 0; x[1] === -1. Actual: ' + (x[1])); +} + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.sort = Array.prototype.sort; +x = {0:1,1:0}; +x.sort(); + +//CHECK#5 +if (x[0] !== 0) { + $ERROR('#5: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.sort = Array.prototype.sort; x = {0:1,1:0}; x.sort(); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 1) { + $ERROR('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.sort = Array.prototype.sort; x = {0:1,1:0}; x.sort(); x[1] === 1. Actual: ' + (x[1])); +} + +delete x[0]; +delete x[1]; + +//CHECK#7 +if (x[0] !== undefined) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.sort = Array.prototype.sort; x = {0:1,1:0}; x.sort(); delete x[0]; delete x[1]; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== -1) { + $ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.sort = Array.prototype.sort; x = {0:1,1:0}; x.sort(); delete x[0]; delete x[1]; x[1] === -1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.1.js new file mode 100644 index 000000000..c7b8d3161 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.1; +* @section: 15.4.4.11, 15.2.4.7, 12.6.4; +* @assertion: The length property of sort has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.sort.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.sort.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.sort.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.sort){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.sort) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.2.js new file mode 100644 index 000000000..5cf97c68a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.2; +* @section: 15.4.4.11, 15.2.4.5, 11.4.1; +* @assertion: The length property of sort has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.sort.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.sort.prototype.hasOwnProperty(\'length\') === true. Actual: ' + (Array.sort.prototype.hasOwnProperty('length'))); +} + +delete Array.prototype.sort.length; + +//CHECK#2 +if (Array.prototype.sort.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.sort.length; Array.prototype.sort.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.sort.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.sort.length === undefined) { + $ERROR('#3: delete Array.prototype.sort.length; Array.prototype.sort.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.3.js new file mode 100644 index 000000000..e415d9988 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.3; +* @section: 15.4.4.11; +* @assertion: The length property of sort has the attribute ReadOnly; +* @description: Checking if varying the length fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.sort.length; +Array.prototype.sort.length = Infinity; +if (Array.prototype.sort.length !== x) { + $ERROR('#1: x = Array.prototype.sort.length; Array.prototype.sort.length = Infinity; Array.prototype.sort.length === x. Actual: ' + (Array.prototype.sort.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.4.js new file mode 100644 index 000000000..6c64171d4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.4; +* @section: 15.4.4.11; +* @assertion: The length property of sort is 1; +* @description: sort.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.sort.length !== 1) { + $ERROR('#1: Array.prototype.sort.length === 1. Actual: ' + (Array.prototype.sort.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.5.js new file mode 100644 index 000000000..f3c388d4e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.5; +* @section: 15.4.4.11, 15.2.4.7, 12.6.4; +* @assertion: The sort property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('sort') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'sort\') === false. Actual: ' + (Array.propertyIsEnumerable('sort'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "sort") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "sort") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.6.js new file mode 100644 index 000000000..8d8192e72 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.6; +* @section: 15.4.4.11; +* @assertion: The sort property of Array has not prototype property; +* @description: Checking Array.prototype.sort.prototype; +*/ + +//CHECK#1 +if (Array.prototype.sort.prototype !== undefined) { + $ERROR('#1: Array.prototype.sort.prototype === undefined. Actual: ' + (Array.prototype.sort.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.7.js new file mode 100644 index 000000000..fa60764bc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A7.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A7.7; +* @section: 15.4.4.11, 11.2.2; +* @assertion: The sort property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.sort(); + $ERROR('#1.1: new Array.prototype.sort() throw TypeError. Actual: ' + (new Array.prototype.sort())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.sort() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js new file mode 100644 index 000000000..b32842a7b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.11_Array_prototype_sort/S15.4.4.11_A8.js @@ -0,0 +1,24 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.11_A8; +* @section: 15.4.4.11; +* @assertion: Call the comparefn passing undefined as the this value +* (step 13b); +* @description: comparefn tests that its this value is undefined; +*/ + +var global = this; +[2,3].sort(function(x,y) { + "use strict"; + + if (this === global) { + $FAIL('#1: Sort leaks global'); + } + if (this !== undefined) { + $FAIL('#2: Sort comparefn should be called with this===undefined. ' + + 'Actual: ' + this); + } + return x - y; +}); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T1.js new file mode 100644 index 000000000..b14ab1dee --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T1; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length > deleteCount > start = 0, itemCount = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,3); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T2.js new file mode 100644 index 000000000..079512559 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T2; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length > deleteCount > start = 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 4) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x[0] === 4. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 5) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x[1] === 5. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 3) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(0,3,4,5); x[2] === 3. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T3.js new file mode 100644 index 000000000..7d081f357 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T3.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T3; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length = deleteCount > start = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,4); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,4); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,4); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,4); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (x.length !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,4); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T4.js new file mode 100644 index 000000000..7ffc2ebe2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T4.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T4; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length > deleteCount > start > 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(1,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 4) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x[1] === 4. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 5) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(1,3,4,5); x[2] === 5. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T5.js new file mode 100644 index 000000000..1d9d6a7fb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T5; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: deleteCount > length > start = 0, itemCount = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,5); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,5); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (x.length !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,5); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T6.js new file mode 100644 index 000000000..4040557cf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.1_T6.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.1_T6; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length = deleteCount > start > 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(1,4,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 4) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x[1] === 4. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 5) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(1,4,4,5); x[2] === 5. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T1.js new file mode 100644 index 000000000..f8c69de2b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T1.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.2_T1; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; + * @description: -length = start < deleteCount < 0, itemCount = 0; +*/ + +var x = [0,1]; +var arr = x.splice(-2,-1); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(-2,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(-2,-1); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(-2,-1); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(-2,-1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(-2,-1); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T2.js new file mode 100644 index 000000000..166ac9f95 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.2_T2; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; + * @description: -length < start = deleteCount < 0, itemCount = 0; +*/ + +var x = [0,1]; +var arr = x.splice(-1,-1); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(-1,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(-1,-1); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(-1,-1); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(-1,-1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(-1,-1); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T3.js new file mode 100644 index 000000000..9ffeb7aed --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T3.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.2_T3; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; + * @description: -length = start < deleteCount < 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(-2,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(-2,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(-2,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 2) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x[0] === 2. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 3) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x[1] === 3. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 0) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x[2] === 0. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 1) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(-2,-1,2,3); x[3] === 1. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T4.js new file mode 100644 index 000000000..9f6cb0aac --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T4.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.2_T4; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; + * @description: -length < start = deleteCount < 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(-1,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(-1,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(-1,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 2) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x[1] === 2. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 3) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x[2] === 3. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 1) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(-1,-1,2,3); x[3] === 1. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T5.js new file mode 100644 index 000000000..017b5184b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.2_T5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.2_T5; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; + * @description: start < -length < deleteCount < 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(-3,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(-3,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(-3,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 2) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x[0] === 2. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 3) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x[1] === 3. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 0) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x[2] === 0. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 1) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(-3,-1,2,3); x[3] === 1. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T1.js new file mode 100644 index 000000000..edcb25d11 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T1.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.3_T1; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; + * @description: -length < deleteCount < start = 0, itemCount = 0; +*/ + +var x = [0,1]; +var arr = x.splice(0,-1); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(0,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(0,-1); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(0,-1); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(0,-1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(0,-1); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T2.js new file mode 100644 index 000000000..969c68458 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.3_T2; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; + * @description: -length = -start < deleteCount < 0, itemCount = 0; +*/ + +var x = [0,1]; +var arr = x.splice(2,-1); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(2,-1); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(2,-1); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(2,-1); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(2,-1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(2,-1); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T3.js new file mode 100644 index 000000000..10e7c77c4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T3.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.3_T3; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; + * @description: -length < deleteCount < start = 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(0,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(0,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(0,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(0,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 2) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(0,-1,2,3); x[0] === 2. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 3) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(0,-1,2,3); x[1] === 3. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 0) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(0,-1,2,3); x[2] === 0. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 1) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(0,-1,2,3); x[3] === 1. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T4.js new file mode 100644 index 000000000..edf565843 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T4.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.3_T4; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; + * @description: -length = -start < deleteCount < 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(2,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(2,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(2,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(2,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(2,-1,2,3); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(2,-1,2,3); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 2) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(2,-1,2,3); x[2] === 2. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 3) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(2,-1,2,3); x[3] === 3. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T5.js new file mode 100644 index 000000000..2062edb1d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.3_T5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.3_T5; + * @section: 15.4.4.12; + * @assertion: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; + * @description: -start < -length < deleteCount < 0, itemCount > 0; +*/ + +var x = [0,1]; +var arr = x.splice(3,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(3,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(3,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 4) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(3,-1,2,3); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(3,-1,2,3); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(3,-1,2,3); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 2) { + $ERROR('#5: var x = [0,1]; var arr = x.splice(3,-1,2,3); x[2] === 2. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 3) { + $ERROR('#6: var x = [0,1]; var arr = x.splice(3,-1,2,3); x[3] === 3. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T1.js new file mode 100644 index 000000000..134eb8c8d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T1; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length = -start > deleteCount > 0, itemCount = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-4,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-4,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-4,3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-4,3); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T2.js new file mode 100644 index 000000000..5f6976cc1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T2; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length = -start > deleteCount > 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-4,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 4) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x[0] === 4. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 5) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x[1] === 5. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 3) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(-4,3,4,5); x[2] === 3. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T3.js new file mode 100644 index 000000000..6e5d59912 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T3.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T3; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: -start > length = deleteCount > 0, itemCount = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-5,4); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-5,4); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (x.length !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-5,4); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T4.js new file mode 100644 index 000000000..cd2417bf7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T4.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T4; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length > -start = deleteCount > 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-3,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 4) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x[1] === 4. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 5) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(-3,3,4,5); x[2] === 5. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T5.js new file mode 100644 index 000000000..baaba3faa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T5; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: -start > deleteCount > length > 0, itemCount = 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-9,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-9,5); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (x.length !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-9,5); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T6.js new file mode 100644 index 000000000..fee2e7463 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.4_T6.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.4_T6; + * @section: 15.4.4.12; + * @assertion: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); + * @description: length = deleteCount > -start > 0, itemCount > 0; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(-3,4,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x.length === 3. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 4) { + $ERROR('#8: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x[1] === 4. Actual: ' + (x[1])); +} + +//CHECK#9 +if (x[2] !== 5) { + $ERROR('#9: var x = [0,1,2,3]; var arr = x.splice(-3,4,4,5); x[2] === 5. Actual: ' + (x[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T1.js new file mode 100644 index 000000000..dbb61c191 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T1.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.5_T1; + * @section: 15.4.4.12; + * @assertion: Splice with undefined arguments; + * @description: start === undefined, end === undefined; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(undefined, undefined); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (x.length !== 4) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#4 +if (x[0] !== 0) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#5 +if (x[1] !== 1) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x[2] !== 2) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x[2] === 2. Actual: ' + (x[2])); +} + +//CHECK#7 +if (x[3] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(undefined, undefined); x[3] === 3. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T2.js new file mode 100644 index 000000000..039393669 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A1.5_T2.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A1.5_T2; + * @section: 15.4.4.12; + * @assertion: Splice with undefined arguments; + * @description: end === undefined; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(1,undefined); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(1,undefined); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,undefined); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (x.length !== 4) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x.length === 4. Actual: ' + (x.length)); +} + +//CHECK#4 +if (x[0] !== 0) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#5 +if (x[1] !== 1) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x[2] !== 2) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x[2] === 2. Actual: ' + (x[2])); +} + +//CHECK#7 +if (x[3] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(1,undefined); x[3] === 3. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T1.js new file mode 100644 index 000000000..7f72adc4e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T1.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.1_T1; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from start; + * @description: start is not integer; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(1.5,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1.5,3); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1.5,3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(1.5,3); x[0] === 0. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T2.js new file mode 100644 index 000000000..cb2d9bc08 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T2.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.1_T2; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from start; + * @description: start = NaN; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(NaN,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(NaN,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(NaN,3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(NaN,3); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T3.js new file mode 100644 index 000000000..d33433849 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T3.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.1_T3; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from start; + * @description: start = Infinity; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(Number.POSITIVE_INFINITY,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(Number.POSITIVE_INFINITY,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 0) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(Number.POSITIVE_INFINITY,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[2] === 2. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var x = x.splice(Number.POSITIVE_INFINITY,3); x[3] === 3. Actual: ' + (x[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T4.js new file mode 100644 index 000000000..8ece1cad0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T4.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.1_T4; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from start; + * @description: start = -Infinity; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(Number.NEGATIVE_INFINITY,3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(Number.NEGATIVE_INFINITY,3); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T5.js new file mode 100644 index 000000000..ddd3c6ae8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.1_T5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.1_T5; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from start; + * @description: ToInteger use ToNumber; + * @description: ToInteger use ToNumber; +*/ + +var x = [0,1,2,3]; +var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice({valueOf: function() {return 0}, toString: function() {return 3}},3); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T1.js new file mode 100644 index 000000000..6f7ed48da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T1.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.2_T1; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from deleteCount; + * @description: deleteCount is not integer; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(1,3.5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 1) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 2) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr[1] === 2. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 3) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(1,3.5); arr[2] === 3. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(1,3.5); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(1,3.5); x[0] === 0. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T2.js new file mode 100644 index 000000000..6d6f782fb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T2.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.2_T2; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from deleteCount; + * @description: deleteCount = NaN; +*/ + +var x = [0,1]; +var arr = x.splice(0,NaN); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(0,NaN); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(0,NaN); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(0,NaN); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(0,NaN); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(0,NaN); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T3.js new file mode 100644 index 000000000..4446d254c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T3.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.2_T3; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from deleteCount; + * @description: deleteCount = Infinity; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,Number.POSITIVE_INFINITY); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 4) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr.length === 4. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (arr[3] !== 3) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#7 +if (x.length !== 0) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,Number.POSITIVE_INFINITY); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T4.js new file mode 100644 index 000000000..401f55545 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T4.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.2_T4; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from deleteCount; + * @description: deleteCount = -Infinity; +*/ + +var x = [0,1]; +var arr = x.splice(0,Number.NEGATIVE_INFINITY); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: var x = [0,1]; var arr = x.splice(0,Number.NEGATIVE_INFINITY); x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T5.js new file mode 100644 index 000000000..556f65d6d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2.2_T5.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2.2_T5; + * @section: 15.4.4.12; + * @assertion: Operator use ToInteger from deleteCount; + * @description: ToInteger use ToNumber; +*/ + +var x = [0,1,2,3]; +var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +if (x[0] !== 3) { + $ERROR('#7: var x = [0,1,2,3]; var arr = x.splice(0,{valueOf: function() {return 3}, toString: function() {return 0}}); x[0] === 3. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T1.js new file mode 100644 index 000000000..3d3ed443d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T1.js @@ -0,0 +1,67 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2_T1; + * @section: 15.4.4.12; + * @assertion: The splice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is positive, use min(start, length). + * If deleteCount is positive, use min(deleteCount, length - start); +*/ + +var obj = {0:0,1:1,2:2,3:3}; +obj.length = 4; +obj.splice = Array.prototype.splice; +var arr = obj.splice(0,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (obj.length !== 3) { + $ERROR('#6: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj.length === 3. Actual: ' + (obj.length)); +} + +//CHECK#7 +if (obj[0] !== 4) { + $ERROR('#7: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj[0] === 4. Actual: ' + (obj[0])); +} + +//CHECK#8 +if (obj[1] !== 5) { + $ERROR('#8: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj[1] === 5. Actual: ' + (obj[1])); +} + +//CHECK#9 +if (obj[2] !== 3) { + $ERROR('#9: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj[2] === 3. Actual: ' + (obj[2])); +} + +//CHECK#10 +if (obj[3] !== undefined) { + $ERROR('#10: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(0,3,4,5); obj[3] === undefined. Actual: ' + (obj[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T2.js new file mode 100644 index 000000000..59b066368 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T2.js @@ -0,0 +1,57 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2_T2; + * @section: 15.4.4.12; + * @assertion: The splice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is negative, use max(start + length, 0). + * If deleteCount is negative, use 0; +*/ + +var obj = {0:0,1:1}; +obj.length = 2; +obj.splice = Array.prototype.splice; +var arr = obj.splice(-2,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (obj.length !== 4) { + $ERROR('#2: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj.length === 4. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== 2) { + $ERROR('#3: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj[0] === 2. Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== 3) { + $ERROR('#4: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj[1] === 3. Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== 0) { + $ERROR('#5: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj[2] === 0. Actual: ' + (obj[2])); +} + +//CHECK#6 +if (obj[3] !== 1) { + $ERROR('#6: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj[3] === 1. Actual: ' + (obj[3])); +} + +//CHECK#7 +if (obj[4] !== undefined) { + $ERROR('#7: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(-2,-1,2,3); obj[4] === undefined. Actual: ' + (obj[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T3.js new file mode 100644 index 000000000..8e6d0402d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T3.js @@ -0,0 +1,57 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2_T3; + * @section: 15.4.4.12; + * @assertion: The splice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is positive, use min(start, length). + * If deleteCount is negative, use 0; +*/ + +var obj = {0:0,1:1}; +obj.length = 2; +obj.splice = Array.prototype.splice; +var arr = obj.splice(0,-1,2,3); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (obj.length !== 4) { + $ERROR('#2: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj.length === 4. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== 2) { + $ERROR('#3: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj[0] === 2. Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== 3) { + $ERROR('#4: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj[1] === 3. Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== 0) { + $ERROR('#5: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj[2] === 0. Actual: ' + (obj[2])); +} + +//CHECK#6 +if (obj[3] !== 1) { + $ERROR('#6: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj[3] === 1. Actual: ' + (obj[3])); +} + +//CHECK#7 +if (obj[4] !== undefined) { + $ERROR('#7: var obj = {0:0,1:1}; obj.length = 2; obj.splice = Array.prototype.splice; var arr = obj.splice(0,-1,2,3); obj[4] === undefined. Actual: ' + (obj[4])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T4.js new file mode 100644 index 000000000..6443c4db4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A2_T4.js @@ -0,0 +1,67 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A2_T4; + * @section: 15.4.4.12; + * @assertion: The splice function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If start is negative, use max(start + length, 0). + * If deleteCount is positive, use min(deleteCount, length - start); +*/ + +var obj = {0:0,1:1,2:2,3:3}; +obj.length = 4; +obj.splice = Array.prototype.splice; +var arr = obj.splice(-4,3,4,5); + +//CHECK#1 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#2 +if (arr.length !== 3) { + $ERROR('#2: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr.length === 3. Actual: ' + (arr.length)); +} + +//CHECK#3 +if (arr[0] !== 0) { + $ERROR('#3: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (arr[1] !== 1) { + $ERROR('#4: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#5 +if (arr[2] !== 2) { + $ERROR('#5: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#6 +if (obj.length !== 3) { + $ERROR('#6: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj.length === 3. Actual: ' + (obj.length)); +} + +//CHECK#7 +if (obj[0] !== 4) { + $ERROR('#7: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj[0] === 4. Actual: ' + (obj[0])); +} + +//CHECK#8 +if (obj[1] !== 5) { + $ERROR('#8: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj[1] === 5. Actual: ' + (obj[1])); +} + +//CHECK#9 +if (obj[2] !== 3) { + $ERROR('#9: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj[2] === 3. Actual: ' + (obj[2])); +} + +//CHECK#10 +if (obj[3] !== undefined) { + $ERROR('#10: var obj = {0:0,1:1,2:2,3:3}; obj.length = 4; obj.splice = Array.prototype.splice; var arr = obj.splice(-4,3,4,5); obj[3] === undefined. Actual: ' + (obj[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T1.js new file mode 100644 index 000000000..5bd93a57b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A3_T1; + * @section: 15.4.4.12; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.splice = Array.prototype.splice; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; +var arr = obj.splice(4294967295, 1); + +//CHECK#1 +if (arr.length !== 0) { + $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); arr.length === 0. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; var arr = obj.splice(4294967295,1); obj[4294967295] === "y". Actual: ' + (obj[4294967295])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T2.js new file mode 100644 index 000000000..bac99a252 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T2.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A3_T2; + * @section: 15.4.4.12; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.splice = Array.prototype.splice; +obj[0] = "x"; +obj.length = 4294967297; +var arr = obj.splice(0,1); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[0] = "y"; obj.length = 4294967297; var arr = obj.splice(0,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== "x") { + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[0] = "y"; obj.length = 1; var arr = obj.splice(0,1); arr[0] === "x". Actual: ' + (arr[0])); +} + +//CHECK#3 +if (obj.length !== 0) { + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[0] = "y"; obj.length = 1; var arr = obj.splice(0,1); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#4 +if (obj[0] !== undefined) { + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[0] = "x"; obj[0] = "y"; obj.length = 1; var arr = obj.splice(0,1); obj[0] === undefined. Actual: ' + (obj[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T3.js new file mode 100644 index 000000000..1b66eed28 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A3_T3.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A3_T3; + * @section: 15.4.4.12; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.splice = Array.prototype.splice; +obj[4294967294] = "x"; +obj.length = -1; +var arr = obj.splice(4294967294,1); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = -1; var arr = obj.splice(4294967294,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== "x") { + $ERROR('#2: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); arr[0] === "x". Actual: ' + (arr[0])); +} + +//CHECK#3 +if (obj.length !== 4294967294) { + $ERROR('#3: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj.length === 4294967294. Actual: ' + (obj.length)); +} + +//CHECK#4 +if (obj[4294967294] !== undefined) { + $ERROR('#4: var obj = {}; obj.splice = Array.prototype.splice; obj[4294967294] = "x"; obj.length = 1; var arr = obj.splice(4294967294,1); obj[4294967294] === undefined. Actual: ' + (obj[4294967294])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T1.js new file mode 100644 index 000000000..3e3e3a427 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T1.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A4_T1; + * @section: 15.4.4.12, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [0,1]; +var arr = x.splice(1,1); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== 1) { + $ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[1] !== -1) { + $ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1])); +} + +//CHECK#4 +if (x.length !== 1) { + $ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 0) { + $ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== -1) { + $ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1])); +} + + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.splice = Array.prototype.splice; +x = {0:0, 1:1}; +var arr = x.splice(1,1); + +//CHECK#7 +if (arr.length !== 1) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#8 +if (arr[0] !== 1) { + $ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#9 +if (arr[1] !== -1) { + $ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); arr[1] === -1. Actual: ' + (arr[1])); +} + +//CHECK#10 +if (x.length !== 1) { + $ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#11 +if (x[0] !== 0) { + $ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#12 +if (x[1] !== -1) { + $ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1); x[1] === -1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T2.js new file mode 100644 index 000000000..dd6a814bd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T2.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A4_T2; + * @section: 15.4.4.12, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [0,1]; +var arr = x.splice(1,1,2); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== 1) { + $ERROR('#2: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#3 +if (arr[1] !== -1) { + $ERROR('#3: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1])); +} + +//CHECK#4 +if (x.length !== 2) { + $ERROR('#4: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== 0) { + $ERROR('#5: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 2) { + $ERROR('#6: Array.prototype[1] = -1; x = [0,1]; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1])); +} + + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.splice = Array.prototype.splice; +x = {0:0, 1:1}; +var arr = x.splice(1,1,2); + +//CHECK#7 +if (arr.length !== 1) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#8 +if (arr[0] !== 1) { + $ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[0] === 1. Actual: ' + (arr[0])); +} + +//CHECK#9 +if (arr[1] !== -1) { + $ERROR('#9: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); arr[1] === -1. Actual: ' + (arr[1])); +} + +//CHECK#10 +if (x.length !== 2) { + $ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#11 +if (x[0] !== 0) { + $ERROR('#11: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#12 +if (x[1] !== 2) { + $ERROR('#12: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.splice = Array.prototype.splice; x = {0:0, 1:1}; var arr = x.splice(1,1,2); x[1] === 2. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T3.js new file mode 100644 index 000000000..aa1dd3cb2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A4_T3.js @@ -0,0 +1,74 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.12_A4_T3; + * @section: 15.4.4.12, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[0] = -1; +var x = []; +x.length = 1; +var arr = x.splice(0,1); + +//CHECK#1 +if (arr.length !== 1) { + $ERROR('#1: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#2 +if (arr[0] !== -1) { + $ERROR('#2: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0])); +} + +delete arr[0]; + +//CHECK#3 +if (arr[0] !== -1) { + $ERROR('#3: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0])); +} + +//CHECK#4 +if (x.length !== 0) { + $ERROR('#4: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#5 +if (x[0] !== -1) { + $ERROR('#5: Array.prototype[0] = -1; x = []; x.length = 1; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0])); +} + +Object.prototype[0] = -1; +Object.prototype.length = 1; +Object.prototype.splice = Array.prototype.splice; +x = {}; +var arr = x.splice(0,1); + +//CHECK#6 +if (arr.length !== 1) { + $ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr.length === 1. Actual: ' + (arr.length)); +} + +//CHECK#7 +if (arr[0] !== -1) { + $ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); arr[0] === -1. Actual: ' + (arr[0])); +} + +delete arr[0]; + +//CHECK#8 +if (arr[0] !== -1) { + $ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); delete arr[0]; arr[0] === -1. Actual: ' + (arr[0])); +} + +//CHECK#9 +if (x.length !== 0) { + $ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#10 +if (x[0] !== -1) { + $ERROR('#10: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.splice = Array.prototype.splice; x = {}; var arr = x.splice(0,1); x[0] === -1. Actual: ' + (x[0])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.1.js new file mode 100644 index 000000000..9705624ea --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.1; +* @section: 15.4.4.12, 15.2.4.7, 12.6.4; +* @assertion: The length property of splice has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.splice.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.splice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.splice.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.splice){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.splice) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.2.js new file mode 100644 index 000000000..952eb2354 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.2; +* @section: 15.4.4.12, 15.2.4.5, 11.4.1; +* @assertion: The length property of splice has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.splice.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.splice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); +} + +delete Array.prototype.splice.length; + +//CHECK#2 +if (Array.prototype.splice.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.splice.length; Array.prototype.splice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.splice.length === undefined) { + $ERROR('#3: delete Array.prototype.splice.length; Array.prototype.splice.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.3.js new file mode 100644 index 000000000..2e42e6454 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.3; +* @section: 15.4.4.12; +* @assertion: The length property of splice has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.splice.length; +Array.prototype.splice.length = Infinity; +if (Array.prototype.splice.length !== x) { + $ERROR('#1: x = Array.prototype.splice.length; Array.prototype.splice.length = Infinity; Array.prototype.splice.length === x. Actual: ' + (Array.prototype.splice.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.4.js new file mode 100644 index 000000000..17db862fa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.4; +* @section: 15.4.4.12; +* @assertion: The length property of splice is 2; +* @description: splice.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.splice.length !== 2) { + $ERROR('#1: Array.prototype.splice.length === 2. Actual: ' + (Array.prototype.splice.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.5.js new file mode 100644 index 000000000..43e473cbf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.5; +* @section: 15.4.4.12, 15.2.4.7, 12.6.4; +* @assertion: The splice property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('splice') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'splice\') === false. Actual: ' + (Array.propertyIsEnumerable('splice'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "splice") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "splice") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.6.js new file mode 100644 index 000000000..9b4aef82d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.6; +* @section: 15.4.4.12; +* @assertion: The splice property of Array has not prototype property; +* @description: Checking Array.prototype.splice.prototype; +*/ + +//CHECK#1 +if (Array.prototype.splice.prototype !== undefined) { + $ERROR('#1: Array.prototype.splice.prototype === undefined. Actual: ' + (Array.prototype.splice.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.7.js new file mode 100644 index 000000000..26e419e5d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.12_Array_prototype_splice/S15.4.4.12_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.12_A5.7; +* @section: 15.4.4.12, 11.2.2; +* @assertion: The splice property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.splice(); + $ERROR('#1.1: new Array.prototype.splice() throw TypeError. Actual: ' + (new Array.prototype.splice())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.splice() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T1.js new file mode 100644 index 000000000..60d3dc9b3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T1.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A1_T1; + * @section: 15.4.4.13; + * @assertion: The arguments are prepended to the start of the array, such that + * their order within the array is the same as the order in which they appear in + * the argument list; + * @description: Checking case when unsift is given no arguments or one argument; +*/ + +//CHECK#1 +var x = new Array(); +var unshift = x.unshift(1); +if (unshift !== 1) { + $ERROR('#1: x = new Array(); x.unshift(1) === 1. Actual: ' + (unshift)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: x = new Array(); x.unshift(1); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +var unshift = x.unshift(); +if (unshift !== 1) { + $ERROR('#3: x = new Array(); x.unshift(1); x.unshift() === 1. Actual: ' + (unshift)); +} + +//CHECK#4 +if (x[1] !== undefined) { + $ERROR('#4: x = new Array(); x.unshift(1); x.unshift(); x[1] === unedfined. Actual: ' + (x[1])); +} + +//CHECK#5 +var unshift = x.unshift(-1); +if (unshift !== 2) { + $ERROR('#5: x = new Array(); x.unshift(1); x.unshift(); x.unshift(-1) === 2. Actual: ' + (unshift)); +} + +//CHECK#6 +if (x[0] !== -1) { + $ERROR('#6: x = new Array(); x.unshift(1); x.unshift(-1); x[0] === -1. Actual: ' + (x[0])); +} + +//CHECK#7 +if (x[1] !== 1) { + $ERROR('#7: x = new Array(); x.unshift(1); x.unshift(-1); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#8 +if (x.length !== 2) { + $ERROR('#8: x = new Array(); x.unshift(1); x.unshift(); x.unshift(-1); x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T2.js new file mode 100644 index 000000000..05b32b9c3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A1_T2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A1_T2; + * @section: 15.4.4.13; + * @assertion: The arguments are prepended to the start of the array, such that + * their order within the array is the same as the order in which they appear in + * the argument list; + * @description: Checking case when unsift is given many arguments; +*/ + +//CHECK#1 +var x = []; +if (x.length !== 0) { + $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#2 +x[0] = 0; +var unshift = x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); +if (unshift !== 6) { + $ERROR('#2: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (unshift)); +} + +//CHECK#3 +if (x[5] !== 0) { + $ERROR('#3: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[5] === 0. Actual: ' + (x[5])); +} + +//CHECK#4 +if (x[0] !== true) { + $ERROR('#4: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[0] === true. Actual: ' + (x[0])); +} + +//CHECK#5 +if (x[1] !== Number.POSITIVE_INFINITY) { + $ERROR('#5: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === Number.POSITIVE_INFINITY. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x[2] !== "NaN") { + $ERROR('#6: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === "NaN". Actual: ' + (x[2])); +} + +//CHECK#7 +if (x[3] !== "1") { + $ERROR('#7: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[3] === "1". Actual: ' + (x[3])); +} + +//CHECK#8 +if (x[4] !== -1) { + $ERROR('#8: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[4] === -1. Actual: ' + (x[4])); +} + +//CHECK#9 +if (x.length !== 6) { + $ERROR('#9: x = []; x[0] = 0; x.unshift(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x.length === 6. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T1.js new file mode 100644 index 000000000..abb88dba6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T1.js @@ -0,0 +1,67 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A2_T1; + * @section: 15.4.4.13; + * @assertion: The unshift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The arguments are prepended to the start of the array, such that + * their order within the array is the same as the order in which they appear in + * the argument list; +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; + +if (obj.length !== undefined) { + $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); +} else { + //CHECK#1 + var unshift = obj.unshift(-1); + if (unshift !== 1) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift)); + } + //CHECK#2 + if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj.length === 1. Actual: ' + (obj.length)); + } + //CHECK#3 + if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"])); + } +} + +//CHECK#4 +obj.length = undefined; +var unshift = obj.unshift(-4); +if (unshift !== 1) { + $ERROR('#4: var obj = {}; obj.length = undefined; obj.unshift = Array.prototype.unshift; obj.unshift(-4) === 1. Actual: ' + (unshift)); +} + +//CHECK#5 +if (obj.length !== 1) { + $ERROR('#5: var obj = {}; obj.length = undefined; obj.unshift = Array.prototype.unshift; obj.unshift(-4); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#6 +if (obj["0"] !== -4) { + $ERROR('#6: var obj = {}; obj.length = undefined; obj.unshift = Array.prototype.unshift; obj.unshift(-4); obj["0"] === -4. Actual: ' + (obj["0"])); +} + +//CHECK#7 +obj.length = null +var unshift = obj.unshift(-7); +if (unshift !== 1) { + $ERROR('#7: var obj = {}; obj.length = null; obj.unshift = Array.prototype.unshift; obj.unshift(-7) === 1. Actual: ' + (unshift)); +} + +//CHECK#8 +if (obj.length !== 1) { + $ERROR('#8: var obj = {}; obj.length = null; obj.unshift = Array.prototype.unshift; obj.unshift(-7); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#9 +if (obj["0"] !== -7) { + $ERROR('#9: var obj = {}; obj.length = null; obj.unshift = Array.prototype.unshift; obj.unshift(-7); obj["0"] === -7. Actual: ' + (obj["0"])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T2.js new file mode 100644 index 000000000..5c6fa0ccb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T2.js @@ -0,0 +1,117 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A2_T2; + * @section: 15.4.4.13; + * @assertion: The unshift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The arguments are prepended to the start of the array, such that + * their order within the array is the same as the order in which they appear in + * the argument list; +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; + +//CHECK#1 +obj.length = NaN; +var unshift = obj.unshift(-1); +if (unshift !== 1) { + $ERROR('#1: var obj = {}; obj.length = NaN; obj.unshift = Array.prototype.unshift; obj.unshift(-1) === 1. Actual: ' + (unshift)); +} + +//CHECK#2 +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.length = NaN; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.length = NaN; obj.unshift = Array.prototype.unshift; obj.unshift(-1); obj["0"] === -1. Actual: ' + (obj["0"])); +} + +//CHECK#4 +obj.length = Number.POSITIVE_INFINITY; +var unshift = obj.unshift(-4); +if (unshift !== 1) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-4) === 1. Actual: ' + (unshift)); +} + +//CHECK#5 +if (obj.length !== 1) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-4); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#6 +if (obj["0"] !== -4) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-4); obj["0"] === -4. Actual: ' + (obj["0"])); +} + +//CHECK#7 +obj.length = Number.NEGATIVE_INFINITY; +var unshift = obj.unshift(-7); +if (unshift !== 1) { + $ERROR('#7: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-7) === 1. Actual: ' + (unshift)); +} + +//CHECK#8 +if (obj.length !== 1) { + $ERROR('#8: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-7); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#9 +if (obj["0"] !== -7) { + $ERROR('#9: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.unshift = Array.prototype.unshift; obj.unshift(-7); obj["0"] === -7. Actual: ' + (obj["0"])); +} + +//CHECK#10 +obj.length = 0.5; +var unshift = obj.unshift(-10); +if (unshift !== 1) { + $ERROR('#10: var obj = {}; obj.length = 0.5; obj.unshift = Array.prototype.unshift; obj.unshift(-10) === 1. Actual: ' + (unshift)); +} + +//CHECK#11 +if (obj.length !== 1) { + $ERROR('#11: var obj = {}; obj.length = 0.5; obj.unshift = Array.prototype.unshift; obj.unshift(-10); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#12 +if (obj["0"] !== -10) { + $ERROR('#12: var obj = {}; obj.length = 0.5; obj.unshift = Array.prototype.unshift; obj.unshift(-10); obj["0"] === -10. Actual: ' + (obj["0"])); +} + +//CHECK#13 +obj.length = 1.5; +var unshift = obj.unshift(-13); +if (unshift !== 2) { + $ERROR('#13: var obj = {}; obj.length = 1.5; obj.unshift = Array.prototype.unshift; obj.unshift(-13) === 2. Actual: ' + (unshift)); +} + +//CHECK#14 +if (obj.length !== 2) { + $ERROR('#14: var obj = {}; obj.length = 1.5; obj.unshift = Array.prototype.unshift; obj.unshift(-13); obj.length === 2. Actual: ' + (obj.length)); +} + +//CHECK#15 +if (obj["0"] !== -13) { + $ERROR('#15: var obj = {}; obj.length = 1.5; obj.unshift = Array.prototype.unshift; obj.unshift(-13); obj["0"] === -13. Actual: ' + (obj["0"])); +} + +//CHECK#16 +obj.length = new Number(0); +var unshift = obj.unshift(-16); +if (unshift !== 1) { + $ERROR('#16: var obj = {}; obj.length = new Number(0); obj.unshift = Array.prototype.unshift; obj.unshift(-16) === 1. Actual: ' + (unshift)); +} + +//CHECK#17 +if (obj.length !== 1) { + $ERROR('#17: var obj = {}; obj.length = new Number(0); obj.unshift = Array.prototype.unshift; obj.unshift(-16); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#18 +if (obj["0"] !== -16) { + $ERROR('#18: var obj = {}; obj.length = new Number(0); obj.unshift = Array.prototype.unshift; obj.unshift(-16); obj["0"] === -16. Actual: ' + (obj["0"])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T3.js new file mode 100644 index 000000000..02b6b989d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A2_T3.js @@ -0,0 +1,91 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A2_T3; + * @section: 15.4.4.13; + * @assertion: The unshift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Operator use ToNumber from length. + * If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; + +//CHECK#1 +obj.length = {valueOf: function() {return 3}}; +var unshift = obj.unshift(); +if (unshift !== 3) { + $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.unshift() === 3. Actual: ' + (unshift)); +} + +//CHECK#2 +obj.length = {valueOf: function() {return 3}, toString: function() {return 1}}; +var unshift = obj.unshift(); +if (unshift !== 3) { + $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.unshift() === 3. Actual: ' + (unshift)); +} + +//CHECK#3 +obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +var unshift = obj.unshift(); +if (unshift !== 3) { + $ERROR('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.unshift() === 3. Actual: ' + (unshift)); +} + +//CHECK#4 +try { + obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + var unshift = obj.unshift(); + if (unshift !== 3) { + $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() === ",". Actual: ' + (unshift)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() not throw "error"'); + } else { + $ERROR('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.unshift() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +obj.length = {toString: function() {return 1}}; +var unshift = obj.unshift(); +if (unshift !== 1) { + $ERROR('#5: obj.length = {toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); +} + +//CHECK#6 +obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} +var unshift = obj.unshift(); +if (unshift !== 1) { + $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.unshift() === 1. Actual: ' + (unshift)); +} + +//CHECK#7 +try { + + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + var unshift = obj.unshift(); + $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (unshift)); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.unshift() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + var unshift = obj.unshift(); + $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (unshift)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.unshift() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T1.js new file mode 100644 index 000000000..1b38b6af8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T1.js @@ -0,0 +1,54 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A3_T1; + * @section: 15.4.4.13; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; +obj.length = 4294967296; + +//CHECK#1 +var unshift = obj.unshift("x", "y", "z"); +if (unshift !== 3) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift("x", "y", "z") === 3. Actual: ' + (unshift)); +} + +//CHECK#2 +if (obj.length !== 3) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); +} + +var obj = {}; +obj.unshift = Array.prototype.unshift; +obj.length = 4294967296; + +//CHECK#6 +var unshift = obj.unshift(); +if (unshift !== 0) { + $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift() === 0. Actual: ' + (unshift)); +} + +//CHECK#7 +if (obj.length !== 0) { + $ERROR('#7: var obj = {}; obj.unshift = Array.prototype.unshift; obj.length = 4294967296; obj.unshift(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T2.js new file mode 100644 index 000000000..c747947b0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A3_T2; + * @section: 15.4.4.13; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -4294967295; +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; +obj[0] = ""; +obj.length = -4294967295; + +//CHECK#1 +var unshift = obj.unshift("x", "y", "z"); +if (unshift !== 4) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z") === 4. Actual: ' + (unshift)); +} + +//CHECK#2 +if (obj.length !== 4) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj.length === 4. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); +} + +//CHECK#6 +if (obj[3] !== "") { + $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = -4294967295; obj.unshift("x", "y", "z"); obj[3] === "". Actual: ' + (obj[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T3.js new file mode 100644 index 000000000..3bb0058e8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A3_T3.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A3_T3; + * @section: 15.4.4.13; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967297; +*/ + +var obj = {}; +obj.unshift = Array.prototype.unshift; +obj[0] = ""; +obj.length = 4294967297; + +//CHECK#1 +var unshift = obj.unshift("x", "y", "z"); +if (unshift !== 4) { + $ERROR('#1: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z") === 4. Actual: ' + (unshift)); +} + +//CHECK#2 +if (obj.length !== 4) { + $ERROR('#2: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z"); obj.length === 4. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); +} + +//CHECK#6 +if (obj[3] !== "") { + $ERROR('#6: var obj = {}; obj.unshift = Array.prototype.unshift; obj[0] = ""; obj.length = 4294967297; obj.unshift("x", "y", "z"); obj[3] === "". Actual: ' + (obj[3])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T1.js new file mode 100644 index 000000000..a8b869395 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T1.js @@ -0,0 +1,75 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A4_T1; + * @section: 15.4.4.13, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[0] = -1; +x = [1]; +x.length = 1; + +//CHECK#1 +var unshift = x.unshift(0); +if (unshift !== 2) { + $ERROR('#1: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift)); +} + +//CHECK#2 +if (x[0] !== 0) { + $ERROR('#2: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== 1) { + $ERROR('#3: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); +} + +delete x[0]; + +//CHECK#4 +if (x[0] !== -1) { + $ERROR('#4: Array.prototype[0] = -1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0])); +} + +Object.prototype[0] = -1; +Object.prototype.length = 1; +Object.prototype.unshift = Array.prototype.unshift; +x = {0:1}; + +//CHECK#5 +var unshift = x.unshift(0); +if (unshift !== 2) { + $ERROR('#5: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0) === 2. Actual: ' + (unshift)); +} + +//CHECK#6 +if (x[0] !== 0) { + $ERROR('#6: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#7 +if (x[1] !== 1) { + $ERROR('#7: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); +} + +delete x[0]; + +//CHECK#8 +if (x[0] !== -1) { + $ERROR('#8: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x[0]; x[0] === -1. Actual: ' + (x[0])); +} + +//CHECK#9 +if (x.length !== 2) { + $ERROR('#9: Object.prototype[0] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#10 +delete x.length; +if (x.length !== 1) { + $ERROR('#10: Object.prototype[1] = -1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {0:0}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T2.js new file mode 100644 index 000000000..7da9941d9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A4_T2.js @@ -0,0 +1,75 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.13_A4_T2; + * @section: 15.4.4.13, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[0] = 1; +var x = []; +x.length = 1; + +//CHECK#1 +var unshift = x.unshift(0); +if (unshift !== 2) { + $ERROR('#1: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0) === 2. Actual: ' + (unshift)); +} + +//CHECK#2 +if (x[0] !== 0) { + $ERROR('#2: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== 1) { + $ERROR('#3: Array.prototype[0] = 1; x = []; x.length = 1; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); +} + +delete x[0]; + +//CHECK#4 +if (x[0] !== 1) { + $ERROR('#4: Array.prototype[0] = 1; x = [1]; x.length = 1; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0])); +} + +Object.prototype[0] = 1; +Object.prototype.length = 1; +Object.prototype.unshift = Array.prototype.unshift; +x = {}; + +//CHECK#5 +var unshift = x.unshift(0); +if (unshift !== 2) { + $ERROR('#5: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0) === 2. Actual: ' + (unshift)); +} + +//CHECK#6 +if (x[0] !== 0) { + $ERROR('#6: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#7 +if (x[1] !== 1) { + $ERROR('#7: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x[1] === 1. Actual: ' + (x[1])); +} + +delete x[0]; + +//CHECK#8 +if (x[0] !== 1) { + $ERROR('#8: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x[0]; x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#9 +if (x.length !== 2) { + $ERROR('#9: Object.prototype[0] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#10 +delete x.length; +if (x.length !== 1) { + $ERROR('#10: Object.prototype[1] = 1; Object.prototype.length = 1; Object.prototype.unshift = Array.prototype.unshift; x = {}; x.unshift(0); delete x; x.length === 1. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.1.js new file mode 100644 index 000000000..28197972b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.1; +* @section: 15.4.4.13, 15.2.4.7, 12.6.4; +* @assertion: The length property of unshift has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.unshift.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.unshift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.unshift.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.unshift){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.unshift) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.2.js new file mode 100644 index 000000000..9eee6322a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.2; +* @section: 15.4.4.13, 15.2.4.5, 11.4.1; +* @assertion: The length property of unshift has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.unshift.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.unshift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); +} + +delete Array.prototype.unshift.length; + +//CHECK#2 +if (Array.prototype.unshift.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.unshift.length; Array.prototype.unshift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.unshift.length === undefined) { + $ERROR('#3: delete Array.prototype.unshift.length; Array.prototype.unshift.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.3.js new file mode 100644 index 000000000..e7ba45c69 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.3; +* @section: 15.4.4.13; +* @assertion: The length property of unshift has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.unshift.length; +Array.prototype.unshift.length = Infinity; +if (Array.prototype.unshift.length !== x) { + $ERROR('#1: x = Array.prototype.unshift.length; Array.prototype.unshift.length = Infinity; Array.prototype.unshift.length === x. Actual: ' + (Array.prototype.unshift.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.4.js new file mode 100644 index 000000000..c12d17fdf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.4; +* @section: 15.4.4.13; +* @assertion: The length property of unshift is 1; +* @description: unshift.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.unshift.length !== 1) { + $ERROR('#1: Array.prototype.unshift.length === 1. Actual: ' + (Array.prototype.unshift.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.5.js new file mode 100644 index 000000000..60faf1371 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.5; +* @section: 15.4.4.13, 15.2.4.7, 12.6.4; +* @assertion: The unshift property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('unshift') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'unshift\') === false. Actual: ' + (Array.propertyIsEnumerable('unshift'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "unshift") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "unshift") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.6.js new file mode 100644 index 000000000..7075afe70 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.6; +* @section: 15.4.4.13; +* @assertion: The unshift property of Array has not prototype property; +* @description: Checking Array.prototype.unshift.prototype; +*/ + +//CHECK#1 +if (Array.prototype.unshift.prototype !== undefined) { + $ERROR('#1: Array.prototype.unshift.prototype === undefined. Actual: ' + (Array.prototype.unshift.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.7.js new file mode 100644 index 000000000..8f66c8e17 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.13_Array_prototype_unshift/S15.4.4.13_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.13_A5.7; +* @section: 15.4.4.13, 11.2.2; +* @assertion: The unshift property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.unshift(); + $ERROR('#1.1: new Array.prototype.unshift() throw TypeError. Actual: ' + (new Array.prototype.unshift())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.unshift() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js new file mode 100644 index 000000000..8497a0cdc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A1.js @@ -0,0 +1,11 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.18_A1; + * @section: 15.4.4.18; + * @assertion: array.forEach can be frozen while in progress + * @description: Freezes array.forEach during a forEach to see if it works +*/ + +['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js new file mode 100644 index 000000000..e22dc1fbf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.18_Array_prototype_forEach/S15.4.4.18_A2.js @@ -0,0 +1,14 @@ +// Copyright 2011 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.18_A2; + * @section: 15.4.4.18; + * @assertion: array.forEach can be frozen while in progress + * @description: Freezes array.forEach during a forEach to see if it works +*/ + +function foo() { + ['z'].forEach(function(){ Object.freeze(Array.prototype.forEach); }); +} +foo(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A1_T1.js new file mode 100644 index 000000000..5c00509a7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A1_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.1_A1_T1; + * @section: 15.4.4.1; + * @assertion: The initial value of Array.prototype.constructor is + * the built-in Array constructor; + * @description: Array.prototype.constructor === Array; +*/ + +//CHECK#1 +if (Array.prototype.constructor !== Array) { + $ERROR('#1: Array.prototype.constructor === Array. Actual: ' + (Array.prototype.constructor)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A2.js new file mode 100644 index 000000000..8f90436d2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.1_Array_prototype_constructor/S15.4.4.1_A2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.1_A2; + * @section: 15.4.4.1, 15.2.4.7, 12.6.4; + * @assertion: The constructor property of Array has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('constructor') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'constructor\') === false. Actual: ' + (Array.propertyIsEnumerable('constructor'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "constructor") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "constructor") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T1.js new file mode 100644 index 000000000..64c982a94 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T1.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A1_T1; + * @section: 15.4.4.2; + * @assertion: The result of calling this function is the same as if + * the built-in join method were invoked for this object with no argument; + * @description: If Result(2) is zero, return the empty string; +*/ + +//CHECK#1 +var x = new Array(); +if (x.toString() !== x.join()) { + $ERROR('#1.1: x = new Array(); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "") { + $ERROR('#1.2: x = new Array(); x.toString() === "". Actual: ' + (x.toString())); + } +} + +//CHECK#2 +x = []; +x[0] = 1; +x.length = 0; +if (x.toString() !== x.join()) { + $ERROR('#2.1: x = []; x[0] = 1; x.length = 0; x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "") { + $ERROR('#2.2: x = []; x[0] = 1; x.length = 0; x.toString() === "". Actual: ' + (x.toString())); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T2.js new file mode 100644 index 000000000..7db166513 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A1_T2; + * @section: 15.4.4.2; + * @assertion: The result of calling this function is the same as if + * the built-in join method were invoked for this object with no argument; + * @description: The elements of the array are converted to strings, and these strings are + * then concatenated, separated by occurrences of the separator. If no separator is provided, + * a single comma is used as the separator; +*/ + +//CHECK#1 +var x = new Array(0,1,2,3); +if (x.toString() !== x.join()) { + $ERROR('#1.1: x = new Array(0,1,2,3); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "0,1,2,3") { + $ERROR('#1.2: x = new Array(0,1,2,3); x.toString() === "0,1,2,3". Actual: ' + (x.toString())); + } +} + +//CHECK#2 +x = []; +x[0] = 0; +x[3] = 3; +if (x.toString() !== x.join()) { + $ERROR('#2.1: x = []; x[0] = 0; x[3] = 3; x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "0,,,3") { + $ERROR('#2.2: x = []; x[0] = 0; x[3] = 3; x.toString() === "0,,,3". Actual: ' + (x.toString())); + } +} + +//CHECK#3 +x = Array(undefined,1,null,3); +if (x.toString() !== x.join()) { + $ERROR('#3.1: x = Array(undefined,1,null,3); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== ",1,,3") { + $ERROR('#3.2: x = Array(undefined,1,null,3); x.toString() === ",1,,3". Actual: ' + (x.toString())); + } +} + +//CHECK#4 +x = []; +x[0] = 0; +if (x.toString() !== x.join()) { + $ERROR('#4.1: x = []; x[0] = 0; x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "0") { + $ERROR('#4.2: x = []; x[0] = 0; x.toString() === "0". Actual: ' + (x.toString())); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T3.js new file mode 100644 index 000000000..2b80d6e5f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T3.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A1_T3; + * @section: 15.4.4.2; + * @assertion: The result of calling this function is the same as if + * the built-in join method were invoked for this object with no argument; + * @description: Operator use ToString from array arguments; +*/ + +//CHECK#0 +var x = new Array("","",""); +if (x.toString() !== x.join()) { + $ERROR('#0.1: var x = new Array("","",""); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== ",,") { + $ERROR('#0.2: var x = new Array("","",""); x.toString() === ",,". Actual: ' + (x.toString())); + } +} + +//CHECK#1 +var x = new Array("\\","\\","\\"); +if (x.toString() !== x.join()) { + $ERROR('#1.1: var x = new Array("\\","\\","\\"); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "\\,\\,\\") { + $ERROR('#1.2: var x = new Array("\\","\\","\\"); x.toString() === "\\,\\,\\". Actual: ' + (x.toString())); + } +} + +//CHECK#2 +var x = new Array("&", "&", "&"); +if (x.toString() !== x.join()) { + $ERROR('#2.1: var x = new Array("&", "&", "&"); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "&,&,&") { + $ERROR('#2.2: var x = new Array("&", "&", "&"); x.toString() === "&,&,&". Actual: ' + (x.toString())); + } +} + +//CHECK#3 +var x = new Array(true,true,true); +if (x.toString() !== x.join()) { + $ERROR('#3.1: var x = new Array(true,true,true); x.toString(true,true,true) === x.join(). Actual: ' + (x.toString(true,true,true))); +} else { + if (x.toString() !== "true,true,true") { + $ERROR('#3.2: var x = new Array(true,true,true); x.toString(true,true,true) === "true,true,true". Actual: ' + (x.toString(true,true,true))); + } +} + +//CHECK#4 +var x = new Array(null,null,null); +if (x.toString() !== x.join()) { + $ERROR('#4.1: var x = new Array(null,null,null); x.toString(null,null,null) === x.join(). Actual: ' + (x.toString(null,null,null))); +} else { + if (x.toString() !== ",,") { + $ERROR('#4.2: var x = new Array(null,null,null); x.toString(null,null,null) === ",,". Actual: ' + (x.toString(null,null,null))); + } +} + +//CHECK#5 +var x = new Array(undefined,undefined,undefined); +if (x.toString() !== x.join()) { + $ERROR('#5.1: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === x.join(). Actual: ' + (x.toString(undefined,undefined,undefined))); +} else { + if (x.toString() !== ",,") { + $ERROR('#5.2: var x = new Array(undefined,undefined,undefined); x.toString(undefined,undefined,undefined) === ",,". Actual: ' + (x.toString(undefined,undefined,undefined))); + } +} + +//CHECK#6 +var x = new Array(Infinity,Infinity,Infinity); +if (x.toString() !== x.join()) { + $ERROR('#6.1: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === x.join(). Actual: ' + (x.toString(Infinity,Infinity,Infinity))); +} else { + if (x.toString() !== "Infinity,Infinity,Infinity") { + $ERROR('#6.2: var x = new Array(Infinity,Infinity,Infinity); x.toString(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.toString(Infinity,Infinity,Infinity))); + } +} + +//CHECK#7 +var x = new Array(NaN,NaN,NaN); +if (x.toString() !== x.join()) { + $ERROR('#7.1: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === x.join(). Actual: ' + (x.toString(NaN,NaN,NaN))); +} else { + if (x.toString() !== "NaN,NaN,NaN") { + $ERROR('#7.2: var x = new Array(NaN,NaN,NaN); x.toString(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.toString(NaN,NaN,NaN))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T4.js new file mode 100644 index 000000000..19407b391 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A1_T4.js @@ -0,0 +1,111 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A1_T4; + * @section: 15.4.4.2; + * @assertion: The result of calling this function is the same as if + * the built-in join method were invoked for this object with no argument; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, String); +*/ + +//CHECK#1 +var object = {valueOf: function() {return "+"}}; +var x = new Array(object); +if (x.toString() !== x.join()) { + $ERROR('#1.1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.toString() === x.join(). Actual: ' + (x.toString())); +} else { + if (x.toString() !== "[object Object]") { + $ERROR('#1.2: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.toString() === "[object Object]". Actual: ' + (x.toString())); + } +} + +//CHECK#2 +var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +var x = new Array(object); +if (x.toString() !== x.join()) { + $ERROR('#2.1: var object = {valueOf: function() {return "+"}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); +} else { + if (x.toString() !== "*") { + $ERROR('#2.2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); + } +} + +//CHECK#3 +var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +var x = new Array(object); +if (x.toString() !== x.join()) { + $ERROR('#3.1: var object = {valueOf: function() {return x.join()}, toString: function() {return {}}} var x = new Array(object); x.toString() === "+". Actual: ' + (x.toString())); +} else { + if (x.toString() !== "+") { + $ERROR('#3.2: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.toString() === "+". Actual: ' + (x.toString())); + } +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + var x = new Array(object); + if (x.toString() !== x.join()) { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); + } else { + if (x.toString() !== "*") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); + } + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.toString() not throw "error"'); + } else { + $ERROR('#4.4: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.toString() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return "*"}}; +var x = new Array(object); +if (x.toString() !== x.join()) { + $ERROR('#5.1: var object = {toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); +} else { + if (x.toString() !== "*") { + $ERROR('#5.2: var object = {toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); + } +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +var x = new Array(object); +if (x.toString() !== x.join()) { + $ERROR('#6.1: var object = {valueOf: function() {return {}}, toString: function() {return x.join()}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); +} else { + if (x.toString() !== "*") { + $ERROR('#6.2: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.toString() === "*". Actual: ' + (x.toString())); + } +} + +//CHECK#7 +try { + var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + var x = new Array(object); + x.toString(); + $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.toString() throw "error". Actual: ' + (x.toString())); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.toString() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var x = new Array(object); + x.toString(); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (x.toString())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.toString() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A2_T1.js new file mode 100644 index 000000000..0c0ed9229 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A2_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A2_T1; + * @section: 15.4.4.2; + * @assertion: The toString function is not generic. + * it throws a TypeError exception if its this value is not an Array object; + * @description: {}.toString = Array.prototype.toString; +*/ + +var obj = {}; +obj.toString = Array.prototype.toString; + +//CHECK#1 +try { + obj.toString(); + $ERROR('#1.1: var obj = {}; obj.toString = Array.prototype.toString; obj.toString() throw TypeError. Actual: ' + (obj.toString())); +} catch(e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: var obj = {}; obj.toString = Array.prototype.toString; obj.toString() throw TypeError. Actual: ' + (e)); + } +} + +obj[0] = 1; +obj.length = 1; + +//CHECK#2 +try { + obj.toString(); + $ERROR('#2.1: var obj = {}; obj.toString = Array.prototype.toString; obj[0] = 1; obj.length = 1; obj.toString() throw TypeError. Actual: ' + (obj.toString())); +} catch(e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var obj = {}; obj.toString = Array.prototype.toString; obj[0] = 1; obj.length = 1; obj.toString() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A3_T1.js new file mode 100644 index 000000000..eb1e9c15f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A3_T1.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.2_A3_T1; + * @section: 15.4.4.2, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype; +*/ + +//CHECK#1 +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; +if (x.toString() !== "0,1") { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.toString() === "0,1". Actual: ' + (x.toString())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.1.js new file mode 100644 index 000000000..d38236622 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.1; +* @section: 15.4.4.2, 15.2.4.7, 12.6.4; +* @assertion: The length property of toString has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.toString.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.toString.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.toString.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.toString){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.toString) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.2.js new file mode 100644 index 000000000..7ef56bba2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.2; +* @section: 15.4.4.2, 15.2.4.5, 11.4.1; +* @assertion: The length property of toString has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.toString.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.toString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toString.hasOwnProperty('length'))); +} + +delete Array.prototype.toString.length; + +//CHECK#2 +if (Array.prototype.toString.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.toString.length; Array.prototype.toString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toString.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.toString.length === undefined) { + $ERROR('#3: delete Array.prototype.toString.length; Array.prototype.toString.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.3.js new file mode 100644 index 000000000..5e9fe9024 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.3; +* @section: 15.4.4.2; +* @assertion: The length property of toString has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.toString.length; +Array.prototype.toString.length = Infinity; +if (Array.prototype.toString.length !== x) { + $ERROR('#1: x = Array.prototype.toString.length; Array.prototype.toString.length = Infinity; Array.prototype.toString.length === x. Actual: ' + (Array.prototype.toString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.4.js new file mode 100644 index 000000000..b71982e5f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.4; +* @section: 15.4.4.2; +* @assertion: The length property of toString is 0; +* @description: toString.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.toString.length !== 0) { + $ERROR('#1: Array.prototype.toString.length === 0. Actual: ' + (Array.prototype.toString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.5.js new file mode 100644 index 000000000..53d314a85 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.5; +* @section: 15.4.4.2, 15.2.4.7, 12.6.4; +* @assertion: The toString property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('toString') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'toString\') === false. Actual: ' + (Array.propertyIsEnumerable('toString'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "toString") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "toString") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.6.js new file mode 100644 index 000000000..2db972559 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.6; +* @section: 15.4.4.2; +* @assertion: The toString property of Array has not prototype property; +* @description: Checking Array.prototype.toString.prototype; +*/ + +//CHECK#1 +if (Array.prototype.toString.prototype !== undefined) { + $ERROR('#1: Array.prototype.toString.prototype === undefined. Actual: ' + (Array.prototype.toString.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.7.js new file mode 100644 index 000000000..77a13cf02 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.2_Array_prototype_toString/S15.4.4.2_A4.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.2_A4.7; +* @section: 15.4.4.2, 11.2.2; +* @assertion: The toString property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.toString(); + $ERROR('#1.1: new Array.prototype.toString() throw TypeError. Actual: ' + (new Array.prototype.toString())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.toString() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A1_T1.js new file mode 100644 index 000000000..0b801aae3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A1_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.3_A1_T1; + * @section: 15.4.4.3; + * @assertion: The elements of the array are converted to strings using their + * toLocaleString methods, and these strings are then concatenated, separated + * by occurrences of a separator string that has been derived in an + * implementation-defined locale-specific way; + * @description: it is the function that should be invoked; +*/ + +var n = 0; +var obj = {toLocaleString: function() {n++}}; +var arr = [undefined, obj, null, obj, obj]; +arr.toLocaleString(); + +//CHECK#1 +if (n !== 3) { + $ERROR('#1: var n = 0; var obj = {toLocaleString: function() {n++}}; var arr = [undefined, obj, null, obj, obj]; arr.toLocaleString(); n === 3. Actual: ' + (n)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A2_T1.js new file mode 100644 index 000000000..7891e118e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A2_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.3_A2_T1; + * @section: 15.4.4.3; + * @assertion: The toLocalString function is not generic. + * it throws a TypeError exception if its this value is not an Array object; + * @description: {}.toLocaleString = Array.prototype.toLocaleString; +*/ + +var obj = {}; +obj.toLocaleString = Array.prototype.toLocaleString; + +//CHECK#1 +try { + obj.toLocaleString(); + $ERROR('#1.1: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj.toLocaleString() throw TypeError. Actual: ' + (obj.toLocaleString())); +} catch(e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj.toLocaleString() throw TypeError. Actual: ' + (e)); + } +} + +obj[0] = 1; +obj.length = 1; + +//CHECK#2 +try { + obj.toLocaleString(); + $ERROR('#2.1: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj[0] = 1; obj.length = 1; obj.toLocaleString() throw TypeError. Actual: ' + (obj.toLocaleString())); +} catch(e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var obj = {}; obj.toLocaleString = Array.prototype.toLocaleString; obj[0] = 1; obj.length = 1; obj.toLocaleString() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A3_T1.js new file mode 100644 index 000000000..24044287b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A3_T1.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.3_A3_T1; + * @section: 15.4.4.3, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype; +*/ + +//CHECK#1 +var n = 0; +var obj = {toLocaleString: function() {n++}}; +Array.prototype[1] = obj; +var x = [obj]; +x.length = 2; +x.toLocaleString(); +if (n !== 2) { + $ERROR('#1: var n = 0; var obj = {toLocaleString: function() {n++}}; Array.prototype[1] = obj; x = [obj]; x.length = 2; x.toLocaleString(); n === 2. Actual: ' + (n)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.1.js new file mode 100644 index 000000000..875cd9a5c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.1; +* @section: 15.4.4.3, 15.2.4.7, 12.6.4; +* @assertion: The length property of toLocaleString has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.toLocaleString.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.toLocaleString.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.toLocaleString.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.toLocaleString){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.toLocaleString) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.2.js new file mode 100644 index 000000000..3be6927d9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.2; +* @section: 15.4.4.3, 15.2.4.5, 11.4.1; +* @assertion: The length property of toLocaleString has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +*/ + +//CHECK#1 +if (Array.prototype.toLocaleString.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.toLocaleString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); +} + +delete Array.prototype.toLocaleString.length; + +//CHECK#2 +if (Array.prototype.toLocaleString.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.toLocaleString.length === undefined) { + $ERROR('#3: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.3.js new file mode 100644 index 000000000..c770101fa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.3; +* @section: 15.4.4.3; +* @assertion: The length property of toLocaleString has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.toLocaleString.length; +Array.prototype.toLocaleString.length = Infinity; +if (Array.prototype.toLocaleString.length !== x) { + $ERROR('#1: x = Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length = Infinity; Array.prototype.toLocaleString.length === x. Actual: ' + (Array.prototype.toLocaleString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.4.js new file mode 100644 index 000000000..167ce3aed --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.4; +* @section: 15.4.4.3; +* @assertion: The length property of toLocaleString is 0; +* @description: toLocaleString.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.toLocaleString.length !== 0) { + $ERROR('#1: Array.prototype.toLocaleString.length === 0. Actual: ' + (Array.prototype.toLocaleString.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.5.js new file mode 100644 index 000000000..6ee30e468 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.5; +* @section: 15.4.4.3, 15.2.4.7, 12.6.4; +* @assertion: The toLocaleString property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('toLocaleString') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'toLocaleString\') === false. Actual: ' + (Array.propertyIsEnumerable('toLocaleString'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "toLocaleString") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "toLocaleString") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.6.js new file mode 100644 index 000000000..ef2f4f56f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.6; +* @section: 15.4.4.3; +* @assertion: The toLocaleString property of Array has not prototype property; +* @description: Checking Array.prototype.toLocaleString.prototype; +*/ + +//CHECK#1 +if (Array.prototype.toLocaleString.prototype !== undefined) { + $ERROR('#1: Array.prototype.toLocaleString.prototype === undefined. Actual: ' + (Array.prototype.toLocaleString.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.7.js new file mode 100644 index 000000000..a2f2ba163 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.3_Array_prototype_toLocaleString/S15.4.4.3_A4.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.3_A4.7; +* @section: 15.4.4.3, 11.2.2; +* @assertion: The toLocaleString property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.toLocaleString(); + $ERROR('#1.1: new Array.prototype.toLocaleString() throw TypeError. Actual: ' + (new Array.prototype.toLocaleString())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.toLocaleString() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T1.js new file mode 100644 index 000000000..8457f0ae1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T1.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A1_T1; + * @section: 15.4.4.4; + * @assertion: When the concat method is called with zero or more arguments item1, item2, + * etc., it returns an array containing the array elements of the object followed by + * the array elements of each argument in order; + * @description: Checking this algorithm, items are Array object; +*/ + +var x = new Array(); +var y = new Array(0,1); +var z = new Array(2,3,4); +var arr = x.concat(y,z); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== 0) { + $ERROR('#1: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== 1) { + $ERROR('#2: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr[2] !== 2) { + $ERROR('#3: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[2] === 2. Actual: ' + (arr[2])); +} + +//CHECK#4 +if (arr[3] !== 3) { + $ERROR('#4: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[3] === 3. Actual: ' + (arr[3])); +} + +//CHECK#5 +if (arr[4] !== 4) { + $ERROR('#5: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr[4] === 4. Actual: ' + (arr[4])); +} + +//CHECK#6 +if (arr.length !== 5) { + $ERROR('#6: var x = new Array(); var y = new Array(0,1); var z = new Array(2,3,4); var arr = x.concat(y,z); arr.length === 5. Actual: ' + (arr.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T2.js new file mode 100644 index 000000000..c5bd24f46 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T2.js @@ -0,0 +1,62 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A1_T2; + * @section: 15.4.4.4; + * @assertion: When the concat method is called with zero or more arguments item1, item2, + * etc., it returns an array containing the array elements of the object followed by + * the array elements of each argument in order; + * @description: Checking this algorithm, items are objects and primitives; +*/ + +var x = [0]; +var y = new Object(); +var z = new Array(1,2); +var arr = x.concat(y,z, -1, true, "NaN"); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== 0) { + $ERROR('#1: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== y) { + $ERROR('#2: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr[2] !== 1) { + $ERROR('#3: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2])); +} + +//CHECK#4 +if (arr[3] !== 2) { + $ERROR('#4: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3])); +} + +//CHECK#5 +if (arr[4] !== -1) { + $ERROR('#5: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4])); +} + +//CHECK#6 +if (arr[5] !== true) { + $ERROR('#6: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5])); +} + +//CHECK#7 +if (arr[6] !== "NaN") { + $ERROR('#7: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6])); +} + +//CHECK#8 +if (arr.length !== 7) { + $ERROR('#8: var x = [0]; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T3.js new file mode 100644 index 000000000..05a361e3b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T3.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A1_T3; + * @section: 15.4.4.4; + * @assertion: When the concat method is called with zero or more arguments item1, item2, + * etc., it returns an array containing the array elements of the object followed by + * the array elements of each argument in order; + * @description: Checking this algorithm with no items; +*/ + +var x = [0,1]; +var arr = x.concat(); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [0,1]; var arr = x.concat(); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== 0) { + $ERROR('#1: var x = [0,1]; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== 1) { + $ERROR('#2: var x = [0,1]; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr.length !== 2) { + $ERROR('#3: var x = [0,1]; var arr = x.concat(); arr.length === 2. Actual: ' + (arr.length)); +} + +//CHECK#4 +if (arr === x) { + $ERROR('#4: var x = [0,1]; var arr = x.concat(); arr !== x'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T4.js new file mode 100644 index 000000000..d1c66a61d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A1_T4.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A1_T4; + * @section: 15.4.4.4; + * @assertion: When the concat method is called with zero or more arguments item1, item2, + * etc., it returns an array containing the array elements of the object followed by + * the array elements of each argument in order; + * @description: Checking this algorithm, items are [], [,]; +*/ + +var x = [,1]; +var arr = x.concat([], [,]); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = [,1]; var arr = x.concat([], [,]); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== undefined) { + $ERROR('#1: var x = [,1]; var arr = x.concat([], [,]); arr[0] === undefined. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== 1) { + $ERROR('#2: var x = [,1]; var arr = x.concat([], [,]); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#2 +if (arr[2] !== undefined) { + $ERROR('#2: var x = [,1]; var arr = x.concat([], [,]); arr[2] === undefined. Actual: ' + (arr[2])); +} + +//CHECK#4 +if (arr.length !== 3) { + $ERROR('#4: var x = [,1]; var arr = x.concat([], [,]); arr.length === 3. Actual: ' + (arr.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T1.js new file mode 100644 index 000000000..e951ab8e5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T1.js @@ -0,0 +1,62 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A2_T1; + * @section: 15.4.4.4; + * @assertion: The concat function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Checking this for Object object, items are objects and primitives; +*/ + +var x = {}; +x.concat = Array.prototype.concat; +var y = new Object(); +var z = new Array(1,2); +var arr = x.concat(y,z, -1, true, "NaN"); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== x) { + $ERROR('#1: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[0] === x. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== y) { + $ERROR('#2: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[1] === y. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr[2] !== 1) { + $ERROR('#3: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[2] === 1. Actual: ' + (arr[2])); +} + +//CHECK#4 +if (arr[3] !== 2) { + $ERROR('#4: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[3] === 2. Actual: ' + (arr[3])); +} + +//CHECK#5 +if (arr[4] !== -1) { + $ERROR('#5: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[4] === -1. Actual: ' + (arr[4])); +} + +//CHECK#6 +if (arr[5] !== true) { + $ERROR('#6: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[5] === true. Actual: ' + (arr[5])); +} + +//CHECK#7 +if (arr[6] !== "NaN") { + $ERROR('#7: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr[6] === "NaN". Actual: ' + (arr[6])); +} + +//CHECK#8 +if (arr.length !== 7) { + $ERROR('#8: var x = {}; x.concat = Array.prototype.concat; var y = new Object(); var z = new Array(1,2); var arr = x.concat(y,z, -1, true, "NaN"); arr.length === 7. Actual: ' + (arr.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T2.js new file mode 100644 index 000000000..2e382eab7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A2_T2.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A2_T2; + * @section: 15.4.4.4; + * @assertion: The concat function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Checking this for Object object with no items; +*/ + +var x = {}; +x.concat = Array.prototype.concat; +var arr = x.concat(); + +//CHECK#0 +arr.getClass = Object.prototype.toString; +if (arr.getClass() !== "[object " + "Array" + "]") { + $ERROR('#0: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat() arr is Array object. Actual: ' + (arr.getClass())); +} + +//CHECK#1 +if (arr[0] !== x) { + $ERROR('#1: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr.length !== 1) { + $ERROR('#2: var x = {}; x.concat = Array.prototype.concat; var arr = x.concat(); arr.length === 1. Actual: ' + (arr.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A3_T1.js new file mode 100644 index 000000000..23e58a0bd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A3_T1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.4_A3_T1; + * @section: 15.4.4.4, 8.6.2.1, 15.2.4.5; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + + +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; +var arr = x.concat(); + +//CHECK#1 +if (arr[0] !== 0) { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0])); +} + +//CHECK#2 +if (arr[1] !== 1) { + $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#3 +if (arr.hasOwnProperty('1') !== true) { + $ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr.hasOwnProperty(\'1\') === true. Actual: ' + (arr.hasOwnProperty('1'))); +} + +Object.prototype[1] = 1; +Object.prototype.length = 2; +Object.prototype.concat = Array.prototype.concat; +x = {0:0}; +var arr = x.concat(); + +//CHECK#4 +if (arr[0] !== x) { + $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[0] === x. Actual: ' + (arr[0])); +} + +//CHECK#5 +if (arr[1] !== 1) { + $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr[1] === 1. Actual: ' + (arr[1])); +} + +//CHECK#6 +if (arr.hasOwnProperty('1') !== false) { + $ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.concat = Array.prototype.concat; x = {0:0}; var arr = x.concat(); arr.hasOwnProperty(\'1\') === false. Actual: ' + (arr.hasOwnProperty('1'))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.1.js new file mode 100644 index 000000000..6d3ca6cc2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.1; +* @section: 15.4.4.4, 15.2.4.7, 12.6.4; +* @assertion: The length property of concat has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.concat.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.concat.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.concat.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.concat){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.concat) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.2.js new file mode 100644 index 000000000..d14785507 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.2; +* @section: 15.4.4.4, 15.2.4.5, 11.4.1; +* @assertion: The length property of concat has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.concat.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.concat.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); +} + +delete Array.prototype.concat.length; + +//CHECK#2 +if (Array.prototype.concat.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.concat.length; Array.prototype.concat.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.concat.length === undefined) { + $ERROR('#3: delete Array.prototype.concat.length; Array.prototype.concat.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.3.js new file mode 100644 index 000000000..07dfbc5c0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.3; +* @section: 15.4.4.4; +* @assertion: The length property of concat has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.concat.length; +Array.prototype.concat.length = Infinity; +if (Array.prototype.concat.length !== x) { + $ERROR('#1: x = Array.prototype.concat.length; Array.prototype.concat.length = Infinity; Array.prototype.concat.length === x. Actual: ' + (Array.prototype.concat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.4.js new file mode 100644 index 000000000..878442ea5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.4; +* @section: 15.4.4.4; +* @assertion: The length property of concat is 1; +* @description: concat.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.concat.length !== 1) { + $ERROR('#1: Array.prototype.concat.length === 1. Actual: ' + (Array.prototype.concat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.5.js new file mode 100644 index 000000000..7d29cb9c0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.5; +* @section: 15.4.4.4, 15.2.4.7, 12.6.4; +* @assertion: The concat property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('concat') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'concat\') === false. Actual: ' + (Array.propertyIsEnumerable('concat'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "concat") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "concat") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.6.js new file mode 100644 index 000000000..222b33b65 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.6; +* @section: 15.4.4.4; +* @assertion: The concat property of Array has not prototype property; +* @description: Checking Array.prototype.concat.prototype; +*/ + +//CHECK#1 +if (Array.prototype.concat.prototype !== undefined) { + $ERROR('#1: Array.prototype.concat.prototype === undefined. Actual: ' + (Array.prototype.concat.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.7.js new file mode 100644 index 000000000..ec2fcdbc8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.4_Array_prototype_concat/S15.4.4.4_A4.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.4_A4.7; +* @section: 15.4.4.4, 11.2.2; +* @assertion: The concat property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.concat(); + $ERROR('#1.1: new Array.prototype.concat() throw TypeError. Actual: ' + (new Array.prototype.concat())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.concat() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.1_T1.js new file mode 100644 index 000000000..7bfda1e59 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.1_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A1.1_T1; + * @section: 15.4.4.5; + * @assertion: If length is zero, return the empty string; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = new Array(); +if (x.join() !== "") { + $ERROR('#1: x = new Array(); x.join() === "". Actual: ' + (x.join())); +} + +//CHECK#2 +x = []; +x[0] = 1; +x.length = 0; +if (x.join() !== "") { + $ERROR('#2: x = []; x[0] = 1; x.length = 0; x.join() === "". Actual: ' + (x.join())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T1.js new file mode 100644 index 000000000..70446bc19 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A1.2_T1; + * @section: 15.4.4.5; + * @assertion: If separator is undefined, a single comma is used as the separator; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = new Array(0,1,2,3); +if (x.join() !== "0,1,2,3") { + $ERROR('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join())); +} + +//CHECK#2 +x = []; +x[0] = 0; +x[3] = 3; +if (x.join() !== "0,,,3") { + $ERROR('#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3". Actual: ' + (x.join())); +} + +//CHECK#3 +x = []; +x[0] = 0; +if (x.join() !== "0") { + $ERROR('#3: x = []; x[0] = 0; x.join() === "0". Actual: ' + (x.join())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T2.js new file mode 100644 index 000000000..cf8963918 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.2_T2.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A1.2_T2; + * @section: 15.4.4.5; + * @assertion: If separator is undefined, a single comma is used as the separator; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = new Array(0,1,2,3); +if (x.join(undefined) !== "0,1,2,3") { + $ERROR('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined))); +} + +//CHECK#2 +x = []; +x[0] = 0; +x[3] = 3; +if (x.join(undefined) !== "0,,,3") { + $ERROR('#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3". Actual: ' + (x.join(undefined))); +} + +//CHECK#3 +x = []; +x[0] = 0; +if (x.join(undefined) !== "0") { + $ERROR('#3: x = []; x[0] = 0; x.join(undefined) === "0". Actual: ' + (x.join(undefined))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.3_T1.js new file mode 100644 index 000000000..1643566db --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A1.3_T1.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A1.3_T1; + * @section: 15.4.4.5; + * @assertion: If array element is undefined or null, use the empty string; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = []; +x[0] = undefined; +if (x.join() !== "") { + $ERROR('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join())); +} + +//CHECK#2 +x = []; +x[0] = null; +if (x.join() !== "") { + $ERROR('#2: x = []; x[0] = null; x.join() === "". Actual: ' + (x.join())); +} + +//CHECK#3 +x = Array(undefined,1,null,3); +if (x.join() !== ",1,,3") { + $ERROR('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T1.js new file mode 100644 index 000000000..f5e3542e7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T1.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A2_T1; + * @section: 15.4.4.5; + * @assertion: The join function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) is zero, return the empty string; +*/ + +var obj = {}; +obj.join = Array.prototype.join; + +if (obj.length !== undefined) { + $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); +} else { + //CHECK#1 + if (obj.join() !== "") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); + } + //CHECK#2 + if (obj.length !== undefined) { + $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length)); + } +} + +//CHECK#3 +obj.length = undefined; +if (obj.join() !== "") { + $ERROR('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join())); +} + +//CHECK#4 +if (obj.length !== undefined) { + $ERROR('#4: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = null +if (obj.join() !== "") { + $ERROR('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#6 +if (obj.length !== null) { + $ERROR('#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.js new file mode 100644 index 000000000..c42d51a97 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.js @@ -0,0 +1,84 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A2_T2; + * @section: 15.4.4.5; + * @assertion: The join function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) is zero, return the empty string; +*/ + +var obj = {}; +obj.join = Array.prototype.join; + +//CHECK#1 +obj.length = NaN; +if (obj.join() !== "") { + $ERROR('#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#2 +if (isNaN(obj.length) !== true) { + $ERROR('#2: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join(); obj.length === Not-a-Number. Actual: ' + (obj.length)); +} + +//CHECK#3 +obj.length = Number.POSITIVE_INFINITY; +if (obj.join() !== "") { + $ERROR('#3: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#4 +if (obj.length !== Number.POSITIVE_INFINITY) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.POSITIVE_INFINITY. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = Number.NEGATIVE_INFINITY; +if (obj.join() !== "") { + $ERROR('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#6 +if (obj.length !== Number.NEGATIVE_INFINITY) { + $ERROR('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.NEGATIVE_INFINITY. Actual: ' + (obj.length)); +} + +//CHECK#7 +obj.length = -0; +if (obj.join() !== "") { + $ERROR('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#8 +if (obj.length !== -0) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length)); +} else { + if (1/obj.length !== Number.NEGATIVE_INFINITY) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === -0. Actual: ' + (obj.length)); + } +} + +//CHECK#9 +obj.length = 0.5; +if (obj.join() !== "") { + $ERROR('#9: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#10 +if (obj.length !== 0.5) { + $ERROR('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length)); +} + +//CHECK#11 +var x = new Number(0); +obj.length = x; +if (obj.join() !== "") { + $ERROR('#11: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join())); +} + +//CHECK#12 +if (obj.length !== x) { + $ERROR('#12: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T3.js new file mode 100644 index 000000000..a530d0752 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T3.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A2_T3; + * @section: 15.4.4.5; + * @assertion: The join function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) is zero, return the empty string; +*/ + +var obj = {}; +obj.join = Array.prototype.join; + +//CHECK#1 +obj.length = 4.5; +if (obj.join() !== ",,,") { + $ERROR('#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join())); +} + +//CHECK#2 +obj[0] = undefined; +obj[1] = 1; +obj[2] = null; +if (obj.join() !== ",1,,") { + $ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join())); +} + +//CHECK#3 +if (obj.length !== 4.5) { + $ERROR('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length)); +} + +var obj = {}; +obj.join = Array.prototype.join; + +//CHECK#4 +var x = new Number(4.5); +obj.length = x; +if (obj.join() !== ",,,") { + $ERROR('#4: var obj = {}; var x = new Number(4.5); obj.length = x; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join())); +} + +//CHECK#5 +obj[0] = undefined; +obj[1] = 1; +obj[2] = null; +if (obj.join() !== ",1,,") { + $ERROR('#5: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join())); +} + +//CHECK#6 +if (obj.length !== x) { + $ERROR('#6: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T4.js new file mode 100644 index 000000000..e724be785 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T4.js @@ -0,0 +1,83 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A2_T4; + * @section: 15.4.4.5; + * @assertion: The join function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Operator use ToNumber from length. + * If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +var obj = {}; +obj.join = Array.prototype.join; + +//CHECK#1 +obj.length = {valueOf: function() {return 3}}; +if (obj.join() !== ",,") { + $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.join() === ",,". Actual: ' + (obj.join())); +} + +//CHECK#2 +obj.length = {valueOf: function() {return 3}, toString: function() {return 2}}; +if (obj.join() !== ",,") { + $ERROR('#2: obj.length = {valueOf: function() {return 3}, toString: function() {return 2}} obj.join() === ",,". Actual: ' + (obj.join())); +} + +//CHECK#3 +obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +if (obj.join() !== ",,") { + $ERROR('#3: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.join() === ",,". Actual: ' + (obj.join())); +} + +//CHECK#4 +try { + obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + if (obj.join() !== ",,") { + $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() === ",". Actual: ' + (obj.join())); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw "error"'); + } else { + $ERROR('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.join() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +obj.length = {toString: function() {return 2}}; +if (obj.join() !== ",") { + $ERROR('#5: obj.length = {toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join())); +} + +//CHECK#6 +obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} +if (obj.join() !== ",") { + $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 2}} obj.join() === ",". Actual: ' + (obj.join())); +} + +//CHECK#7 +try { + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; + obj.join(); + $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (obj.join())); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 2}}; obj.join() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + obj.join(); + $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (obj.join())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8,2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.join() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T1.js new file mode 100644 index 000000000..ad51944a3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A3.1_T1; + * @section: 15.4.4.5; + * @assertion: Operator use ToString from separator; + * @description: Checking separator in ["", "\\", "&", true, Infinity, null, undefind, NaN]; +*/ + +//CHECK#0 +var x = new Array(0,1,2,3); +if (x.join("") !== "0123") { + $ERROR('#0: x = new Array(0,1,2,3); x.join("") === "0123". Actual: ' + (x.join(""))); +} + +//CHECK#1 +x = new Array(0,1,2,3); +if (x.join("\\") !== "0\\1\\2\\3") { + $ERROR('#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3". Actual: ' + (x.join("\\"))); +} + +//CHECK#2 +if (x.join("&") !== "0&1&2&3") { + $ERROR('#2: x = new Array(0,1,2,3); x.join("&") === "0&1&2&3". Actual: ' + (x.join("&"))); +} + +//CHECK#3 +if (x.join(true) !== "0true1true2true3") { + $ERROR('#3: x = new Array(0,1,2,3); x.join(true) === "0true1true2true3". Actual: ' + (x.join(true))); +} + +//CHECK#4 +if (x.join(Infinity) !== "0Infinity1Infinity2Infinity3") { + $ERROR('#4: x = new Array(0,1,2,3); x.join(Infinity) === "0Infinity1Infinity2Infinity3". Actual: ' + (x.join(Infinity))); +} + +//CHECK#5 +if (x.join(null) !== "0null1null2null3") { + $ERROR('#3: 5 = new Array(0,1,2,3); x.join(null) === "0null1null2null3". Actual: ' + (x.join(null))); +} + +//CHECK#6 +if (x.join(undefined) !== "0,1,2,3") { + $ERROR('#6: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined))); +} + +//CHECK#7 +if (x.join(NaN) !== "0NaN1NaN2NaN3") { + $ERROR('#7: x = new Array(0,1,2,3); x.join("NaN") === "0NaN1NaN2NaN3". Actual: ' + (x.join("NaN"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T2.js new file mode 100644 index 000000000..5f9b80677 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.1_T2.js @@ -0,0 +1,79 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A3.1_T2; + * @section: 15.4.4.5; + * @assertion: Operator use ToString from separator; + * @description: If Type(separator) is Object, evaluate ToPrimitive(separator, String); +*/ + +var x = new Array(0,1,2,3); +//CHECK#1 +var object = {valueOf: function() {return "+"}}; +if (x.join(object) !== "0[object Object]1[object Object]2[object Object]3") { + $ERROR('#1: var object = {valueOf: function() {return "+"}}; x.join(object) === "0[object Object]1[object Object]2[object Object]3". Actual: ' + (x.join(object))); +} + +//CHECK#2 +var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +if (x.join(object) !== "0*1*2*3") { + $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); +} + +//CHECK#3 +var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +if (x.join(object) !== "0+1+2+3") { + $ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; x.join(object) === "0+1+2+3". Actual: ' + (x.join(object))); +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + if (x.join(object) !== "0*1*2*3") { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; x.join(object) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return "*"}}; +if (x.join(object) !== "0*1*2*3") { + $ERROR('#5: var object = {toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +if (x.join(object) !== "0*1*2*3") { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}}; x.join(object) === "0*1*2*3". Actual: ' + (x.join(object))); +} + +//CHECK#7 +try { + var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + x.join(object); + $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (x.join(object))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; x.join(object) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + x.join(object); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (x.join(object))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; x.join(object) throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T1.js new file mode 100644 index 000000000..9c1f2f781 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T1.js @@ -0,0 +1,57 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A3.2_T1; + * @section: 15.4.4.5; + * @assertion: Operator use ToString from array arguments; + * @description: Checking arguments and separator in ["", "\\", "&", true, Infinity, null, undefind, NaN]; +*/ + +//CHECK#0 +var x = new Array("","",""); +if (x.join("") !== "") { + $ERROR('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join(""))); +} + +//CHECK#1 +var x = new Array("\\","\\","\\"); +if (x.join("\\") !== "\\\\\\\\\\") { + $ERROR('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\"))); +} + +//CHECK#2 +var x = new Array("&", "&", "&"); +if (x.join("&") !== "&&&&&") { + $ERROR('#2: var x = new Array("&", "&", "&"); x.join("&") === "&&&&&". Actual: ' + (x.join("&"))); +} + +//CHECK#3 +var x = new Array(true,true,true); +if (x.join() !== "true,true,true") { + $ERROR('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true,true,true))); +} + +//CHECK#4 +var x = new Array(null,null,null); +if (x.join() !== ",,") { + $ERROR('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null,null,null))); +} + +//CHECK#5 +var x = new Array(undefined,undefined,undefined); +if (x.join() !== ",,") { + $ERROR('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined,undefined,undefined))); +} + +//CHECK#6 +var x = new Array(Infinity,Infinity,Infinity); +if (x.join() !== "Infinity,Infinity,Infinity") { + $ERROR('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity,Infinity,Infinity))); +} + +//CHECK#7 +var x = new Array(NaN,NaN,NaN); +if (x.join() !== "NaN,NaN,NaN") { + $ERROR('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN,NaN,NaN))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T2.js new file mode 100644 index 000000000..c90db09c4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A3.2_T2.js @@ -0,0 +1,86 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A3.2_T2; + * @section: 15.4.4.5; + * @assertion: Operator use ToString from array arguments; + * @description: If Type(argument) is Object, evaluate ToPrimitive(argument, String); +*/ + +//CHECK#1 +var object = {valueOf: function() {return "+"}}; +var x = new Array(object); +if (x.join() !== "[object Object]") { + $ERROR('#1: var object = {valueOf: function() {return "+"}} var x = new Array(object); x.join() === "[object Object]". Actual: ' + (x.join())); +} + +//CHECK#2 +var object = {valueOf: function() {return "+"}, toString: function() {return "*"}}; +var x = new Array(object); +if (x.join() !== "*") { + $ERROR('#2: var object = {valueOf: function() {return "+"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); +} + +//CHECK#3 +var object = {valueOf: function() {return "+"}, toString: function() {return {}}}; +var x = new Array(object); +if (x.join() !== "+") { + $ERROR('#3: var object = {valueOf: function() {return "+"}, toString: function() {return {}}} var x = new Array(object); x.join() === "+". Actual: ' + (x.join())); +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}}; + var x = new Array(object); + if (x.join() !== "*") { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "*"}} var x = new Array(object); x.join() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return "*"}}; +var x = new Array(object); +if (x.join() !== "*") { + $ERROR('#5: var object = {toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return "*"}} +var x = new Array(object); +if (x.join() !== "*") { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return "*"}} var x = new Array(object); x.join() === "*". Actual: ' + (x.join())); +} + +//CHECK#7 +try { + var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}}; + var x = new Array(object); + x.join(); + $ERROR('#7.1: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (x.join())); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return "+"}, toString: function() {throw "error"}} var x = new Array(object); x.join() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + var x = new Array(object); + x.join(); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (x.join())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}} var x = new Array(object); x.join() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.js new file mode 100644 index 000000000..9113c3fdd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A4_T1; + * @section: 15.4.4.5; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.join = Array.prototype.join; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; + +//CHECK#1 +if (obj.join("") !== "") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.join("") === "". Actual: ' + (obj.join(""))); +} + +//CHECK#2 +if (obj.length !== 4294967296) { + $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.join(""); obj.length === 4294967296. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.js new file mode 100644 index 000000000..314ab20fd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A4_T2; + * @section: 15.4.4.5; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967297; +*/ + +var obj = {}; +obj.join = Array.prototype.join; +obj[0] = "x"; +obj[1] = "y"; +obj[4294967296] = "z"; +obj.length = 4294967297; + +//CHECK#1 +if (obj.join("") !== "x") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.join("") === "x". Actual: ' + (obj.join(""))); +} + +//CHECK#2 +if (obj.length !== 4294967297) { + $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.join(""); obj.length === 4294967297. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.js new file mode 100644 index 000000000..7bef72f9b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A4_T3; + * @section: 15.4.4.5; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -4294967294; +*/ + +var obj = {}; +obj.join = Array.prototype.join; +obj[0] = "x"; +obj[1] = "y"; +obj[2] = "z"; +obj.length = -4294967294; + +//CHECK#1 +if (obj.join("") !== "xy") { + $ERROR('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join("") === "xy". Actual: ' + (obj.join(""))); +} + +//CHECK#2 +if (obj.length !== -4294967294) { + $ERROR('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join(""); obj.length === -4294967294. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A5_T1.js new file mode 100644 index 000000000..71fcaf915 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A5_T1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.5_A5_T1; + * @section: 15.4.4.5, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +//CHECK#1 +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; +if (x.join() !== "0,1") { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join())); +} + +//CHECK#2 +Object.prototype[1] = 1; +Object.prototype.length = 2; +Object.prototype.join = Array.prototype.join; +x = {0:0}; +if (x.join() !== "0,1") { + $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.1.js new file mode 100644 index 000000000..a1f2e4e76 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.1; +* @section: 15.4.4.5, 15.2.4.7, 12.6.4; +* @assertion: The length property of join has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.join.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.join.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.join.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.join){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.join) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.2.js new file mode 100644 index 000000000..68444a0d8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.2; +* @section: 15.4.4.5, 15.2.4.5, 11.4.1; +* @assertion: The length property of join has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.join.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.join.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); +} + +delete Array.prototype.join.length; + +//CHECK#2 +if (Array.prototype.join.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.join.length; Array.prototype.join.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.join.length === undefined) { + $ERROR('#3: delete Array.prototype.join.length; Array.prototype.join.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.3.js new file mode 100644 index 000000000..2b722aff7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.3; +* @section: 15.4.4.5; +* @assertion: The length property of join has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.join.length; +Array.prototype.join.length = Infinity; +if (Array.prototype.join.length !== x) { + $ERROR('#1: x = Array.prototype.join.length; Array.prototype.join.length = Infinity; Array.prototype.join.length === x. Actual: ' + (Array.prototype.join.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.4.js new file mode 100644 index 000000000..6784ef2a8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.4; +* @section: 15.4.4.5; +* @assertion: The length property of join is 1; +* @description: join.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.join.length !== 1) { + $ERROR('#1: Array.prototype.join.length === 1. Actual: ' + (Array.prototype.join.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.5.js new file mode 100644 index 000000000..1a1c38637 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.5; +* @section: 15.4.4.5, 15.2.4.7, 12.6.4; +* @assertion: The join property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('join') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'join\') === false. Actual: ' + (Array.propertyIsEnumerable('join'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "join") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "join") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.6.js new file mode 100644 index 000000000..7c83113be --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.6; +* @section: 15.4.4.5; +* @assertion: The join property of Array has not prototype property; +* @description: Checking Array.prototype.join.prototype; +*/ + +//CHECK#1 +if (Array.prototype.join.prototype !== undefined) { + $ERROR('#1: Array.prototype.join.prototype === undefined. Actual: ' + (Array.prototype.join.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.7.js new file mode 100644 index 000000000..b27ccf0d5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.5_Array_prototype_join/S15.4.4.5_A6.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.5_A6.7; +* @section: 15.4.4.5, 11.2.2; +* @assertion: The join property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.join(); + $ERROR('#1.1: new Array.prototype.join() throw TypeError. Actual: ' + (new Array.prototype.join())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.join() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.1_T1.js new file mode 100644 index 000000000..940d32dc1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A1.1_T1; + * @section: 15.4.4.6; + * @assertion: If length equal zero, call the [[Put]] method of this object + * with arguments "length" and 0 and return undefined; + * @description: Checking this algorithm; +*/ + +//CHECK#1 +var x = new Array(); +var pop = x.pop(); +if (pop !== undefined) { + $ERROR('#1: var x = new Array(); x.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#2 +if (x.length !== 0) { + $ERROR('#2: var x = new Array(); x.pop(); x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#3 +var x = Array(1,2,3); +x.length = 0; +var pop = x.pop(); +if (pop !== undefined) { + $ERROR('#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#4 +if (x.length !== 0) { + $ERROR('#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.2_T1.js new file mode 100644 index 000000000..0f4bf56ed --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A1.2_T1.js @@ -0,0 +1,68 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A1.2_T1; + * @section: 15.4.4.6; + * @assertion: The last element of the array is removed from the array + * and returned; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = new Array(0,1,2,3); +var pop = x.pop(); +if (pop !== 3) { + $ERROR('#1: x = new Array(0,1,2,3); x.pop() === 3. Actual: ' + (pop)); +} + +//CHECK#2 +if (x.length !== 3) { + $ERROR('#2: x = new Array(0,1,2,3); x.pop(); x.length == 3'); +} + +//CHECK#3 +if (x[3] !== undefined) { + $ERROR('#3: x = new Array(0,1,2,3); x.pop(); x[3] == undefined'); +} + +//CHECK#4 +if (x[2] !== 2) { + $ERROR('#4: x = new Array(0,1,2,3); x.pop(); x[2] == 2'); +} + +//CHECK#5 +x = []; +x[0] = 0; +x[3] = 3; +var pop = x.pop(); +if (pop !== 3) { + $ERROR('#5: x = []; x[0] = 0; x[3] = 3; x.pop() === 3. Actual: ' + (pop)); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length == 3'); +} + +//CHECK#7 +if (x[3] !== undefined) { + $ERROR('#7: x = []; x[0] = 0; x[3] = 3; x.pop(); x[3] == undefined'); +} + +//CHECK#8 +if (x[2] !== undefined) { + $ERROR('#8: x = []; x[0] = 0; x[3] = 3; x.pop(); x[2] == undefined'); +} + +//CHECK#9 +x.length = 1; +var pop = x.pop(); +if (pop !== 0) { + $ERROR('#9: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop() === 0. Actual: ' + (pop)); +} + +//CHECK#10 +if (x.length !== 0) { + $ERROR('#10: x = []; x[0] = 0; x[3] = 3; x.pop(); x.length = 1; x.pop(); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T1.js new file mode 100644 index 000000000..1e4910827 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T1.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A2_T1; + * @section: 15.4.4.6; + * @assertion: The pop function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) equal zero, call the [[Put]] method + * of this object with arguments "length" and 0 and return undefined; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; + +if (obj.length !== undefined) { + $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); +} else { + //CHECK#1 + var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); + } + //CHECK#2 + if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); + } +} + +//CHECK#3 +obj.length = undefined; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#3: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#4 +if (obj.length !== 0) { + $ERROR('#4: var obj = {}; obj.length = undefined; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = null +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#5: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#6 +if (obj.length !== 0) { + $ERROR('#6: var obj = {}; obj.length = null; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T2.js new file mode 100644 index 000000000..d768cd76c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T2.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A2_T2; + * @section: 15.4.4.6; + * @assertion: The pop function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) equal zero, call the [[Put]] method + * of this object with arguments "length" and 0 and return undefined; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; + +//CHECK#1 +obj.length = NaN; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.length = NaN; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +obj.length = Number.POSITIVE_INFINITY; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#3: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#4 +if (obj.length !== 0) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = Number.NEGATIVE_INFINITY; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#6 +if (obj.length !== 0) { + $ERROR('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#7 +obj.length = -0; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#7: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#8 +if (obj.length !== 0) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} else { + if (1/obj.length !== Number.POSITIVE_INFINITY) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.pop = Array.prototype.pop; obj.pop(); obj.length === +0. Actual: ' + (obj.length)); + } +} + +//CHECK#9 +obj.length = 0.5; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#9: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#10 +if (obj.length !== 0) { + $ERROR('#10: var obj = {}; obj.length = 0.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#11 +obj.length = new Number(0); +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#11: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#12 +if (obj.length !== 0) { + $ERROR('#12: var obj = {}; obj.length = new Number(0); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T3.js new file mode 100644 index 000000000..78ce4302e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T3.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A2_T3; + * @section: 15.4.4.6; + * @assertion: The pop function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The last element ToUint32(length) - 1 of the array is removed from the array + * and returned; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; + +//CHECK#1 +obj.length = 2.5; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#2 +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.length = 2.5; obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#3 +obj.length = new Number(2); +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#11: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#3 +if (obj.length !== 1) { + $ERROR('#12: var obj = {}; obj.length = new Number(2); obj.pop = Array.prototype.pop; obj.pop(); obj.length === 1. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T4.js new file mode 100644 index 000000000..a933ba756 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A2_T4.js @@ -0,0 +1,97 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A2_T4; + * @section: 15.4.4.6; + * @assertion: The pop function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Operator use ToNumber from length. + * If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; + +//CHECK#1 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}}; +var pop = obj.pop(); +if (pop !== -1) { + $ERROR('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.pop() === -1. Actual: ' + (pop)); +} + +//CHECK#2 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}, toString: function() {return 0}}; +var pop = obj.pop(); +if (pop !== -1) { + $ERROR('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.pop() === -1. Actual: ' + (pop)); +} + +//CHECK#3 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}, toString: function() {return {}}}; +var pop = obj.pop(); +if (pop !== -1) { + $ERROR('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.pop() === -1. Actual: ' + (pop)); +} + +//CHECK#4 +try { + obj[0] = -1; + obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + var pop = obj.pop(); +if (pop !== -1) { + $ERROR('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() === ",". Actual: ' + (pop)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw "error"'); + } else { + $ERROR('#4.3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.pop() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +obj[0] = -1; +obj.length = {toString: function() {return 0}}; +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#6 +obj[0] = -1; +obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.pop() === undefined. Actual: ' + (pop)); +} + +//CHECK#7 +try { + obj[0] = -1; + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; + var pop = obj.pop(); + $ERROR('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (pop)); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.pop() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + obj[0] = -1; + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + var pop = obj.pop(); + $ERROR('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (pop)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.pop() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T1.js new file mode 100644 index 000000000..a7c1c7d87 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A3_T1; + * @section: 15.4.4.6; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; + +//CHECK#1 +var pop = obj.pop(); +if (pop !== undefined) { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop() === unedfined. Actual: ' + (pop)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.pop(); obj[4294967295] === "y". Actual: ' + (obj[4294967295])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T2.js new file mode 100644 index 000000000..eed98673b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T2.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A3_T2; + * @section: 15.4.4.6; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967297; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; +obj[0] = "x"; +obj[4294967296] = "y"; +obj.length = 4294967297; + +//CHECK#1 +var pop = obj.pop(); +if (pop !== "x") { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop() === "x". Actual: ' + (pop)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== undefined) { + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[0] === undefined. Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[4294967296] !== "y") { + $ERROR('#4: var obj = {}; obj.pop = Array.prototype.pop; obj[0] = "x"; obj[4294967296] = "y"; obj.length = 4294967297; obj.pop(); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T3.js new file mode 100644 index 000000000..3c1d48410 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A3_T3.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A3_T3; + * @section: 15.4.4.6; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -1; +*/ + +var obj = {}; +obj.pop = Array.prototype.pop; +obj[4294967294] = "x"; +obj.length = -1; + +//CHECK#1 +var pop = obj.pop(); +if (pop !== "x") { + $ERROR('#1: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop() === "x". Actual: ' + (pop)); +} + +//CHECK#2 +if (obj.length !== 4294967294) { + $ERROR('#2: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj.length === 4294967294. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[4294967294] !== undefined) { + $ERROR('#3: var obj = {}; obj.pop = Array.prototype.pop; obj[4294967294] = "x"; obj.length = -1; obj.pop(); obj[4294967294] === undefined. Actual: ' + (obj[4294967294])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T1.js new file mode 100644 index 000000000..5755d50e6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A4_T1; + * @section: 15.4.4.6, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; + +//CHECK#1 +var pop = x.pop(); +if (pop !== 1) { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop() === 1. Actual: ' + (pop)); +} + +//CHECK#2 +if (x[1] !== 1) { + $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.pop(); x[1] === 1. Actual: ' + (x[1])); +} + +Object.prototype[1] = 1; +Object.prototype.length = 2; +Object.prototype.pop = Array.prototype.pop; +x = {0:0}; + +//CHECK#3 +var pop = x.pop(); +if (pop !== 1) { + $ERROR('#3: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop() === 1. Actual: ' + (pop)); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +delete x.length; +if (x.length !== 2) { + $ERROR('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T2.js new file mode 100644 index 000000000..ca29cbe82 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A4_T2.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.6_A4_T2; + * @section: 15.4.4.6, 8.6.2.1; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [0,1]; +x.length = 2; + +//CHECK#1 +var pop = x.pop(); +if (pop !== 1) { + $ERROR('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop() === 1. Actual: ' + (pop)); +} + +//CHECK#2 +if (x[1] !== -1) { + $ERROR('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.pop(); x[1] === -1. Actual: ' + (x[1])); +} + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.pop = Array.prototype.pop; +x = {0:0,1:1}; + +//CHECK#3 +var pop = x.pop(); +if (pop !== 1) { + $ERROR('#3: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop() === 1. Actual: ' + (pop)); +} + +//CHECK#4 +if (x[1] !== -1) { + $ERROR('#4: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x[1] === -1. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x.length !== 1) { + $ERROR('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#7 +delete x.length; +if (x.length !== 2) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.pop = Array.prototype.pop; x = {0:0,1:1}; x.pop(); delete x; x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.1.js new file mode 100644 index 000000000..9f9d7bff1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.1; +* @section: 15.4.4.6, 15.2.4.7, 12.6.4; +* @assertion: The length property of pop has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.pop.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.pop.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.pop.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.pop){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.pop) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.2.js new file mode 100644 index 000000000..ec59f2a93 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.2; +* @section: 15.4.4.6, 15.2.4.5, 11.4.1; +* @assertion: The length property of pop has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.pop.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.pop.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); +} + +delete Array.prototype.pop.length; + +//CHECK#2 +if (Array.prototype.pop.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.pop.length; Array.prototype.pop.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.pop.length === undefined) { + $ERROR('#3: delete Array.prototype.pop.length; Array.prototype.pop.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.3.js new file mode 100644 index 000000000..5414a0d82 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.3; +* @section: 15.4.4.6; +* @assertion: The length property of pop has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.pop.length; +Array.prototype.pop.length = Infinity; +if (Array.prototype.pop.length !== x) { + $ERROR('#1: x = Array.prototype.pop.length; Array.prototype.pop.length = Infinity; Array.prototype.pop.length === x. Actual: ' + (Array.prototype.pop.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.4.js new file mode 100644 index 000000000..fd6ba7a0f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.4; +* @section: 15.4.4.6; +* @assertion: The length property of pop is 0; +* @description: pop.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.pop.length !== 0) { + $ERROR('#1: Array.prototype.pop.length === 0. Actual: ' + (Array.prototype.pop.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.5.js new file mode 100644 index 000000000..2604500b3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.5; +* @section: 15.4.4.6, 15.2.4.7, 12.6.4; +* @assertion: The pop property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('pop') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'pop\') === false. Actual: ' + (Array.propertyIsEnumerable('pop'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "pop") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "pop") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.6.js new file mode 100644 index 000000000..e1e256d3c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.6; +* @section: 15.4.4.6; +* @assertion: The pop property of Array has not prototype property; +* @description: Checking Array.prototype.pop.prototype; +*/ + +//CHECK#1 +if (Array.prototype.pop.prototype !== undefined) { + $ERROR('#1: Array.prototype.pop.prototype === undefined. Actual: ' + (Array.prototype.pop.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.7.js new file mode 100644 index 000000000..e811cea9f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.6_Array_prototype_pop/S15.4.4.6_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.6_A5.7; +* @section: 15.4.4.6, 11.2.2; +* @assertion: The pop property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.pop(); + $ERROR('#1.1: new Array.prototype.pop() throw TypeError. Actual: ' + (new Array.prototype.pop())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.pop() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T1.js new file mode 100644 index 000000000..e3d193b89 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T1.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A1_T1; + * @section: 15.4.4.7; + * @assertion: The arguments are appended to the end of the array, in + * the order in which they appear. The new length of the array is returned + * as the result of the call; + * @description: Checking case when push is given no arguments or one argument; +*/ + +//CHECK#1 +var x = new Array(); +var push = x.push(1); +if (push !== 1) { + $ERROR('#1: x = new Array(); x.push(1) === 1. Actual: ' + (push)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: x = new Array(); x.push(1); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +var push = x.push(); +if (push !== 1) { + $ERROR('#3: x = new Array(); x.push(1); x.push() === 1. Actual: ' + (push)); +} + +//CHECK#4 +if (x[1] !== undefined) { + $ERROR('#4: x = new Array(); x.push(1); x.push(); x[1] === unedfined. Actual: ' + (x[1])); +} + +//CHECK#5 +var push = x.push(-1); +if (push !== 2) { + $ERROR('#5: x = new Array(); x.push(1); x.push(); x.push(-1) === 2. Actual: ' + (push)); +} + +//CHECK#6 +if (x[1] !== -1) { + $ERROR('#6: x = new Array(); x.push(1); x.push(-1); x[1] === -1. Actual: ' + (x[1])); +} + +//CHECK#7 +if (x.length !== 2) { + $ERROR('#7: x = new Array(); x.push(1); x.push(); x.push(-1); x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T2.js new file mode 100644 index 000000000..789e8764a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A1_T2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A1_T2; + * @section: 15.4.4.7; + * @assertion: The arguments are appended to the end of the array, in + * the order in which they appear. The new length of the array is returned + * as the result of the call; + * @description: Checking case when push is given many arguments; +*/ + +//CHECK#1 +var x = []; +if (x.length !== 0) { + $ERROR('#1: x = []; x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#2 +x[0] = 0; +var push = x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); +if (push !== 6) { + $ERROR('#2: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1) === 6. Actual: ' + (push)); +} + +//CHECK#3 +if (x[0] !== 0) { + $ERROR('#3: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== true) { + $ERROR('#4: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[1] === true. Actual: ' + (x[1])); +} + +//CHECK#5 +if (x[2] !== Number.POSITIVE_INFINITY) { + $ERROR('#5: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[2] === Number.POSITIVE_INFINITY. Actual: ' + (x[2])); +} + +//CHECK#6 +if (x[3] !== "NaN") { + $ERROR('#6: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[3] === "NaN". Actual: ' + (x[3])); +} + +//CHECK#7 +if (x[4] !== "1") { + $ERROR('#7: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[4] === "1". Actual: ' + (x[4])); +} + +//CHECK#8 +if (x[5] !== -1) { + $ERROR('#8: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x[5] === -1. Actual: ' + (x[5])); +} + +//CHECK#9 +if (x.length !== 6) { + $ERROR('#9: x = []; x[0] = 0; x.push(true, Number.POSITIVE_INFINITY, "NaN", "1", -1); x.length === 6. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T1.js new file mode 100644 index 000000000..f2439230f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T1.js @@ -0,0 +1,67 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A2_T1; + * @section: 15.4.4.7; + * @assertion: The push function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The arguments are appended to the end of the array, in + * the order in which they appear. The new length of the array is returned + * as the result of the call; +*/ + +var obj = {}; +obj.push = Array.prototype.push; + +if (obj.length !== undefined) { + $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); +} else { + //CHECK#1 + var push = obj.push(-1); +if (push !== 1) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push)); + } + //CHECK#2 + if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length)); + } + //CHECK#3 + if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"])); + } +} + +//CHECK#4 +obj.length = undefined; +var push = obj.push(-4); +if (push !== 1) { + $ERROR('#4: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push)); +} + +//CHECK#5 +if (obj.length !== 1) { + $ERROR('#5: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#6 +if (obj["0"] !== -4) { + $ERROR('#6: var obj = {}; obj.length = undefined; obj.push = Array.prototype.push; obj.push(-4); obj["0"] === -4. Actual: ' + (obj["0"])); +} + +//CHECK#7 +obj.length = null +var push = obj.push(-7); +if (push !== 1) { + $ERROR('#7: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push)); +} + +//CHECK#8 +if (obj.length !== 1) { + $ERROR('#8: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#9 +if (obj["0"] !== -7) { + $ERROR('#9: var obj = {}; obj.length = null; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T2.js new file mode 100644 index 000000000..27a08dfeb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T2.js @@ -0,0 +1,117 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A2_T2; + * @section: 15.4.4.7; + * @assertion: The push function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The arguments are appended to the end of the array, in + * the order in which they appear. The new length of the array is returned + * as the result of the call; +*/ + +var obj = {}; +obj.push = Array.prototype.push; + +//CHECK#1 +obj.length = NaN; +var push = obj.push(-1); +if (push !== 1) { + $ERROR('#1: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1) === 1. Actual: ' + (push)); +} + +//CHECK#2 +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj["0"] !== -1) { + $ERROR('#3: var obj = {}; obj.length = NaN; obj.push = Array.prototype.push; obj.push(-1); obj["0"] === -1. Actual: ' + (obj["0"])); +} + +//CHECK#4 +obj.length = Number.POSITIVE_INFINITY; +var push = obj.push(-4); +if (push !== 1) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4) === 1. Actual: ' + (push)); +} + +//CHECK#5 +if (obj.length !== 1) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#6 +if (obj["0"] !== -4) { + $ERROR('#6: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-4); obj["0"] === -4. Actual: ' + (obj["0"])); +} + +//CHECK#7 +obj.length = Number.NEGATIVE_INFINITY; +var push = obj.push(-7); +if (push !== 1) { + $ERROR('#7: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7) === 1. Actual: ' + (push)); +} + +//CHECK#8 +if (obj.length !== 1) { + $ERROR('#8: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#9 +if (obj["0"] !== -7) { + $ERROR('#9: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.push = Array.prototype.push; obj.push(-7); obj["0"] === -7. Actual: ' + (obj["0"])); +} + +//CHECK#10 +obj.length = 0.5; +var push = obj.push(-10); +if (push !== 1) { + $ERROR('#10: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10) === 1. Actual: ' + (push)); +} + +//CHECK#11 +if (obj.length !== 1) { + $ERROR('#11: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#12 +if (obj["0"] !== -10) { + $ERROR('#12: var obj = {}; obj.length = 0.5; obj.push = Array.prototype.push; obj.push(-10); obj["0"] === -10. Actual: ' + (obj["0"])); +} + +//CHECK#13 +obj.length = 1.5; +var push = obj.push(-13); +if (push !== 2) { + $ERROR('#13: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13) === 2. Actual: ' + (push)); +} + +//CHECK#14 +if (obj.length !== 2) { + $ERROR('#14: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj.length === 2. Actual: ' + (obj.length)); +} + +//CHECK#15 +if (obj["1"] !== -13) { + $ERROR('#15: var obj = {}; obj.length = 1.5; obj.push = Array.prototype.push; obj.push(-13); obj["1"] === -13. Actual: ' + (obj["1"])); +} + +//CHECK#16 +obj.length = new Number(0); +var push = obj.push(-16); +if (push !== 1) { + $ERROR('#16: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16) === 1. Actual: ' + (push)); +} + +//CHECK#17 +if (obj.length !== 1) { + $ERROR('#17: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#18 +if (obj["0"] !== -16) { + $ERROR('#18: var obj = {}; obj.length = new Number(0); obj.push = Array.prototype.push; obj.push(-16); obj["0"] === -16. Actual: ' + (obj["0"])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T3.js new file mode 100644 index 000000000..63d330351 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A2_T3.js @@ -0,0 +1,92 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A2_T3; + * @section: 15.4.4.7; + * @assertion: The push function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Operator use ToNumber from length. + * If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +var obj = {}; +obj.push = Array.prototype.push; + +//CHECK#1 +obj.length = {valueOf: function() {return 3}}; +var push = obj.push(); +if (push !== 3) { + $ERROR('#1: obj.length = {valueOf: function() {return 3}} obj.push() === 3. Actual: ' + (push)); +} + +//CHECK#2 +obj.length = {valueOf: function() {return 3}, toString: function() {return 1}}; +var push = obj.push(); +if (push !== 3) { + $ERROR('#0: obj.length = {valueOf: function() {return 3}, toString: function() {return 1}} obj.push() === 3. Actual: ' + (push)); +} + +//CHECK#3 +obj.length = {valueOf: function() {return 3}, toString: function() {return {}}}; +var push = obj.push(); +if (push !== 3) { + $ERROR('#1: obj.length = {valueOf: function() {return 3}, toString: function() {return {}}} obj.push() === 3. Actual: ' + (push)); +} + +//CHECK#4 +try { + + obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; + var push = obj.push(); +if (push !== 3) { + $ERROR('#4.1: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() === ",". Actual: ' + (push)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw "error"'); + } else { + $ERROR('#4.3: obj.length = {valueOf: function() {return 3}, toString: function() {throw "error"}}; obj.push() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +obj.length = {toString: function() {return 1}}; +var push = obj.push(); +if (push !== 1) { + $ERROR('#5: obj.length = {toString: function() {return 1}} obj.push() === 1. Actual: ' + (push)); +} + +//CHECK#6 +obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} +var push = obj.push(); +if (push !== 1) { + $ERROR('#6: obj.length = {valueOf: function() {return {}}, toString: function() {return 1}} obj.push() === 1. Actual: ' + (push)); +} + +//CHECK#7 +try { + + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + var push = obj.push(); + $ERROR('#7.1: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (push)); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: obj.length = {valueOf: function() {throw "error"}, toString: function() {return 1}}; obj.push() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + var push = obj.push(); + $ERROR('#8.1: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (push)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.push() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A3.js new file mode 100644 index 000000000..b8d3b41e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A3.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A3; + * @section: 15.4.4.7; + * @assertion: Check ToUint32(length) for Array object; + * @description: If ToUint32(length) !== length, throw RangeError; +*/ + +var x = []; +x.length = 4294967295; + +//CHECK#1 +var push = x.push(); +if (push !== 4294967295) { + $ERROR('#1: x = []; x.length = 4294967295; x.push() === 4294967295. Actual: ' + (push)); +} + +//CHECK#2 +try { + x.push("x"); + $ERROR('#2.1: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (push)); +} catch(e) { + if ((e instanceof RangeError) !== true) { + $ERROR('#2.2: x = []; x.length = 4294967295; x.push("x") throw RangeError. Actual: ' + (e)); + } +} + +//CHECK#3 +if (x[4294967295] !== "x") { + $ERROR('#3: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x[4294967295] === "x". Actual: ' + (x[4294967295])); +} + +//CHECK#4 +if (x.length !== 4294967295) { + $ERROR('#4: x = []; x.length = 4294967295; try {x.push("x")}catch(e){}; x.length === 4294967295. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T1.js new file mode 100644 index 000000000..a37dcb15e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T1.js @@ -0,0 +1,54 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A4_T1; + * @section: 15.4.4.7; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.push = Array.prototype.push; +obj.length = 4294967296; + +//CHECK#1 +var push = obj.push("x", "y", "z"); +if (push !== 3) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z") === 3. Actual: ' + (push)); +} + +//CHECK#2 +if (obj.length !== 3) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj.length === 3. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[1] === "y". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push("x", "y", "z"); obj[2] === "z". Actual: ' + (obj[2])); +} + +var obj = {}; +obj.push = Array.prototype.push; +obj.length = 4294967296; + +//CHECK#6 +var push = obj.push(); +if (push !== 0) { + $ERROR('#6: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push() === 0. Actual: ' + (push)); +} + +//CHECK#7 +if (obj.length !== 0) { + $ERROR('#7: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967296; obj.push(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T2.js new file mode 100644 index 000000000..819011129 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A4_T2; + * @section: 15.4.4.7; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967295; +*/ + +var obj = {}; +obj.push = Array.prototype.push; +obj.length = 4294967295; + +//CHECK#1 +var push = obj.push("x", "y", "z"); +if (push !== 4294967298) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z") === 4294967298. Actual: ' + (push)); +} + +//CHECK#2 +if (obj.length !== 4294967298) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj.length === 4294967298. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[4294967295] !== "x") { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967295] === "x". Actual: ' + (obj[4294967295])); +} + +//CHECK#4 +if (obj[4294967296] !== "y") { + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); +} + +//CHECK#5 +if (obj[4294967297] !== "z") { + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = 4294967295; obj.push("x", "y", "z"); obj[4294967297] === "z". Actual: ' + (obj[4294967297])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T3.js new file mode 100644 index 000000000..90434088f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A4_T3.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A4_T3; + * @section: 15.4.4.7; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -1; +*/ + +var obj = {}; +obj.push = Array.prototype.push; +obj.length = -1; + +//CHECK#1 +var push = obj.push("x", "y", "z"); +if (push !== 4294967298) { + $ERROR('#1: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z") === 4294967298. Actual: ' + (push)); +} + +//CHECK#2 +if (obj.length !== 4294967298) { + $ERROR('#2: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj.length === 4294967298. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[4294967295] !== "x") { + $ERROR('#3: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967295] === "x". Actual: ' + (obj[4294967295])); +} + +//CHECK#4 +if (obj[4294967296] !== "y") { + $ERROR('#4: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967296] === "y". Actual: ' + (obj[4294967296])); +} + +//CHECK#5 +if (obj[4294967297] !== "z") { + $ERROR('#5: var obj = {}; obj.push = Array.prototype.push; obj.length = -1; obj.push("x", "y", "z"); obj[4294967297] === "z". Actual: ' + (obj[4294967297])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A5_T1.js new file mode 100644 index 000000000..151f32412 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A5_T1.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.7_A5_T1; + * @section: 15.4.4.7, 8.6.2.1; + * @assertion: [[Get]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Object.prototype[1] = -1; +Object.prototype.length = 1; +Object.prototype.push = Array.prototype.push; +var x = {0:0}; + +//CHECK#1 +var push = x.push(1); +if (push !== 2) { + $ERROR('#1: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1) === 2. Actual: ' + (push)); +} + +//CHECK#2 +if (x.length !== 2) { + $ERROR('#2: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x.length === 2. Actual: ' + (x.length)); +} + +//CHECK#3 +if (x[1] !== 1) { + $ERROR('#3: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#4 +delete x[1]; +if (x[1] !== -1) { + $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; x.push(1); delete x[1]; x[1] === -1. Actual: ' + (x[1])); +} + +//CHECK#5 +delete x.length; +if (x.length !== 1) { + $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = -1; Object.prototype.push = Array.prototype.push; x = {0:0}; delete x; x.push(1); x.length === 1. Actual: ' + (x.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.1.js new file mode 100644 index 000000000..35adefe1a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.1; +* @section: 15.4.4.7, 15.2.4.7, 12.6.4; +* @assertion: The length property of push has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.push.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.push.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.push.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.push){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.push) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.2.js new file mode 100644 index 000000000..4cc99826e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.2; +* @section: 15.4.4.7, 15.2.4.5, 11.4.1; +* @assertion: The length property of push has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.push.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.push.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); +} + +delete Array.prototype.push.length; + +//CHECK#2 +if (Array.prototype.push.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.push.length; Array.prototype.push.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.push.length === undefined) { + $ERROR('#3: delete Array.prototype.push.length; Array.prototype.push.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.3.js new file mode 100644 index 000000000..f8f02e34a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.3; +* @section: 15.4.4.7; +* @assertion: The length property of push has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.push.length; +Array.prototype.push.length = Infinity; +if (Array.prototype.push.length !== x) { + $ERROR('#1: x = Array.prototype.push.length; Array.prototype.push.length = Infinity; Array.prototype.push.length === x. Actual: ' + (Array.prototype.push.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.4.js new file mode 100644 index 000000000..efd67c24d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.4; +* @section: 15.4.4.7; +* @assertion: The length property of push is 1; +* @description: push.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.push.length !== 1) { + $ERROR('#1: Array.prototype.push.length === 1. Actual: ' + (Array.prototype.push.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.5.js new file mode 100644 index 000000000..baf0c4b72 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.5; +* @section: 15.4.4.7, 15.2.4.7, 12.6.4; +* @assertion: The push property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('push') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'push\') === false. Actual: ' + (Array.propertyIsEnumerable('push'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "push") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "push") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.6.js new file mode 100644 index 000000000..1158f4072 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.6; +* @section: 15.4.4.7; +* @assertion: The push property of Array has not prototype property; +* @description: Checking Array.prototype.push.prototype; +*/ + +//CHECK#1 +if (Array.prototype.push.prototype !== undefined) { + $ERROR('#1: Array.prototype.push.prototype === undefined. Actual: ' + (Array.prototype.push.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.7.js new file mode 100644 index 000000000..63d9e1a83 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.7_Array_prototype_push/S15.4.4.7_A6.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.7_A6.7; +* @section: 15.4.4.7, 11.2.2; +* @assertion: The push property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.push(); + $ERROR('#1.1: new Array.prototype.push() throw TypeError. Actual: ' + (new Array.prototype.push())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.push() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T1.js new file mode 100644 index 000000000..3dd72a6a5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T1.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A1_T1; + * @section: 15.4.4.8; + * @assertion: The elements of the array are rearranged so as to reverse their order. + * The object is returned as the result of the call; + * @description: Checking case when reverse is given no arguments or one argument; +*/ + +//CHECK#1 +var x = []; +var reverse = x.reverse(); +if (reverse !== x) { + $ERROR('#1: x = []; x.reverse() === x. Actual: ' + (reverse)); +} + +//CHECK#2 +x = []; +x[0] = 1; +var reverse = x.reverse(); +if (reverse !== x) { + $ERROR('#2: x = []; x[0] = 1; x.reverse() === x. Actual: ' + (reverse)); +} + +//CHECK#3 +x = new Array(1,2); +var reverse = x.reverse(); +if (reverse !== x) { + $ERROR('#3: x = new Array(1,2); x.reverse() === x. Actual: ' + (reverse)); +} + +//CHECK#4 +if (x[0] !== 2) { + $ERROR('#4: x = new Array(1,2); x.reverse(); x[0] === 2. Actual: ' + (x[0])); +} + +//CHECK#5 +if (x[1] !== 1) { + $ERROR('#5: x = new Array(1,2); x.reverse(); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#6 +if (x.length !== 2) { + $ERROR('#6: x = new Array(1,2); x.reverse(); x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T2.js new file mode 100644 index 000000000..280ca3038 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A1_T2.js @@ -0,0 +1,127 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A1_T2; + * @section: 15.4.4.8; + * @assertion: The elements of the array are rearranged so as to reverse their order. + * The object is returned as the result of the call; + * @description: Checking this algorithm, elements are objects and primitives; +*/ + +//CHECK#1 +var x = []; +x[0] = true; +x[2] = Infinity; +x[4] = undefined; +x[5] = undefined; +x[8] = "NaN"; +x[9] = "-1"; + +var reverse = x.reverse(); +if (reverse !== x) { + $ERROR('#1: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse() === x. Actual: ' + (reverse)); +} + +//CHECK#2 +if (x[0] !== "-1") { + $ERROR('#2: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[0] === "-1". Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== "NaN") { + $ERROR('#3: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[1] === "NaN". Actual: ' + (x[1])); +} + +//CHECK#4 +if (x[2] !== undefined) { + $ERROR('#4: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); +} + +//CHECK#5 +if (x[3] !== undefined) { + $ERROR('#5: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); +} + +//CHECK#6 +if (x[4] !== undefined) { + $ERROR('#6: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); +} + +//CHECK#7 +if (x[5] !== undefined) { + $ERROR('#7: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); +} + +//CHECK#8 +if (x[6] !== undefined) { + $ERROR('#8: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); +} + +//CHECK#9 +if (x[7] !== Infinity) { + $ERROR('#9: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[7] === Infinity. Actual: ' + (x[7])); +} + +//CHECK#10 +if (x[8] !== undefined) { + $ERROR('#10: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[8] === undefined. Actual: ' + (x[8])); +} + +//CHECK#11 +if (x[9] !== true) { + $ERROR('#11: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x[9] === true. Actual: ' + (x[9])); +} + +x.length = 9; + +var reverse = x.reverse(); +if (reverse !== x) { + $ERROR('#1: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse() === x. Actual: ' + (reverse)); +} + +//CHECK#12 +if (x[0] !== undefined) { + $ERROR('#12: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#13 +if (x[1] !== Infinity) { + $ERROR('#13: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[1] === Infinity. Actual: ' + (x[1])); +} + +//CHECK#14 +if (x[2] !== undefined) { + $ERROR('#14: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[2] === undefined. Actual: ' + (x[2])); +} + +//CHECK#15 +if (x[3] !== undefined) { + $ERROR('#15: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[3] === undefined. Actual: ' + (x[3])); +} + +//CHECK#16 +if (x[4] !== undefined) { + $ERROR('#16: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[4] === undefined. Actual: ' + (x[4])); +} + +//CHECK#17 +if (x[5] !== undefined) { + $ERROR('#17: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[5] === undefined. Actual: ' + (x[5])); +} + +//CHECK#18 +if (x[6] !== undefined) { + $ERROR('#18: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[6] === undefined. Actual: ' + (x[6])); +} + +//CHECK#19 +if (x[7] !== "NaN") { + $ERROR('#19: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[7] === "NaN". Actual: ' + (x[7])); +} + +//CHECK#20 +if (x[8] !== "-1") { + $ERROR('#20: x = []; x[0] = true; x[2] = Infinity; x[4] = undefined; x[5] = undefined; x[8] = "NaN"; x[9] = "-1"; x.reverse(); x.length = 9; x.reverse(); x[8] === "-1". Actual: ' + (x[8])); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T1.js new file mode 100644 index 000000000..19580f77b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T1.js @@ -0,0 +1,129 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A2_T1; + * @section: 15.4.4.8; + * @assertion: The reverse function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Checking this for Object object, elements are objects and primitives, length is integer; +*/ + +//CHECK#1 +var obj = {}; +obj.length = 10; +obj.reverse = Array.prototype.reverse; + +obj[0] = true; +obj[2] = Infinity; +obj[4] = undefined; +obj[5] = undefined; +obj[8] = "NaN"; +obj[9] = "-1"; + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj[0] !== "-1") { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); +} + +//CHECK#3 +if (obj[1] !== "NaN") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); +} + +//CHECK#4 +if (obj[2] !== undefined) { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#5 +if (obj[3] !== undefined) { + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#6 +if (obj[4] !== undefined) { + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#7 +if (obj[5] !== undefined) { + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#8 +if (obj[6] !== undefined) { + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#9 +if (obj[7] !== Infinity) { + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); +} + +//CHECK#10 +if (obj[8] !== undefined) { + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); +} + +//CHECK#11 +if (obj[9] !== true) { + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); +} + +obj.length = 9; + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#12 +if (obj[0] !== undefined) { + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); +} + +//CHECK#13 +if (obj[1] !== Infinity) { + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); +} + +//CHECK#14 +if (obj[2] !== undefined) { + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#15 +if (obj[3] !== undefined) { + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#16 +if (obj[4] !== undefined) { + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#17 +if (obj[5] !== undefined) { + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#18 +if (obj[6] !== undefined) { + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#19 +if (obj[7] !== "NaN") { + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); +} + +//CHECK#20 +if (obj[8] !== "-1") { + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = 9; obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T2.js new file mode 100644 index 000000000..6a11f218b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T2.js @@ -0,0 +1,129 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A2_T2; + * @section: 15.4.4.8; + * @assertion: The reverse function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Checking this for Object object, elements are objects and primitives, length is not integer; +*/ + +//CHECK#1 +var obj = {}; +obj.length = 10.5; +obj.reverse = Array.prototype.reverse; + +obj[0] = true; +obj[2] = Infinity; +obj[4] = undefined; +obj[5] = undefined; +obj[8] = "NaN"; +obj[9] = "-1"; + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj[0] !== "-1") { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); +} + +//CHECK#3 +if (obj[1] !== "NaN") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); +} + +//CHECK#4 +if (obj[2] !== undefined) { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#5 +if (obj[3] !== undefined) { + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#6 +if (obj[4] !== undefined) { + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#7 +if (obj[5] !== undefined) { + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#8 +if (obj[6] !== undefined) { + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#9 +if (obj[7] !== Infinity) { + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); +} + +//CHECK#10 +if (obj[8] !== undefined) { + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); +} + +//CHECK#11 +if (obj[9] !== true) { + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); +} + +obj.length = new Number(9.5); + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#12 +if (obj[0] !== undefined) { + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); +} + +//CHECK#13 +if (obj[1] !== Infinity) { + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); +} + +//CHECK#14 +if (obj[2] !== undefined) { + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#15 +if (obj[3] !== undefined) { + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#16 +if (obj[4] !== undefined) { + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#17 +if (obj[5] !== undefined) { + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#18 +if (obj[6] !== undefined) { + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#19 +if (obj[7] !== "NaN") { + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); +} + +//CHECK#20 +if (obj[8] !== "-1") { + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = 10.5; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new Number(9.5); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T3.js new file mode 100644 index 000000000..1c0c42a88 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A2_T3.js @@ -0,0 +1,129 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A2_T3; + * @section: 15.4.4.8; + * @assertion: The reverse function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Checking this for Object object, elements are objects and primitives, length is string; +*/ + +//CHECK#1 +var obj = {}; +obj.length = "10"; +obj.reverse = Array.prototype.reverse; + +obj[0] = true; +obj[2] = Infinity; +obj[4] = undefined; +obj[5] = undefined; +obj[8] = "NaN"; +obj[9] = "-1"; + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj[0] !== "-1") { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[0] === "-1". Actual: ' + (obj[0])); +} + +//CHECK#3 +if (obj[1] !== "NaN") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[1] === "NaN". Actual: ' + (obj[1])); +} + +//CHECK#4 +if (obj[2] !== undefined) { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#5 +if (obj[3] !== undefined) { + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#6 +if (obj[4] !== undefined) { + $ERROR('#6: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#7 +if (obj[5] !== undefined) { + $ERROR('#7: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#8 +if (obj[6] !== undefined) { + $ERROR('#8: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#9 +if (obj[7] !== Infinity) { + $ERROR('#9: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[7] === Infinity. Actual: ' + (obj[7])); +} + +//CHECK#10 +if (obj[8] !== undefined) { + $ERROR('#10: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[8] === undefined. Actual: ' + (obj[8])); +} + +//CHECK#11 +if (obj[9] !== true) { + $ERROR('#11: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj[9] === true. Actual: ' + (obj[9])); +} + +obj.length = new String("9"); + +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#12 +if (obj[0] !== undefined) { + $ERROR('#12: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[0] === undefined. Actual: ' + (obj[0])); +} + +//CHECK#13 +if (obj[1] !== Infinity) { + $ERROR('#13: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[1] === Infinity. Actual: ' + (obj[1])); +} + +//CHECK#14 +if (obj[2] !== undefined) { + $ERROR('#14: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[2] === undefined. Actual: ' + (obj[2])); +} + +//CHECK#15 +if (obj[3] !== undefined) { + $ERROR('#15: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[3] === undefined. Actual: ' + (obj[3])); +} + +//CHECK#16 +if (obj[4] !== undefined) { + $ERROR('#16: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[4] === undefined. Actual: ' + (obj[4])); +} + +//CHECK#17 +if (obj[5] !== undefined) { + $ERROR('#17: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[5] === undefined. Actual: ' + (obj[5])); +} + +//CHECK#18 +if (obj[6] !== undefined) { + $ERROR('#18: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[6] === undefined. Actual: ' + (obj[6])); +} + +//CHECK#19 +if (obj[7] !== "NaN") { + $ERROR('#19: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[7] === "NaN". Actual: ' + (obj[7])); +} + +//CHECK#20 +if (obj[8] !== "-1") { + $ERROR('#20: var obj = {}; obj.reverse = Array.prototype.reverse; obj.length = "10"; obj[0] = true; obj[2] = Infinity; obj[4] = undefined; obj[5] = undefined; obj[8] = "NaN"; obj[9] = "-1"; obj.reverse(); obj.length = new String("9"); obj.reverse(); obj[8] === "-1". Actual: ' + (obj[8])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T1.js new file mode 100644 index 000000000..c82a39b8e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A3_T1; + * @section: 15.4.4.8; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967296; +*/ + +var obj = {}; +obj.reverse = Array.prototype.reverse; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; + +//CHECK#1 +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj.length !== 4294967296) { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.reverse(); obj.length === 4294967296. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.reverse(); obj[0] == "x"'); +} + +//CHECK#4 +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.reverse(); obj[4294967295] == "y"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T2.js new file mode 100644 index 000000000..15de9074c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T2.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A3_T2; + * @section: 15.4.4.8; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = 4294967298; +*/ + +var obj = {}; +obj.reverse = Array.prototype.reverse; +obj[0] = "x"; +obj[1] = "y"; +obj[4294967297] = "z"; +obj.length = 4294967298; + +//CHECK#1 +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[4294967297] = "z"; obj.length = 4294967298; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj.length !== 4294967298) { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[4294967297] = "z"; obj.length = 4294967298; obj.reverse(); obj.length === 4294967298. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[4294967297] = "z"; obj.length = 4294967298; obj.reverse(); obj[0] === "y". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "x") { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[4294967297] = "z"; obj.length = 4294967298; obj.reverse(); obj[1] === "x". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[4294967297] !== "z") { + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[4294967297] = "z"; obj.length = 4294967298; obj.reverse(); obj[4294967297] === "z". Actual: ' + (obj[4294967297])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T3.js new file mode 100644 index 000000000..0a64da385 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A3_T3.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A3_T3; + * @section: 15.4.4.8; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length = -4294967294; +*/ + +var obj = {}; +obj.reverse = Array.prototype.reverse; +obj[0] = "x"; +obj[1] = "y"; +obj[2] = "z"; +obj.length = -4294967294; + +//CHECK#1 +var reverse = obj.reverse(); +if (reverse !== obj) { + $ERROR('#1: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse() === obj. Actual: ' + (reverse)); +} + +//CHECK#2 +if (obj.length !== -4294967294) { + $ERROR('#2: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj.length === -4294967294. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[0] === "y". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "x") { + $ERROR('#4: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[1] === "x". Actual: ' + (obj[1])); +} + +//CHECK#5 +if (obj[2] !== "z") { + $ERROR('#5: var obj = {}; obj.reverse = Array.prototype.reverse; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.reverse(); obj[2] === "z". Actual: ' + (obj[2])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T1.js new file mode 100644 index 000000000..48ba1fcb1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T1.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A4_T1; + * @section: 15.4.4.8, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; +x.reverse(); + +//CHECK#1 +if (x[0] !== 1) { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#2 +if (x[1] !== 0) { + $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1])); +} + +x.length = 0; + +//CHECK#3 +if (x[0] !== undefined) { + $ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== 1) { + $ERROR('#4: Array.prototype[1] = 1; x = [0]; x.length = 2; x.reverse(); x.length = 0; x[1] === 1. Actual: ' + (x[1])); +} + +Object.prototype[1] = 1; +Object.prototype.length = 2; +Object.prototype.reverse = Array.prototype.reverse; +x = {0:0}; +x.reverse(); + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 0) { + $ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); x[1] === 0. Actual: ' + (x[1])); +} + +delete x[0]; +delete x[1]; + +//CHECK#7 +if (x[0] !== undefined) { + $ERROR('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); delete x[0]; delete x[1]; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== 1) { + $ERROR('#8: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0}; x.reverse(); delete x[0]; delete x[1]; x[1] === 1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T2.js new file mode 100644 index 000000000..6ec192585 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A4_T2.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.8_A4_T2; + * @section: 15.4.4.8, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [0,1]; +x.length = 2; +x.reverse(); + +//CHECK#1 +if (x[0] !== 1) { + $ERROR('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#2 +if (x[1] !== 0) { + $ERROR('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x[1] === 0. Actual: ' + (x[1])); +} + +x.length = 0; + +//CHECK#3 +if (x[0] !== undefined) { + $ERROR('#3: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#4 +if (x[1] !== -1) { + $ERROR('#4: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.reverse(); x.length = 0; x[1] === -1. Actual: ' + (x[1])); +} + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.reverse = Array.prototype.reverse; +x = {0:0,1:1}; +x.reverse(); + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); x[0] === 0. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 0) { + $ERROR('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); x[1] === 0. Actual: ' + (x[1])); +} + +delete x[0]; +delete x[1]; + +//CHECK#7 +if (x[0] !== undefined) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); delete x[0]; delete x[1]; x[0] === undefined. Actual: ' + (x[0])); +} + +//CHECK#8 +if (x[1] !== -1) { + $ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.reverse = Array.prototype.reverse; x = {0:0,1:1}; x.reverse(); delete x[0]; delete x[1]; x[1] === -1. Actual: ' + (x[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.1.js new file mode 100644 index 000000000..3ff2a632b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.1; +* @section: 15.4.4.8, 15.2.4.7, 12.6.4; +* @assertion: The length property of reverse has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.reverse.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.reverse.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.reverse.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (p in Array.reverse){ + if (p === "length") { + var result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.reverse) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.2.js new file mode 100644 index 000000000..658e07c05 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.2; +* @section: 15.4.4.8, 15.2.4.5, 11.4.1; +* @assertion: The length property of reverse has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +* @strict_mode_negative +*/ + +//CHECK#1 +if (Array.prototype.reverse.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.reverse.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); +} + +delete Array.prototype.reverse.length; + +//CHECK#2 +if (Array.prototype.reverse.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.reverse.length; Array.prototype.reverse.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.reverse.length === undefined) { + $ERROR('#3: delete Array.prototype.reverse.length; Array.prototype.reverse.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.3.js new file mode 100644 index 000000000..da611ab8c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.3; +* @section: 15.4.4.8; +* @assertion: The length property of reverse has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.reverse.length; +Array.prototype.reverse.length = Infinity; +if (Array.prototype.reverse.length !== x) { + $ERROR('#1: x = Array.prototype.reverse.length; Array.prototype.reverse.length = Infinity; Array.prototype.reverse.length === x. Actual: ' + (Array.prototype.reverse.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.4.js new file mode 100644 index 000000000..41981d4e4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.4; +* @section: 15.4.4.8; +* @assertion: The length property of reverse is 0; +* @description: reverse.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.reverse.length !== 0) { + $ERROR('#1: Array.prototype.reverse.length === 0. Actual: ' + (Array.prototype.reverse.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.5.js new file mode 100644 index 000000000..8deb3eaec --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.5; +* @section: 15.4.4.8, 15.2.4.7, 12.6.4; +* @assertion: The reverse property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('reverse') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'reverse\') === false. Actual: ' + (Array.propertyIsEnumerable('reverse'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "reverse") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "reverse") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.6.js new file mode 100644 index 000000000..d47587cdd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.6; +* @section: 15.4.4.8; +* @assertion: The reverse property of Array has not prototype property; +* @description: Checking Array.prototype.reverse.prototype; +*/ + +//CHECK#1 +if (Array.prototype.reverse.prototype !== undefined) { + $ERROR('#1: Array.prototype.reverse.prototype === undefined. Actual: ' + (Array.prototype.reverse.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.7.js new file mode 100644 index 000000000..806e0fa18 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.8_Array_prototype_reverse/S15.4.4.8_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.8_A5.7; +* @section: 15.4.4.8, 11.2.2; +* @assertion: The reverse property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.reverse(); + $ERROR('#1.1: new Array.prototype.reverse() throw TypeError. Actual: ' + (new Array.prototype.reverse())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.reverse() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.1_T1.js new file mode 100644 index 000000000..971625e12 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A1.1_T1; + * @section: 15.4.4.9; + * @assertion: If length equal zero, call the [[Put]] method of this object + * with arguments "length" and 0 and return undefined; + * @description: Checking this algorithm; +*/ + +//CHECK#1 +var x = new Array(); +var shift = x.shift(); +if (shift !== undefined) { + $ERROR('#1: var x = new Array(); x.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#2 +if (x.length !== 0) { + $ERROR('#2: var x = new Array(); x.shift(); x.length === 0. Actual: ' + (x.length)); +} + +//CHECK#3 +var x = Array(1,2,3); +x.length = 0; +var shift = x.shift(); +if (shift !== undefined) { + $ERROR('#2: var x = Array(1,2,3); x.length = 0; x.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#4 +if (x.length !== 0) { + $ERROR('#4: var x = new Array(1,2,3); x.length = 0; x.shift(); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.2_T1.js new file mode 100644 index 000000000..66d285bd5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A1.2_T1.js @@ -0,0 +1,68 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A1.2_T1; + * @section: 15.4.4.9; + * @assertion: The first element of the array is removed from the array and + * returned; + * @description: Checking this use new Array() and []; +*/ + +//CHECK#1 +var x = new Array(0,1,2,3); +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#1: x = new Array(0,1,2,3); x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#2 +if (x.length !== 3) { + $ERROR('#2: x = new Array(0,1,2,3); x.shift(); x.length == 3'); +} + +//CHECK#3 +if (x[0] !== 1) { + $ERROR('#3: x = new Array(0,1,2,3); x.shift(); x[0] == 1'); +} + +//CHECK#4 +if (x[1] !== 2) { + $ERROR('#4: x = new Array(0,1,2,3); x.shift(); x[1] == 2'); +} + +//CHECK#5 +x = []; +x[0] = 0; +x[3] = 3; +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#5: x = []; x[0] = 0; x[3] = 3; x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#6 +if (x.length !== 3) { + $ERROR('#6: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length == 3'); +} + +//CHECK#7 +if (x[0] !== undefined) { + $ERROR('#7: x = []; x[0] = 0; x[3] = 3; x.shift(); x[0] == undefined'); +} + +//CHECK#8 +if (x[12] !== undefined) { + $ERROR('#8: x = []; x[0] = 0; x[3] = 3; x.shift(); x[1] == undefined'); +} + +//CHECK#9 +x.length = 1; +var shift = x.shift(); +if (shift !== undefined) { + $ERROR('#9: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length = 1; x.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#10 +if (x.length !== 0) { + $ERROR('#10: x = []; x[0] = 0; x[3] = 3; x.shift(); x.length = 1; x.shift(); x.length === 0. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T1.js new file mode 100644 index 000000000..542806bf5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T1.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A2_T1; + * @section: 15.4.4.9; + * @assertion: The shift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) equal zero, call the [[Put]] method + * of this object with arguments "length" and 0 and return undefined; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; + +if (obj.length !== undefined) { + $ERROR('#0: var obj = {}; obj.length === undefined. Actual: ' + (obj.length)); +} else { + //CHECK#1 + var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); + } + //CHECK#2 + if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); + } +} + +//CHECK#3 +obj.length = undefined; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#3: var obj = {}; obj.length = undefined; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#4 +if (obj.length !== 0) { + $ERROR('#4: var obj = {}; obj.length = undefined; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = null +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#5: var obj = {}; obj.length = null; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#6 +if (obj.length !== 0) { + $ERROR('#6: var obj = {}; obj.length = null; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T2.js new file mode 100644 index 000000000..330929b51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T2.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A2_T2; + * @section: 15.4.4.9; + * @assertion: The shift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: If ToUint32(length) equal zero, call the [[Put]] method + * of this object with arguments "length" and 0 and return undefined; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; + +//CHECK#1 +obj.length = NaN; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#1: var obj = {}; obj.length = NaN; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.length = NaN; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +obj.length = Number.POSITIVE_INFINITY; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#3: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#4 +if (obj.length !== 0) { + $ERROR('#4: var obj = {}; obj.length = Number.POSITIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = Number.NEGATIVE_INFINITY; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#6 +if (obj.length !== 0) { + $ERROR('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#7 +obj.length = -0; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#7: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#8 +if (obj.length !== 0) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} else { + if (1/obj.length !== Number.POSITIVE_INFINITY) { + $ERROR('#8: var obj = {}; obj.length = -0; obj.shift = Array.prototype.shift; obj.shift(); obj.length === +0. Actual: ' + (obj.length)); + } +} + +//CHECK#9 +obj.length = 0.5; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#9: var obj = {}; obj.length = 0.5; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#10 +if (obj.length !== 0) { + $ERROR('#10: var obj = {}; obj.length = 0.5; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#11 +obj.length = new Number(0); +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#11: var obj = {}; obj.length = new Number(0); obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#12 +if (obj.length !== 0) { + $ERROR('#12: var obj = {}; obj.length = new Number(0); obj.shift = Array.prototype.shift; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T3.js new file mode 100644 index 000000000..637e6a167 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T3.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A2_T3; + * @section: 15.4.4.9; + * @assertion: The shift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The first element of the array is removed from the array and + * returned; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; + +//CHECK#1 +obj.length = 2.5; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#1: var obj = {}; obj.length = 2.5; obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.length = 2.5; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#3 +obj.length = new Number(2); +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#11: var obj = {}; obj.length = new Number(2); obj.shift = Array.prototype.shift; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#3 +if (obj.length !== 1) { + $ERROR('#12: var obj = {}; obj.length = new Number(2); obj.shift = Array.prototype.shift; obj.shift(); obj.length === 1. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T4.js new file mode 100644 index 000000000..9b68af688 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T4.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A2_T4; + * @section: 15.4.4.9; + * @assertion: The shift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: The first element of the array is removed from the array and + * returned; +*/ + +var obj = {}; +obj["0"] = 0; +obj["3"] = 3; +obj.shift = Array.prototype.shift; + +//CHECK#1 +obj.length = 4; +var shift = obj.shift(); +if (shift !== 0) { + $ERROR('#1: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 3) { + $ERROR('#2: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.length === 3. Actual: ' + (obj.length)); +} + +//CHECK#3 +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#3: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#4 +if (obj.length !== 2) { + $ERROR('#4: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length === 2. Actual: ' + (obj.length)); +} + +//CHECK#5 +obj.length = 1; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#5: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length = 1; obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#6 +if (obj.length !== 0) { + $ERROR('#6: var obj = {}; obj["0"] = 0; obj["3"] = 3; obj.length = 4; obj.shift = Array.prototype.shift; obj.shift(); obj.shift(); obj.length = 1; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T5.js new file mode 100644 index 000000000..86089f9e9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A2_T5.js @@ -0,0 +1,97 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A2_T5; + * @section: 15.4.4.9; + * @assertion: The shift function is intentionally generic. + * It does not require that its this value be an Array object; + * @description: Operator use ToNumber from length. + * If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; + +//CHECK#1 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}}; +var shift = obj.shift(); +if (shift !== -1) { + $ERROR('#1: obj[0] = -1; obj.length = {valueOf: function() {return 1}} obj.shift() === -1. Actual: ' + (shift)); +} + +//CHECK#2 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}, toString: function() {return 0}}; +var shift = obj.shift(); +if (shift !== -1) { + $ERROR('#0: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return 0}} obj.shift() === -1. Actual: ' + (shift)); +} + +//CHECK#3 +obj[0] = -1; +obj.length = {valueOf: function() {return 1}, toString: function() {return {}}}; +var shift = obj.shift(); +if (shift !== -1) { + $ERROR('#3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {return {}}} obj.shift() === -1. Actual: ' + (shift)); +} + +//CHECK#4 +try { + obj[0] = -1; + obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + var shift = obj.shift(); +if (shift !== -1) { + $ERROR('#4.1: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.shift() === ",". Actual: ' + (shift)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.shift() not throw "error"'); + } else { + $ERROR('#4.3: obj[0] = -1; obj.length = {valueOf: function() {return 1}, toString: function() {throw "error"}}; obj.shift() not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +obj[0] = -1; +obj.length = {toString: function() {return 0}}; +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#5: obj[0] = -1; obj.length = {toString: function() {return 0}} obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#6 +obj[0] = -1; +obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#6: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return 0}} obj.shift() === undefined. Actual: ' + (shift)); +} + +//CHECK#7 +try { + obj[0] = -1; + obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; + var shift = obj.shift(); + $ERROR('#7.1: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.shift() throw "error". Actual: ' + (shift)); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: obj[0] = -1; obj.length = {valueOf: function() {throw "error"}, toString: function() {return 0}}; obj.shift() throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + obj[0] = -1; + obj.length = {valueOf: function() {return {}}, toString: function() {return {}}}; + var shift = obj.shift(); + $ERROR('#8.1: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.shift() throw TypeError. Actual: ' + (shift)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: obj[0] = -1; obj.length = {valueOf: function() {return {}}, toString: function() {return {}}} obj.shift() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T1.js new file mode 100644 index 000000000..bf15b7587 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A3_T1; + * @section: 15.4.4.9; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; +obj[0] = "x"; +obj[4294967295] = "y"; +obj.length = 4294967296; + +//CHECK#1 +var shift = obj.shift(); +if (shift !== undefined) { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.shift() === unedfined. Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "x") { + $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.shift(); obj[0] === "x". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[4294967295] !== "y") { + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[4294967295] = "y"; obj.length = 4294967296; obj.shift(); obj[4294967295] === "y". Actual: ' + (obj[4294967295])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T2.js new file mode 100644 index 000000000..b70ee1eb3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T2.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A3_T2; + * @section: 15.4.4.9; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; +obj[0] = "x"; +obj[1] = "y"; +obj[4294967296] = "z"; +obj.length = 4294967297; + +//CHECK#1 +var shift = obj.shift(); +if (shift !== "x") { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.shift() === "x". Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 0) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.shift(); obj.length === 0. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== undefined) { + $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.shift(); obj[0] === undefined. Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== "y") { + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.shift(); obj[1] === "y". Actual: ' + (obj[1])); +} + +//CHECK#4 +if (obj[4294967296] !== "z") { + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj[4294967296] = "z"; obj.length = 4294967297; obj.shift(); obj[4294967296] === "z". Actual: ' + (obj[4294967296])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T3.js new file mode 100644 index 000000000..3bc3fc23c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A3_T3.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A3_T3; + * @section: 15.4.4.9; + * @assertion: Check ToUint32(length) for non Array objects; + * @description: length is arbitrarily; +*/ + +var obj = {}; +obj.shift = Array.prototype.shift; +obj[0] = "x"; +obj[1] = "y"; +obj.length = -4294967294; + +//CHECK#1 +var shift = obj.shift(); +if (shift !== "x") { + $ERROR('#1: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift() === "x". Actual: ' + (shift)); +} + +//CHECK#2 +if (obj.length !== 1) { + $ERROR('#2: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj.length === 1. Actual: ' + (obj.length)); +} + +//CHECK#3 +if (obj[0] !== "y") { + $ERROR('#3: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x"; obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[0] === "y". Actual: ' + (obj[0])); +} + +//CHECK#4 +if (obj[1] !== undefined) { + $ERROR('#4: var obj = {}; obj.shift = Array.prototype.shift; obj[0] = "x" obj[1] = "y"; obj.length = -4294967294; obj.shift(); obj[1] === undefined. Actual: ' + (obj[1])); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T1.js new file mode 100644 index 000000000..5b2fc01dc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T1.js @@ -0,0 +1,61 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A4_T1; + * @section: 15.4.4.9, 8.6.2.1, 8.6.2.5; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = 1; +var x = [0]; +x.length = 2; + +//CHECK#1 +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: Array.prototype[1] = 1; x = [0]; x.length = 2; x.shift(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== 1) { + $ERROR('#3: Array.prototype[1] = 1; x = [0]; x.length = 2; x.shift(); x[1] === 1. Actual: ' + (x[1])); +} + +Object.prototype[1] = 1; +Object.prototype.length = 2; +Object.prototype.shift = Array.prototype.shift; +x = {0:0}; + +//CHECK#4 +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#4: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0}; x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0}; x.shift(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== 1) { + $ERROR('#6: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0}; x.shift(); x[1] === 1. Actual: ' + (x[1])); +} + +//CHECK#7 +if (x.length !== 1) { + $ERROR('#7: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0}; x.shift(); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#8 +delete x.length; +if (x.length !== 2) { + $ERROR('#8: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0}; x.shift(); delete x; x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T2.js new file mode 100644 index 000000000..6d57d6dc1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A4_T2.js @@ -0,0 +1,61 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4.9_A4_T2; + * @section: 15.4.4.9, 8.6.2.1; + * @assertion: [[Get]], [[Delete]] from not an inherited property; + * @description: [[Prototype]] of Array instance is Array.prototype, [[Prototype] of Array.prototype is Object.prototype; +*/ + +Array.prototype[1] = -1; +var x = [0,1]; +x.length = 2; + +//CHECK#1 +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#1: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#2 +if (x[0] !== 1) { + $ERROR('#2: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.shift(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#3 +if (x[1] !== -1) { + $ERROR('#3: Array.prototype[1] = -1; x = [0,1]; x.length = 2; x.shift(); x[1] === -1. Actual: ' + (x[1])); +} + +Object.prototype[1] = -1; +Object.prototype.length = 2; +Object.prototype.shift = Array.prototype.shift; +x = {0:0,1:1}; + +//CHECK#4 +var shift = x.shift(); +if (shift !== 0) { + $ERROR('#4: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0,1:1}; x.shift() === 0. Actual: ' + (shift)); +} + +//CHECK#5 +if (x[0] !== 1) { + $ERROR('#5: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0,1:1}; x.shift(); x[0] === 1. Actual: ' + (x[0])); +} + +//CHECK#6 +if (x[1] !== -1) { + $ERROR('#6: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0,1:1}; x.shift(); x[1] === -1. Actual: ' + (x[1])); +} + +//CHECK#7 +if (x.length !== 1) { + $ERROR('#7: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0,1:1}; x.shift(); x.length === 1. Actual: ' + (x.length)); +} + +//CHECK#8 +delete x.length; +if (x.length !== 2) { + $ERROR('#8: Object.prototype[1] = -1; Object.prototype.length = 2; Object.prototype.shift = Array.prototype.shift; x = {0:0,1:1}; x.shift(); delete x; x.length === 2. Actual: ' + (x.length)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.1.js new file mode 100644 index 000000000..1e6e1d663 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.1; +* @section: 15.4.4.9, 15.2.4.7, 12.6.4; +* @assertion: The length property of shift has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.prototype.shift.propertyIsEnumerable('length') !== false) { + $ERROR('#1: Array.prototype.shift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.shift.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in Array.shift){ + if (p === "length") { + result = false; +} +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array.shift) { if (p === "length") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.2.js new file mode 100644 index 000000000..c7f113fef --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.2; +* @section: 15.4.4.9, 15.2.4.5, 11.4.1; +* @assertion: The length property of shift has the attribute DontDelete; +* @description: Checking use hasOwnProperty, delete; +*/ + +//CHECK#1 +if (Array.prototype.shift.hasOwnProperty('length') !== true) { + $FAIL('#1: Array.prototype.shift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); +} + +delete Array.prototype.shift.length; + +//CHECK#2 +if (Array.prototype.shift.hasOwnProperty('length') !== true) { + $ERROR('#2: delete Array.prototype.shift.length; Array.prototype.shift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); +} + +//CHECK#3 +if (Array.prototype.shift.length === undefined) { + $ERROR('#3: delete Array.prototype.shift.length; Array.prototype.shift.length !== undefined'); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.3.js new file mode 100644 index 000000000..530d41845 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.3; +* @section: 15.4.4.9; +* @assertion: The length property of shift has the attribute ReadOnly; +* @description: Checking if varying the length property fails; +* @strict_mode_negative +*/ + +//CHECK#1 +var x = Array.prototype.shift.length; +Array.prototype.shift.length = Infinity; +if (Array.prototype.shift.length !== x) { + $ERROR('#1: x = Array.prototype.shift.length; Array.prototype.shift.length = Infinity; Array.prototype.shift.length === x. Actual: ' + (Array.prototype.shift.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.4.js new file mode 100644 index 000000000..1ddbeaa2a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.4; +* @section: 15.4.4.9; +* @assertion: The length property of shift is 0; +* @description: shift.length === 1; +*/ + +//CHECK#1 +if (Array.prototype.shift.length !== 0) { + $ERROR('#1: Array.prototype.shift.length === 0. Actual: ' + (Array.prototype.shift.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.5.js new file mode 100644 index 000000000..c0b2b5610 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.5; +* @section: 15.4.4.9, 15.2.4.7, 12.6.4; +* @assertion: The shift property of Array has the attribute DontEnum; +* @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (Array.propertyIsEnumerable('shift') !== false) { + $ERROR('#1: Array.propertyIsEnumerable(\'shift\') === false. Actual: ' + (Array.propertyIsEnumerable('shift'))); +} + +//CHECK#2 +var result = true; +for (var p in Array){ + if (p === "shift") { + result = false; +} +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in Array) { if (p === "shift") result = false; } result === true;'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.6.js new file mode 100644 index 000000000..aa864a47f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.6; +* @section: 15.4.4.9; +* @assertion: The shift property of Array has not prototype property; +* @description: Checking Array.prototype.shift.prototype; +*/ + +//CHECK#1 +if (Array.prototype.shift.prototype !== undefined) { + $ERROR('#1: Array.prototype.shift.prototype === undefined. Actual: ' + (Array.prototype.shift.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.7.js new file mode 100644 index 000000000..d634f6c9e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/15.4.4.9_Array_prototype_shift/S15.4.4.9_A5.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.4.4.9_A5.7; +* @section: 15.4.4.9, 11.2.2; +* @assertion: The shift property of Array can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new Array.prototype.shift(); + $ERROR('#1.1: new Array.prototype.shift() throw TypeError. Actual: ' + (new Array.prototype.shift())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Array.prototype.shift() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T1.js new file mode 100644 index 000000000..c45295ce4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.1_T1; + * @section: 15.4.4, 15.2.4.5; + * @assertion: The value of the internal [[Prototype]] property of + * the Array prototype object is the Object prototype object; + * @description: Create new property of Function.prototype. When Array.prototype object has this property; +*/ + +Object.prototype.myproperty = 1; + +//CHECK#1 +if (Array.prototype.myproperty !== 1) { + $ERROR('#1: Object.prototype.myproperty = 1; Array.prototype.myproperty === 1. Actual: ' + (Array.prototype.myproperty)); +} + +//CHECK#2 +if (Array.prototype.hasOwnProperty('myproperty') !== false) { + $ERROR('#2: Object.prototype.myproperty = 1; Array.prototype.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.prototype.hasOwnProperty('myproperty'))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js new file mode 100644 index 000000000..e038e553d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T2.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.1_T2; + * @section: 15.4.4; + * @assertion:The Array prototype object is itself an array; its +* [[Class]] is "Array", +*/ + +//CHECK#1 +if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") { + $ERROR('The Array prototype object is itself an array; its' + + '[[Class]] is "Array".'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T3.js new file mode 100644 index 000000000..30c290397 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.1_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.1_T3; + * @section: 15.4.4, 15.2.4.6; + * @assertion: The value of the internal [[Prototype]] property of + * the Array prototype object is the Object prototype object; + * @description: Checking use isPrototypeOf; +*/ + +//CHECK#1 +if (Object.prototype.isPrototypeOf(Array.prototype) !== true) { + $ERROR('#1: Object.prototype.isPrototypeOf(Array.prototype) === true. Actual: ' + (Object.prototype.isPrototypeOf(Array.prototype))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.2_T1.js new file mode 100644 index 000000000..67a083590 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.2_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.2_T1; + * @section: 15.4.4, 15.2.4.2; + * @assertion: The [[Class]] property of the Array prototype object is set to "Array"; + * @description: Checking use Object.prototype.toString; +*/ + +//CHECK#1 +Array.prototype.getClass = Object.prototype.toString; +if (Array.prototype.getClass() !== "[object " + "Array" + "]") { + $ERROR('#1: Array.prototype.getClass = Object.prototype.toString; Array.prototype is Array object. Actual: ' + (Array.prototype.getClass())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.3_T1.js new file mode 100644 index 000000000..d35d2e90c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A1.3_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A1.3_T1; + * @section: 15.4.4; + * @assertion: Array prototype object has length property whose value is +0; + * @description: Array.prototype.length === 0; +*/ + +//CHECK#1 +if (Array.prototype.length !== 0) { + $ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length)); +} else { + if (1 / Array.prototype.length !== Number.POSITIVE_INFINITY) { + $ERROR('#1.2: Array.prototype.length === +0. Actual: ' + (Array.prototype.length)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T1.js new file mode 100644 index 000000000..ebeb4906d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T1.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A2.1_T1; + * @section: 15.4.4, 15.2.4.5; + * @assertion: The Array prototype object does not have a valueOf property of + * its own; however, it inherits the valueOf property from the valueOf + * property from the Object prototype Object; + * @description: Checking use hasOwnProperty; +*/ + +//CHECK#1 +if (Array.prototype.hasOwnProperty('valueOf') !== false) { + $ERROR('#1: Array.prototype.hasOwnProperty(\'valueOf\') === false. Actual: ' + (Array.prototype.hasOwnProperty('valueOf'))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T2.js new file mode 100644 index 000000000..2b8f8b76d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.4_Array_Objects/15.4.4_Properties_of_the_Array_Prototype_Object/S15.4.4_A2.1_T2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.4.4_A2.1_T2; + * @section: 15.4.4; + * @assertion: The Array prototype object does not have a valueOf property of + * its own; however, it inherits the valueOf property from the valueOf + * property from the Object prototype Object; + * @description: Change valueOf property of Object.prototype. When Array.prototype.valueOf also change; +*/ + +Object.prototype.valueOf = 1; + +//CHECK#1 +if (Array.prototype.valueOf !== 1) { + $ERROR('#1: Object.prototype.valueOf = 1; Array.prototype.valueOf === 1. Actual: ' + (Array.prototype.valueOf)); +} + +//CHECK#2 +var x = new Array(); +if (x.valueOf !== 1) { + $ERROR('#1: Object.prototype.valueOf = 1; x = new Array(); x.valueOf === 1. Actual: ' + (x.valueOf)); +} |