diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object')
69 files changed, 3156 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.1_Number.prototype.constructor/S15.7.4.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.1_Number.prototype.constructor/S15.7.4.1_A1.js new file mode 100644 index 000000000..86f4e69ca --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.1_Number.prototype.constructor/S15.7.4.1_A1.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.7.4.1_A1; + * @section: 15.7.4.1; + * @assertion: The initial value of Number.prototype.constructor is the + * built-in Number constructor; + * @description: Compare Number.prototype.constructor with Number; +*/ + +//CHECK#1 +if(Number.prototype.constructor !== Number){ + $ERROR('#1: Number.prototype.constructor === Number'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T01.js new file mode 100644 index 000000000..84df44553 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T01.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.7.4.2_A1_T01; + * @section: 15.7.4.2; + * @assertion: toString: If radix is the number 10 or undefined, then this + * number value is given as an argument to the ToString operator. + * the resulting string value is returned; + * @description: undefined radix; +*/ + +//CHECK#1 +if(Number.prototype.toString() !== "0"){ + $ERROR('#1: Number.prototype.toString() === "0"'); +} + +//CHECK#2 +if((new Number()).toString() !== "0"){ + $ERROR('#2: (new Number()).toString() === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString() !== "0"){ + $ERROR('#3: (new Number(0)).toString() === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString() !== "-1"){ + $ERROR('#4: (new Number(-1)).toString() === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString() !== "1"){ + $ERROR('#5: (new Number(1)).toString() === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString() !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString() === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString() !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString() === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString() !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString() === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T02.js new file mode 100644 index 000000000..6048f024e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T02.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.7.4.2_A1_T02; + * @section: 15.7.4.2; + * @assertion: toString: If radix is the number 10 or undefined, then this + * number value is given as an argument to the ToString operator. + * the resulting string value is returned; + * @description: radix is 10; +*/ + +//CHECK#1 +if(Number.prototype.toString(10) !== "0"){ + $ERROR('#1: Number.prototype.toString(10) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(10) !== "0"){ + $ERROR('#2: (new Number()).toString(10) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(10) !== "0"){ + $ERROR('#3: (new Number(0)).toString(10) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(10) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(10) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(10) !== "1"){ + $ERROR('#5: (new Number(1)).toString(10) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(10) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(10) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(10) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(10) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(10) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(10) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T03.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T03.js new file mode 100644 index 000000000..bc7dccd3f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A1_T03.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.7.4.2_A1_T03; + * @section: 15.7.4.2; + * @assertion: toString: If radix is the number 10 or undefined, then this + * number value is given as an argument to the ToString operator. + * the resulting string value is returned; + * @description: radix is undefined value; +*/ + +//CHECK#1 +if(Number.prototype.toString(undefined) !== "0"){ + $ERROR('#1: Number.prototype.toString(undefined) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(undefined) !== "0"){ + $ERROR('#2: (new Number()).toString(undefined) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(undefined) !== "0"){ + $ERROR('#3: (new Number(0)).toString(undefined) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(undefined) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(undefined) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(undefined) !== "1"){ + $ERROR('#5: (new Number(1)).toString(undefined) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(undefined) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(undefined) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(undefined) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(undefined) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(undefined) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(undefined) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T01.js new file mode 100644 index 000000000..8a86633fb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T01.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.7.4.2_A2_T01; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 2; +*/ + +//CHECK#1 +if(Number.prototype.toString(2) !== "0"){ + $ERROR('#1: Number.prototype.toString(2) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(2) !== "0"){ + $ERROR('#2: (new Number()).toString(2) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(2) !== "0"){ + $ERROR('#3: (new Number(0)).toString(2) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(2) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(2) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(2) !== "1"){ + $ERROR('#5: (new Number(1)).toString(2) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(2) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(2) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(2) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(2) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(2) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(2) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T02.js new file mode 100644 index 000000000..e031f44fc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T02.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.7.4.2_A2_T02; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 3; +*/ + +//CHECK#1 +if(Number.prototype.toString(3) !== "0"){ + $ERROR('#1: Number.prototype.toString(3) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(3) !== "0"){ + $ERROR('#2: (new Number()).toString(3) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(3) !== "0"){ + $ERROR('#3: (new Number(0)).toString(3) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(3) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(3) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(3) !== "1"){ + $ERROR('#5: (new Number(1)).toString(3) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(3) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(3) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(3) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(3) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(3) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(3) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T03.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T03.js new file mode 100644 index 000000000..6857aa6d0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T03.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.7.4.2_A2_T03; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 4; +*/ + +//CHECK#1 +if(Number.prototype.toString(4) !== "0"){ + $ERROR('#1: Number.prototype.toString(4) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(4) !== "0"){ + $ERROR('#2: (new Number()).toString(4) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(4) !== "0"){ + $ERROR('#3: (new Number(0)).toString(4) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(4) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(4) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(4) !== "1"){ + $ERROR('#5: (new Number(1)).toString(4) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(4) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(4) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(4) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(4) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(4) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(4) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T04.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T04.js new file mode 100644 index 000000000..444f03547 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T04.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.7.4.2_A2_T04; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 5; +*/ + +//CHECK#1 +if(Number.prototype.toString(5) !== "0"){ + $ERROR('#1: Number.prototype.toString(5) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(5) !== "0"){ + $ERROR('#2: (new Number()).toString(5) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(5) !== "0"){ + $ERROR('#3: (new Number(0)).toString(5) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(5) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(5) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(5) !== "1"){ + $ERROR('#5: (new Number(1)).toString(5) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(5) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(5) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(5) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(5) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(5) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(5) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T05.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T05.js new file mode 100644 index 000000000..0eb9f51d6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T05.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.7.4.2_A2_T05; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 6; +*/ + +//CHECK#1 +if(Number.prototype.toString(6) !== "0"){ + $ERROR('#1: Number.prototype.toString(6) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(6) !== "0"){ + $ERROR('#2: (new Number()).toString(6) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(6) !== "0"){ + $ERROR('#3: (new Number(0)).toString(6) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(6) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(6) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(6) !== "1"){ + $ERROR('#5: (new Number(1)).toString(6) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(6) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(6) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(6) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(6) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(6) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(6) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T06.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T06.js new file mode 100644 index 000000000..8c1ef484b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T06.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.7.4.2_A2_T06; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 7; +*/ + +//CHECK#1 +if(Number.prototype.toString(7) !== "0"){ + $ERROR('#1: Number.prototype.toString(7) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(7) !== "0"){ + $ERROR('#2: (new Number()).toString(7) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(7) !== "0"){ + $ERROR('#3: (new Number(0)).toString(7) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(7) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(7) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(7) !== "1"){ + $ERROR('#5: (new Number(1)).toString(7) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(7) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(7) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(7) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(7) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(7) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(7) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T07.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T07.js new file mode 100644 index 000000000..8b8554ad7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T07.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.7.4.2_A2_T07; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 8; +*/ + +//CHECK#1 +if(Number.prototype.toString(8) !== "0"){ + $ERROR('#1: Number.prototype.toString(8) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(8) !== "0"){ + $ERROR('#2: (new Number()).toString(8) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(8) !== "0"){ + $ERROR('#3: (new Number(0)).toString(8) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(8) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(8) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(8) !== "1"){ + $ERROR('#5: (new Number(1)).toString(8) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(8) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(8) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(8) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(8) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(8) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(8) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T08.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T08.js new file mode 100644 index 000000000..1eedcd387 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T08.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.7.4.2_A2_T08; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 9; +*/ + +//CHECK#1 +if(Number.prototype.toString(9) !== "0"){ + $ERROR('#1: Number.prototype.toString(9) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(9) !== "0"){ + $ERROR('#2: (new Number()).toString(9) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(9) !== "0"){ + $ERROR('#3: (new Number(0)).toString(9) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(9) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(9) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(9) !== "1"){ + $ERROR('#5: (new Number(1)).toString(9) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(9) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(9) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(9) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(9) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(9) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(9) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T09.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T09.js new file mode 100644 index 000000000..d9b04e8ab --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T09.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.7.4.2_A2_T09; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 11; +*/ + +//CHECK#1 +if(Number.prototype.toString(11) !== "0"){ + $ERROR('#1: Number.prototype.toString(11) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(11) !== "0"){ + $ERROR('#2: (new Number()).toString(11) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(11) !== "0"){ + $ERROR('#3: (new Number(0)).toString(11) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(11) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(11) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(11) !== "1"){ + $ERROR('#5: (new Number(1)).toString(11) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(11) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(11) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(11) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(11) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(11) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(11) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T10.js new file mode 100644 index 000000000..87f640f42 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T10.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.7.4.2_A2_T10; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 12; +*/ + +//CHECK#1 +if(Number.prototype.toString(12) !== "0"){ + $ERROR('#1: Number.prototype.toString(12) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(12) !== "0"){ + $ERROR('#2: (new Number()).toString(12) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(12) !== "0"){ + $ERROR('#3: (new Number(0)).toString(12) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(12) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(12) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(12) !== "1"){ + $ERROR('#5: (new Number(1)).toString(12) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(12) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(12) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(12) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(12) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(12) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(12) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T11.js new file mode 100644 index 000000000..8fba514a6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T11.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.7.4.2_A2_T11; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 13; +*/ + +//CHECK#1 +if(Number.prototype.toString(13) !== "0"){ + $ERROR('#1: Number.prototype.toString(13) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(13) !== "0"){ + $ERROR('#2: (new Number()).toString(13) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(13) !== "0"){ + $ERROR('#3: (new Number(0)).toString(13) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(13) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(13) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(13) !== "1"){ + $ERROR('#5: (new Number(1)).toString(13) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(13) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(13) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(13) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(13) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(13) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(13) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T12.js new file mode 100644 index 000000000..101be9822 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T12.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.7.4.2_A2_T12; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 14; +*/ + +//CHECK#1 +if(Number.prototype.toString(14) !== "0"){ + $ERROR('#1: Number.prototype.toString(14) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(14) !== "0"){ + $ERROR('#2: (new Number()).toString(14) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(14) !== "0"){ + $ERROR('#3: (new Number(0)).toString(14) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(14) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(14) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(14) !== "1"){ + $ERROR('#5: (new Number(1)).toString(14) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(14) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(14) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(14) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(14) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(14) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(14) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T13.js new file mode 100644 index 000000000..288b33432 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T13.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.7.4.2_A2_T13; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 15; +*/ + +//CHECK#1 +if(Number.prototype.toString(15) !== "0"){ + $ERROR('#1: Number.prototype.toString(15) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(15) !== "0"){ + $ERROR('#2: (new Number()).toString(15) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(15) !== "0"){ + $ERROR('#3: (new Number(0)).toString(15) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(15) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(15) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(15) !== "1"){ + $ERROR('#5: (new Number(1)).toString(15) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(15) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(15) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(15) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(15) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(15) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(15) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T14.js new file mode 100644 index 000000000..3c99a17be --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T14.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.7.4.2_A2_T14; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 16; +*/ + +//CHECK#1 +if(Number.prototype.toString(16) !== "0"){ + $ERROR('#1: Number.prototype.toString(16) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(16) !== "0"){ + $ERROR('#2: (new Number()).toString(16) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(16) !== "0"){ + $ERROR('#3: (new Number(0)).toString(16) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(16) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(16) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(16) !== "1"){ + $ERROR('#5: (new Number(1)).toString(16) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(16) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(16) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(16) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(16) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(16) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(16) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T15.js new file mode 100644 index 000000000..53566eb72 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T15.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.7.4.2_A2_T15; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 17; +*/ + +//CHECK#1 +if(Number.prototype.toString(17) !== "0"){ + $ERROR('#1: Number.prototype.toString(17) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(17) !== "0"){ + $ERROR('#2: (new Number()).toString(17) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(17) !== "0"){ + $ERROR('#3: (new Number(0)).toString(17) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(17) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(17) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(17) !== "1"){ + $ERROR('#5: (new Number(1)).toString(17) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(17) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(17) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(17) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(17) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(17) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(17) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T16.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T16.js new file mode 100644 index 000000000..e4aeaf34f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T16.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.7.4.2_A2_T16; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 18; +*/ + +//CHECK#1 +if(Number.prototype.toString(18) !== "0"){ + $ERROR('#1: Number.prototype.toString(18) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(18) !== "0"){ + $ERROR('#2: (new Number()).toString(18) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(18) !== "0"){ + $ERROR('#3: (new Number(0)).toString(18) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(18) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(18) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(18) !== "1"){ + $ERROR('#5: (new Number(1)).toString(18) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(18) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(18) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(18) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(18) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(18) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(18) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T17.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T17.js new file mode 100644 index 000000000..c2695f5db --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T17.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.7.4.2_A2_T17; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 19; +*/ + +//CHECK#1 +if(Number.prototype.toString(19) !== "0"){ + $ERROR('#1: Number.prototype.toString(19) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(19) !== "0"){ + $ERROR('#2: (new Number()).toString(19) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(19) !== "0"){ + $ERROR('#3: (new Number(0)).toString(19) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(19) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(19) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(19) !== "1"){ + $ERROR('#5: (new Number(1)).toString(19) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(19) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(19) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(19) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(19) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(19) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(19) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T18.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T18.js new file mode 100644 index 000000000..49a9a365e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T18.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.7.4.2_A2_T18; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 20; +*/ + +//CHECK#1 +if(Number.prototype.toString(20) !== "0"){ + $ERROR('#1: Number.prototype.toString(20) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(20) !== "0"){ + $ERROR('#2: (new Number()).toString(20) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(20) !== "0"){ + $ERROR('#3: (new Number(0)).toString(20) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(20) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(20) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(20) !== "1"){ + $ERROR('#5: (new Number(1)).toString(20) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(20) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(20) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(20) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(20) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(20) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(20) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T19.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T19.js new file mode 100644 index 000000000..7ca7d4093 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T19.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.7.4.2_A2_T19; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 21; +*/ + +//CHECK#1 +if(Number.prototype.toString(21) !== "0"){ + $ERROR('#1: Number.prototype.toString(21) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(21) !== "0"){ + $ERROR('#2: (new Number()).toString(21) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(21) !== "0"){ + $ERROR('#3: (new Number(0)).toString(21) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(21) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(21) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(21) !== "1"){ + $ERROR('#5: (new Number(1)).toString(21) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(21) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(21) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(21) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(21) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(21) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(21) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T20.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T20.js new file mode 100644 index 000000000..fc632d378 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T20.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.7.4.2_A2_T20; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 22; +*/ + +//CHECK#1 +if(Number.prototype.toString(22) !== "0"){ + $ERROR('#1: Number.prototype.toString(22) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(22) !== "0"){ + $ERROR('#2: (new Number()).toString(22) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(22) !== "0"){ + $ERROR('#3: (new Number(0)).toString(22) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(22) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(22) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(22) !== "1"){ + $ERROR('#5: (new Number(1)).toString(22) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(22) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(22) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(22) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(22) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(22) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(22) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T21.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T21.js new file mode 100644 index 000000000..a217412b9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T21.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.7.4.2_A2_T21; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 23; +*/ + +//CHECK#1 +if(Number.prototype.toString(23) !== "0"){ + $ERROR('#1: Number.prototype.toString(23) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(23) !== "0"){ + $ERROR('#2: (new Number()).toString(23) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(23) !== "0"){ + $ERROR('#3: (new Number(0)).toString(23) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(23) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(23) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(23) !== "1"){ + $ERROR('#5: (new Number(1)).toString(23) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(23) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(23) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(23) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(23) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(23) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(23) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T22.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T22.js new file mode 100644 index 000000000..a3c14f796 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T22.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.7.4.2_A2_T22; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 24; +*/ + +//CHECK#1 +if(Number.prototype.toString(24) !== "0"){ + $ERROR('#1: Number.prototype.toString(24) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(24) !== "0"){ + $ERROR('#2: (new Number()).toString(24) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(24) !== "0"){ + $ERROR('#3: (new Number(0)).toString(24) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(24) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(24) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(24) !== "1"){ + $ERROR('#5: (new Number(1)).toString(24) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(24) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(24) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(24) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(24) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(24) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(24) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T23.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T23.js new file mode 100644 index 000000000..0471ec426 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T23.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.7.4.2_A2_T23; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 25; +*/ + +//CHECK#1 +if(Number.prototype.toString(25) !== "0"){ + $ERROR('#1: Number.prototype.toString(25) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(25) !== "0"){ + $ERROR('#2: (new Number()).toString(25) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(25) !== "0"){ + $ERROR('#3: (new Number(0)).toString(25) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(25) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(25) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(25) !== "1"){ + $ERROR('#5: (new Number(1)).toString(25) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(25) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(25) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(25) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(25) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(25) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(25) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T24.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T24.js new file mode 100644 index 000000000..e4cdd5a10 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T24.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.7.4.2_A2_T24; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 26; +*/ + +//CHECK#1 +if(Number.prototype.toString(26) !== "0"){ + $ERROR('#1: Number.prototype.toString(26) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(26) !== "0"){ + $ERROR('#2: (new Number()).toString(26) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(26) !== "0"){ + $ERROR('#3: (new Number(0)).toString(26) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(26) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(26) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(26) !== "1"){ + $ERROR('#5: (new Number(1)).toString(26) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(26) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(26) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(26) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(26) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(26) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(26) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T25.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T25.js new file mode 100644 index 000000000..77ba1578b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T25.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.7.4.2_A2_T25; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 27; +*/ + +//CHECK#1 +if(Number.prototype.toString(27) !== "0"){ + $ERROR('#1: Number.prototype.toString(27) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(27) !== "0"){ + $ERROR('#2: (new Number()).toString(27) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(27) !== "0"){ + $ERROR('#3: (new Number(0)).toString(27) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(27) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(27) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(27) !== "1"){ + $ERROR('#5: (new Number(1)).toString(27) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(27) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(27) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(27) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(27) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(27) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(27) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T26.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T26.js new file mode 100644 index 000000000..11cb0f55c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T26.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.7.4.2_A2_T26; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 28; +*/ + +//CHECK#1 +if(Number.prototype.toString(28) !== "0"){ + $ERROR('#1: Number.prototype.toString(28) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(28) !== "0"){ + $ERROR('#2: (new Number()).toString(28) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(28) !== "0"){ + $ERROR('#3: (new Number(0)).toString(28) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(28) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(28) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(28) !== "1"){ + $ERROR('#5: (new Number(1)).toString(28) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(28) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(28) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(28) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(28) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(28) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(28) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T27.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T27.js new file mode 100644 index 000000000..92f149590 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T27.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.7.4.2_A2_T27; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 29; +*/ + +//CHECK#1 +if(Number.prototype.toString(29) !== "0"){ + $ERROR('#1: Number.prototype.toString(29) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(29) !== "0"){ + $ERROR('#2: (new Number()).toString(29) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(29) !== "0"){ + $ERROR('#3: (new Number(0)).toString(29) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(29) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(29) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(29) !== "1"){ + $ERROR('#5: (new Number(1)).toString(29) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(29) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(29) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(29) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(29) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(29) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(29) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T28.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T28.js new file mode 100644 index 000000000..8bbd3b23c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T28.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.7.4.2_A2_T28; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 30; +*/ + +//CHECK#1 +if(Number.prototype.toString(30) !== "0"){ + $ERROR('#1: Number.prototype.toString(30) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(30) !== "0"){ + $ERROR('#2: (new Number()).toString(30) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(30) !== "0"){ + $ERROR('#3: (new Number(0)).toString(30) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(30) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(30) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(30) !== "1"){ + $ERROR('#5: (new Number(1)).toString(30) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(30) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(30) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(30) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(30) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(30) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(30) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T29.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T29.js new file mode 100644 index 000000000..0bf12bbed --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T29.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.7.4.2_A2_T29; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 31; +*/ + +//CHECK#1 +if(Number.prototype.toString(31) !== "0"){ + $ERROR('#1: Number.prototype.toString(31) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(31) !== "0"){ + $ERROR('#2: (new Number()).toString(31) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(31) !== "0"){ + $ERROR('#3: (new Number(0)).toString(31) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(31) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(31) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(31) !== "1"){ + $ERROR('#5: (new Number(1)).toString(31) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(31) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(31) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(31) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(31) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(31) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(31) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T30.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T30.js new file mode 100644 index 000000000..a41f7be83 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T30.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.7.4.2_A2_T30; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 32; +*/ + +//CHECK#1 +if(Number.prototype.toString(32) !== "0"){ + $ERROR('#1: Number.prototype.toString(32) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(32) !== "0"){ + $ERROR('#2: (new Number()).toString(32) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(32) !== "0"){ + $ERROR('#3: (new Number(0)).toString(32) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(32) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(32) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(32) !== "1"){ + $ERROR('#5: (new Number(1)).toString(32) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(32) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(32) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(32) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(32) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(32) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(32) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T31.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T31.js new file mode 100644 index 000000000..334a78152 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T31.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.7.4.2_A2_T31; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 33; +*/ + +//CHECK#1 +if(Number.prototype.toString(33) !== "0"){ + $ERROR('#1: Number.prototype.toString(33) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(33) !== "0"){ + $ERROR('#2: (new Number()).toString(33) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(33) !== "0"){ + $ERROR('#3: (new Number(0)).toString(33) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(33) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(33) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(33) !== "1"){ + $ERROR('#5: (new Number(1)).toString(33) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(33) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(33) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(33) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(33) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(33) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(33) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T32.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T32.js new file mode 100644 index 000000000..b7a9cba80 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T32.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.7.4.2_A2_T32; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 34; +*/ + +//CHECK#1 +if(Number.prototype.toString(34) !== "0"){ + $ERROR('#1: Number.prototype.toString(34) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(34) !== "0"){ + $ERROR('#2: (new Number()).toString(34) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(34) !== "0"){ + $ERROR('#3: (new Number(0)).toString(34) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(34) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(34) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(34) !== "1"){ + $ERROR('#5: (new Number(1)).toString(34) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(34) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(34) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(34) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(34) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(34) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(34) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T33.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T33.js new file mode 100644 index 000000000..b3d901484 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T33.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.7.4.2_A2_T33; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 35; +*/ + +//CHECK#1 +if(Number.prototype.toString(35) !== "0"){ + $ERROR('#1: Number.prototype.toString(35) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(35) !== "0"){ + $ERROR('#2: (new Number()).toString(35) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(35) !== "0"){ + $ERROR('#3: (new Number(0)).toString(35) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(35) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(35) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(35) !== "1"){ + $ERROR('#5: (new Number(1)).toString(35) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(35) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(35) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(35) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(35) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(35) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(35) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T34.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T34.js new file mode 100644 index 000000000..9fa153309 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A2_T34.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.7.4.2_A2_T34; + * @section: 15.7.4.2; + * @assertion: toString: If radix is an integer from 2 to 36, but not 10, + * the result is a string, the choice of which is implementation-dependent; + * @description: radix is 36; +*/ + +//CHECK#1 +if(Number.prototype.toString(36) !== "0"){ + $ERROR('#1: Number.prototype.toString(36) === "0"'); +} + +//CHECK#2 +if((new Number()).toString(36) !== "0"){ + $ERROR('#2: (new Number()).toString(36) === "0"'); +} + +//CHECK#3 +if((new Number(0)).toString(36) !== "0"){ + $ERROR('#3: (new Number(0)).toString(36) === "0"'); +} + +//CHECK#4 +if((new Number(-1)).toString(36) !== "-1"){ + $ERROR('#4: (new Number(-1)).toString(36) === "-1"'); +} + +//CHECK#5 +if((new Number(1)).toString(36) !== "1"){ + $ERROR('#5: (new Number(1)).toString(36) === "1"'); +} + +//CHECK#6 +if((new Number(Number.NaN)).toString(36) !== "NaN"){ + $ERROR('#6: (new Number(Number.NaN)).toString(36) === "NaN"'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).toString(36) !== "Infinity"){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(36) === "Infinity"'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).toString(36) !== "-Infinity"){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(36) === "-Infinity"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T01.js new file mode 100644 index 000000000..6a3950f2d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T01.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.2_A3_T01; + * @section: 15.7.4.2; + * @assertion: toString: radix should be an integer between 2 and 36; + * @description: radix is 1; +*/ + +//CHECK#1 +try{ + var n = Number.prototype.toString(1); + $ERROR('#1: Number.prototype.toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#2 +try{ + var n = (new Number()).toString(1); + $ERROR('#2: (new Number()).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#3 +try{ + var n = (new Number(0)).toString(1); + $ERROR('#3: (new Number(0)).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#4 +try{ + var n = (new Number(-1)).toString(1); + $ERROR('#4: (new Number(-1)).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#5 +try{ + var n =(new Number(1)).toString(1); + $ERROR('#5: (new Number(1)).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#6 +try{ + var n =(new Number(Number.NaN)).toString(1); + $ERROR('#6: (new Number(Number.NaN)).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#7 +try{ + var n =(new Number(Number.POSITIVE_INFINITY)).toString(1); + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(1) should throw an Error'); +} +catch(e){ +} + +//CHECK#8 +try{ + var n =(new Number(Number.NEGATIVE_INFINITY)).toString(1); + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(1) should throw an Error'); +} +catch(e){ +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T02.js new file mode 100644 index 000000000..d40f4e8f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T02.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.2_A3_T02; + * @section: 15.7.4.2; + * @assertion: toString: radix should be an integer between 2 and 36; + * @description: radix is 37; +*/ + +//CHECK#1 +try{ + var n =Number.prototype.toString(37); + $ERROR('#1: Number.prototype.toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#2 +try{ + var n =(new Number()).toString(37); + $ERROR('#2: (new Number()).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#3 +try{ + var n =(new Number(0)).toString(37); + $ERROR('#3: (new Number(0)).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#4 +try{ + var n =(new Number(-1)).toString(37); + $ERROR('#4: (new Number(-1)).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#5 +try{ + var n =(new Number(1)).toString(37); + $ERROR('#5: (new Number(1)).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#6 +try{ + var n =(new Number(Number.NaN)).toString(37); + $ERROR('#6: (new Number(Number.NaN)).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#7 +try{ + var n =(new Number(Number.POSITIVE_INFINITY)).toString(37); + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(37) should throw an Error'); +} +catch(e){ +} + +//CHECK#8 +try{ + var n =(new Number(Number.NEGATIVE_INFINITY)).toString(37); + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(37) should throw an Error'); +} +catch(e){ +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T03.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T03.js new file mode 100644 index 000000000..7c6a3de7c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T03.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.2_A3_T03; + * @section: 15.7.4.2; + * @assertion: toString: radix should be an integer between 2 and 36; + * @description: radix is null value; +*/ + +//CHECK#1 +try{ + var n = Number.prototype.toString(null); + $ERROR('#1: Number.prototype.toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#2 +try{ + var n = (new Number()).toString(null); + $ERROR('#2: (new Number()).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#3 +try{ + var n = (new Number(0)).toString(null); + $ERROR('#3: (new Number(0)).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#4 +try{ + var n = (new Number(-1)).toString(null); + $ERROR('#4: (new Number(-1)).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#5 +try{ + var n = (new Number(1)).toString(null); + $ERROR('#5: (new Number(1)).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#6 +try{ + var n = (new Number(Number.NaN)).toString(null); + $ERROR('#6: (new Number(Number.NaN)).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#7 +try{ + var n = (new Number(Number.POSITIVE_INFINITY)).toString(null); + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(null) should throw an Error'); +} +catch(e){ +} + +//CHECK#8 +try{ + var n = (new Number(Number.NEGATIVE_INFINITY)).toString(null); + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(null) should throw an Error'); +} +catch(e){ +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T04.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T04.js new file mode 100644 index 000000000..fb55efc64 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A3_T04.js @@ -0,0 +1,73 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.2_A3_T04; + * @section: 15.7.4.2; + * @assertion: toString: radix should be an integer between 2 and 36; + * @description: radix is 0; +*/ + +//CHECK#1 +try{ + var n = Number.prototype.toString(0); + $ERROR('#1: Number.prototype.toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#2 +try{ + var n = (new Number()).toString(0); + $ERROR('#2: (new Number()).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#3 +try{ + var n = (new Number(0)).toString(0); + $ERROR('#3: (new Number(0)).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#4 +try{ + var n = (new Number(-1)).toString(0); + $ERROR('#4: (new Number(-1)).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#5 +try{ + var n = (new Number(1)).toString(0); + $ERROR('#5: (new Number(1)).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#6 +try{ + var n = (new Number(Number.NaN)).toString(0); + $ERROR('#6: (new Number(Number.NaN)).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#7 +try{ + var n = (new Number(Number.POSITIVE_INFINITY)).toString(0); + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).toString(0) should throw an Error'); +} +catch(e){ +} + +//CHECK#8 +try{ + var n = (new Number(Number.NEGATIVE_INFINITY)).toString(0); + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(0) should throw an Error'); +} +catch(e){ +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T01.js new file mode 100644 index 000000000..a4af9788a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T01.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.7.4.2_A4_T01; + * @section: 15.7.4.2; + * @assertion: The toString function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the String objects; +*/ + +//CHECK#1 +try{ + var s1 = new String(); + s1.toString = Number.prototype.toString; + var v1 = s1.toString(); + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new String(); + s2.myToString = Number.prototype.toString; + var v2 = s2.myToString(); + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T02.js new file mode 100644 index 000000000..3c0a02f1a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T02.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.7.4.2_A4_T02; + * @section: 15.7.4.2; + * @assertion: The toString function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Boolean objects; +*/ + +//CHECK#1 +try{ + var s1 = new Boolean(); + s1.toString = Number.prototype.toString; + var v1 = s1.toString(); + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Boolean(); + s2.myToString = Number.prototype.toString; + var v2 = s2.myToString(); + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T03.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T03.js new file mode 100644 index 000000000..c2ba988b2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T03.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.7.4.2_A4_T03; + * @section: 15.7.4.2; + * @assertion: The toString function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Date objects; +*/ + +//CHECK#1 +try{ + var s1 = new Date(); + s1.toString = Number.prototype.toString; + var v1 = s1.toString(); + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Date(); + s2.myToString = Number.prototype.toString; + var v2 = s2.myToString(); + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T04.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T04.js new file mode 100644 index 000000000..70f213b97 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T04.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.7.4.2_A4_T04; + * @section: 15.7.4.2; + * @assertion: The toString function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Object objects; +*/ + +//CHECK#1 +try{ + var s1 = new Object(); + s1.toString = Number.prototype.toString; + var v1 = s1.toString(); + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Object(); + s2.myToString = Number.prototype.toString; + var v2 = s2.myToString(); + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T05.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T05.js new file mode 100644 index 000000000..62abc528d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.2_Number.prototype.toString/S15.7.4.2_A4_T05.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.7.4.2_A4_T05; + * @section: 15.7.4.2; + * @assertion: The toString function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the other objects; +*/ + +//CHECK#1 +try{ + var s1 = {x: 1}; + s1.toString = Number.prototype.toString; + var v1 = s1.toString(); + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = {x: 1}; + s2.myToString = Number.prototype.toString; + var v2 = s2.myToString(); + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.toString on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T01.js new file mode 100644 index 000000000..c46587a12 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T01.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.7.4.4_A1_T01; + * @section: 15.7.4.4; + * @assertion: Number.prototype.valueOf() returns this number value; + * @description: Call without argument; +*/ + +//CHECK#1 +if(Number.prototype.valueOf() !== 0){ + $ERROR('#1: Number.prototype.valueOf() === 0'); +} + +//CHECK#2 +if((new Number()).valueOf() !== 0){ + $ERROR('#2: (new Number()).valueOf() === 0'); +} + +//CHECK#3 +if((new Number(0)).valueOf() !== 0){ + $ERROR('#3: (new Number(0)).valueOf() === 0'); +} + +//CHECK#4 +if((new Number(-1)).valueOf() !== -1){ + $ERROR('#4: (new Number(-1)).valueOf() === -1'); +} + +//CHECK#5 +if((new Number(1)).valueOf() !== 1){ + $ERROR('#5: (new Number(1)).valueOf() === 1'); +} + +//CHECK#6 +if(!isNaN((new Number(Number.NaN)).valueOf())){ + $ERROR('#6: (new Number(Number.NaN)).valueOf() === NaN'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).valueOf() !== Number.POSITIVE_INFINITY){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).valueOf() === Infinity'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).valueOf() !== Number.NEGATIVE_INFINITY){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).valueOf() === -Infinity'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T02.js new file mode 100644 index 000000000..30f6dc713 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A1_T02.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.7.4.4_A1_T02; + * @section: 15.7.4.4; + * @assertion: Number.prototype.valueOf() returns this number value; + * @description: calling with argument; +*/ + +//CHECK#1 +if(Number.prototype.valueOf("argument") !== 0){ + $ERROR('#1: Number.prototype.valueOf("argument") === 0'); +} + +//CHECK#2 +if((new Number()).valueOf("argument") !== 0){ + $ERROR('#2: (new Number()).valueOf("argument") === 0'); +} + +//CHECK#3 +if((new Number(0)).valueOf("argument") !== 0){ + $ERROR('#3: (new Number(0)).valueOf("argument") === 0'); +} + +//CHECK#4 +if((new Number(-1)).valueOf("argument") !== -1){ + $ERROR('#4: (new Number(-1)).valueOf("argument") === -1'); +} + +//CHECK#5 +if((new Number(1)).valueOf("argument") !== 1){ + $ERROR('#5: (new Number(1)).valueOf("argument") === 1'); +} + +//CHECK#6 +if(!isNaN((new Number(Number.NaN)).valueOf("argument"))){ + $ERROR('#6: (new Number(Number.NaN)).valueOf("argument") === NaN'); +} + +//CHECK#7 +if((new Number(Number.POSITIVE_INFINITY)).valueOf("argument") !== Number.POSITIVE_INFINITY){ + $ERROR('#7: (new Number(Number.POSITIVE_INFINITY)).valueOf("argument") === Infinity'); +} + +//CHECK#8 +if((new Number(Number.NEGATIVE_INFINITY)).valueOf("argument") !== Number.NEGATIVE_INFINITY){ + $ERROR('#8: (new Number(Number.NEGATIVE_INFINITY)).valueOf("argument") === -Infinity'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T01.js new file mode 100644 index 000000000..a88708ef9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T01.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.7.4.4_A2_T01; + * @section: 15.7.4.4; + * @assertion: The valueOf function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the String objects; +*/ + +//CHECK#1 +try{ + var s1 = new String(); + s1.valueOf = Number.prototype.valueOf; + var v1 = s1.valueOf(); + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new String(); + s2.myValueOf = Number.prototype.valueOf; + var v2 = s2.myValueOf(); + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T02.js new file mode 100644 index 000000000..285ac1533 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T02.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.7.4.4_A2_T02; + * @section: 15.7.4.4; + * @assertion: The valueOf function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Boolean objects; +*/ + +//CHECK#1 +try{ + var s1 = new Boolean(); + s1.valueOf = Number.prototype.valueOf; + var v1 = s1.valueOf(); + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Boolean(); + s2.myValueOf = Number.prototype.valueOf; + var v2 = s2.myValueOf(); + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T03.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T03.js new file mode 100644 index 000000000..6515d3a64 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T03.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.7.4.4_A2_T03; + * @section: 15.7.4.4; + * @assertion: The valueOf function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Date objects; +*/ + +//CHECK#1 +try{ + var s1 = new Date(); + s1.valueOf = Number.prototype.valueOf; + var v1 = s1.valueOf(); + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Date(); + s2.myValueOf = Number.prototype.valueOf; + var v2 = s2.myValueOf(); + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T04.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T04.js new file mode 100644 index 000000000..6b70d2077 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T04.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.7.4.4_A2_T04; + * @section: 15.7.4.4; + * @assertion: The valueOf function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the Object objects; +*/ + +//CHECK#1 +try{ + var s1 = new Object(); + s1.valueOf = Number.prototype.valueOf; + var v1 = s1.valueOf(); + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = new Object(); + s2.myValueOf = Number.prototype.valueOf; + var v2 = s2.myValueOf(); + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T05.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T05.js new file mode 100644 index 000000000..d69ce0959 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.4_Number.prototype.valueOf/S15.7.4.4_A2_T05.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.7.4.4_A2_T05; + * @section: 15.7.4.4; + * @assertion: The valueOf function is not generic, it cannot be transferred + * to other kinds of objects for use as a method and there is should be + * a TypeError exception if its this value is not a Number object; + * @description: transferring to the other objects; +*/ + +//CHECK#1 +try{ + var s1 = {x: 1}; + s1.valueOf = Number.prototype.valueOf; + var v1 = s1.valueOf(); + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#1: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + +//CHECK#2 +try{ + var s2 = {x: 1}; + s2.myValueOf = Number.prototype.valueOf; + var v2 = s2.myValueOf(); + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError'); +} +catch(e){ + if(!(e instanceof TypeError)){ + $ERROR('#2: Number.prototype.valueOf on not a Number object should throw TypeError, not '+e); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T01.js new file mode 100644 index 000000000..911af9eec --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T01.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.5_A1.1_T01; + * @section: 15.7.4.5; + * @assertion: Step 1: Let f be ToInteger(fractionDigits). (If fractionDigits + * is undefined, this step produces the value 0); + * @description: calling on Number prototype object; +*/ + +//CHECK#1 +if(Number.prototype.toFixed() !== "0"){ + $ERROR('#1: Number.prototype.toFixed() === "0"'); +} + +//CHECK#2 +if(Number.prototype.toFixed(0) !== "0"){ + $ERROR('#2: Number.prototype.toFixed(0) === "0"'); +} + +//CHECK#3 +if(Number.prototype.toFixed(1) !== "0.0"){ + $ERROR('#3: Number.prototype.toFixed(1) === "0.0"'); +} + +//CHECK#4 +if(Number.prototype.toFixed(1.1) !== "0.0"){ + $ERROR('#4: Number.prototype.toFixed(1.1) === "0.0"'); +} + +//CHECK#5 +if(Number.prototype.toFixed(0.9) !== "0"){ + $ERROR('#5: Number.prototype.toFixed(0.9) === "0"'); +} + +//CHECK#6 +if(Number.prototype.toFixed("1") !== "0.0"){ + $ERROR('#6: Number.prototype.toFixed("1") === "0.0"'); +} + +//CHECK#7 +if(Number.prototype.toFixed("1.1") !== "0.0"){ + $ERROR('#7: Number.prototype.toFixed("1.1") === "0.0"'); +} + +//CHECK#8 +if(Number.prototype.toFixed("0.9") !== "0"){ + $ERROR('#8: Number.prototype.toFixed("0.9") === "0"'); +} + +//CHECK#9 +if(Number.prototype.toFixed(Number.NaN) !== "0"){ + $ERROR('#9: Number.prototype.toFixed(Number.NaN) === "0"'); +} + +//CHECK#10 +if(Number.prototype.toFixed("some string") !== "0"){ + $ERROR('#9: Number.prototype.toFixed("some string") === "0"'); +} + +//CHECK#10 +try{ + if(Number.prototype.toFixed(-0.1) !== "0"){ + $ERROR('#10: Number.prototype.toFixed(-0.1) === "0"'); + } +} +catch(e){ + $ERROR('#10: Number.prototype.toFixed(-0.1) should not throw '+e); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T02.js new file mode 100644 index 000000000..47cafb7ea --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.1_T02.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.5_A1.1_T02; + * @section: 15.7.4.5; + * @assertion: Step 1: Let f be ToInteger(fractionDigits). (If fractionDigits + * is undefined, this step produces the value 0); + * @description: calling on Number object; +*/ + +//CHECK#1 +if((new Number(1)).toFixed() !== "1"){ + $ERROR('#1: (new Number(1)).prototype.toFixed() === "1"'); +} + +//CHECK#2 +if((new Number(1)).toFixed(0) !== "1"){ + $ERROR('#2: (new Number(1)).prototype.toFixed(0) === "1"'); +} + +//CHECK#3 +if((new Number(1)).toFixed(1) !== "1.0"){ + $ERROR('#3: (new Number(1)).prototype.toFixed(1) === "1.0"'); +} + +//CHECK#4 +if((new Number(1)).toFixed(1.1) !== "1.0"){ + $ERROR('#4: (new Number(1)).toFixed(1.1) === "1.0"'); +} + +//CHECK#5 +if((new Number(1)).toFixed(0.9) !== "1"){ + $ERROR('#5: (new Number(1)).toFixed(0.9) === "1"'); +} + +//CHECK#6 +if((new Number(1)).toFixed("1") !== "1.0"){ + $ERROR('#6: (new Number(1)).toFixed("1") === "1.0"'); +} + +//CHECK#7 +if((new Number(1)).toFixed("1.1") !== "1.0"){ + $ERROR('#7: (new Number(1)).toFixed("1.1") === "1.0"'); +} + +//CHECK#8 +if((new Number(1)).toFixed("0.9") !== "1"){ + $ERROR('#8: (new Number(1)).toFixed("0.9") === "1"'); +} + +//CHECK#9 +if((new Number(1)).toFixed(Number.NaN) !== "1"){ + $ERROR('#9: (new Number(1)).toFixed(Number.NaN) === "1"'); +} + +//CHECK#10 +if((new Number(1)).toFixed("some string") !== "1"){ + $ERROR('#9: (new Number(1)).toFixed("some string") === "1"'); +} + +//CHECK#10 +try{ + if((new Number(1)).toFixed(-0.1) !== "1"){ + $ERROR('#10: (new Number(1)).toFixed(-0.1) === "1"'); + } +} +catch(e){ + $ERROR('#10: (new Number(1)).toFixed(-0.1) should not throw '+e); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T01.js new file mode 100644 index 000000000..4c031994c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T01.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.5_A1.3_T01; + * @section: 15.7.4.5; + * @assertion: Step 4: If this number value is NaN, return the string "NaN"; + * @description: NaN is computed by new Number("string"); +*/ + +//CHECK#1 +if((new Number("a")).toFixed() !== "NaN"){ + $ERROR('#1: (new Number("a")).prototype.toFixed() === "NaN"'); +} + +//CHECK#2 +if((new Number("a")).toFixed(0) !== "NaN"){ + $ERROR('#2: (new Number("a")).prototype.toFixed(0) === "NaN"'); +} + +//CHECK#3 +if((new Number("a")).toFixed(1) !== "NaN"){ + $ERROR('#3: (new Number("a")).prototype.toFixed(1) === "NaN"'); +} + +//CHECK#4 +if((new Number("a")).toFixed(1.1) !== "NaN"){ + $ERROR('#4: (new Number("a")).toFixed(1.1) === "NaN"'); +} + +//CHECK#5 +if((new Number("a")).toFixed(0.9) !== "NaN"){ + $ERROR('#5: (new Number("a")).toFixed(0.9) === "NaN"'); +} + +//CHECK#6 +if((new Number("a")).toFixed("1") !== "NaN"){ + $ERROR('#6: (new Number("a")).toFixed("1") === "NaN"'); +} + +//CHECK#7 +if((new Number("a")).toFixed("1.1") !== "NaN"){ + $ERROR('#7: (new Number("a")).toFixed("1.1") === "NaN"'); +} + +//CHECK#8 +if((new Number("a")).toFixed("0.9") !== "NaN"){ + $ERROR('#8: (new Number("a")).toFixed("0.9") === "NaN"'); +} + +//CHECK#9 +if((new Number("a")).toFixed(Number.NaN) !== "NaN"){ + $ERROR('#9: (new Number("a")).toFixed(Number.NaN) === "NaN"'); +} + +//CHECK#10 +if((new Number("a")).toFixed("some string") !== "NaN"){ + $ERROR('#9: (new Number("a")).toFixed("some string") === "NaN"'); +} + +//CHECK#10 +try{ + s = (new Number("a")).toFixed(Number.POSITIVE_INFINITY); + $ERROR('#10: (new Number("a")).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN'); +} +catch(e){ + if(!(e instanceof RangeError)){ + $ERROR('#10: (new Number("a")).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T02.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T02.js new file mode 100644 index 000000000..177a68419 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.3_T02.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.5_A1.3_T02; + * @section: 15.7.4.5; + * @assertion: Step 4: If this number value is NaN, return the string "NaN"; + * @description: direct usage of NaN; +*/ + +//CHECK#1 +if(Number.NaN.toFixed() !== "NaN"){ + $ERROR('#1: Number.NaN.prototype.toFixed() === "NaN"'); +} + +//CHECK#2 +if(Number.NaN.toFixed(0) !== "NaN"){ + $ERROR('#2: Number.NaN.prototype.toFixed(0) === "NaN"'); +} + +//CHECK#3 +if(Number.NaN.toFixed(1) !== "NaN"){ + $ERROR('#3: Number.NaN.prototype.toFixed(1) === "NaN"'); +} + +//CHECK#4 +if(Number.NaN.toFixed(1.1) !== "NaN"){ + $ERROR('#4: Number.NaN.toFixed(1.1) === "NaN"'); +} + +//CHECK#5 +if(Number.NaN.toFixed(0.9) !== "NaN"){ + $ERROR('#5: Number.NaN.toFixed(0.9) === "NaN"'); +} + +//CHECK#6 +if(Number.NaN.toFixed("1") !== "NaN"){ + $ERROR('#6: Number.NaN.toFixed("1") === "NaN"'); +} + +//CHECK#7 +if(Number.NaN.toFixed("1.1") !== "NaN"){ + $ERROR('#7: Number.NaN.toFixed("1.1") === "NaN"'); +} + +//CHECK#8 +if(Number.NaN.toFixed("0.9") !== "NaN"){ + $ERROR('#8: Number.NaN.toFixed("0.9") === "NaN"'); +} + +//CHECK#9 +if(Number.NaN.toFixed(Number.NaN) !== "NaN"){ + $ERROR('#9: Number.NaN.toFixed(Number.NaN) === "NaN"'); +} + +//CHECK#10 +if(Number.NaN.toFixed("some string") !== "NaN"){ + $ERROR('#9: Number.NaN.toFixed("some string") === "NaN"'); +} + +//CHECK#10 +try{ + s = Number.NaN.toFixed(Number.POSITIVE_INFINITY); + $ERROR('#10: Number.NaN.toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN'); +} +catch(e){ + if(!(e instanceof RangeError)){ + $ERROR('#10: Number.NaN.toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.4_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.4_T01.js new file mode 100644 index 000000000..1c28cd4e5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A1.4_T01.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.7.4.5_A1.4_T01; + * @section: 15.7.4.5; + * @assertion: Step 9: If x >= 10^21, let m = ToString(x); + * @description: x is 10^21; +*/ + +//CHECK#1 +if((new Number(1e21)).toFixed() !== String(1e21)){ + $ERROR('#1: (new Number(1e21)).prototype.toFixed() === String(1e21)'); +} + +//CHECK#2 +if((new Number(1e21)).toFixed(0) !== String(1e21)){ + $ERROR('#2: (new Number(1e21)).prototype.toFixed(0) === String(1e21)'); +} + +//CHECK#3 +if((new Number(1e21)).toFixed(1) !== String(1e21)){ + $ERROR('#3: (new Number(1e21)).prototype.toFixed(1) === String(1e21)'); +} + +//CHECK#4 +if((new Number(1e21)).toFixed(1.1) !== String(1e21)){ + $ERROR('#4: (new Number(1e21)).toFixed(1.1) === String(1e21)'); +} + +//CHECK#5 +if((new Number(1e21)).toFixed(0.9) !== String(1e21)){ + $ERROR('#5: (new Number(1e21)).toFixed(0.9) === String(1e21)'); +} + +//CHECK#6 +if((new Number(1e21)).toFixed("1") !== String(1e21)){ + $ERROR('#6: (new Number(1e21)).toFixed("1") === String(1e21)'); +} + +//CHECK#7 +if((new Number(1e21)).toFixed("1.1") !== String(1e21)){ + $ERROR('#7: (new Number(1e21)).toFixed("1.1") === String(1e21)'); +} + +//CHECK#8 +if((new Number(1e21)).toFixed("0.9") !== String(1e21)){ + $ERROR('#8: (new Number(1e21)).toFixed("0.9") === String(1e21)'); +} + +//CHECK#9 +if((new Number(1e21)).toFixed(Number.NaN) !== String(1e21)){ + $ERROR('#9: (new Number(1e21)).toFixed(Number.NaN) === String(1e21)'); +} + +//CHECK#10 +if((new Number(1e21)).toFixed("some string") !== String(1e21)){ + $ERROR('#9: (new Number(1e21)).toFixed("some string") === String(1e21)'); +} + +//CHECK#10 +try{ + s = (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY); + $ERROR('#10: (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not return NaN'); +} +catch(e){ + if(!(e instanceof RangeError)){ + $ERROR('#10: (new Number(1e21)).toFixed(Number.POSITIVE_INFINITY) should throw RangeError, not '+e); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A2_T01.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A2_T01.js new file mode 100644 index 000000000..3426da074 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/15.7.4.5_Number.prototype.toFixed/S15.7.4.5_A2_T01.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.7.4.5_A2_T01; + * @section: 15.7.4.5; + * @assertion: The length property of the toFixed method is 1; + * @description: Checking Number prototype itself; +*/ + +//CHECK#1 +if(Number.prototype.toFixed.hasOwnProperty("length") !== true){ + $ERROR('#1: The length property of the toFixed method is 1'); +} + +//CHECK#2 +if(Number.prototype.toFixed.length !== 1){ + $ERROR('#2: The length property of the toFixed method is 1'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A1.js new file mode 100644 index 000000000..ab5c760ab --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A1.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.7.4_A1; + * @section: 15.7.4; + * @assertion: The Number prototype object is itself a Number object + * (its [[Class]] is "Number") whose value is +0; + * @description: Checking type and value of Number.prototype property; +*/ + +//CHECK#1 +if (typeof Number.prototype !== "object") { + $ERROR('#1: typeof Number.prototype === "object"'); +} + +//CHECK#2 +if (Number.prototype != 0) { + $ERROR('#2: Number.prototype == +0'); +} else if( 1/Number.prototype != Number.POSITIVE_INFINITY){ + $ERROR('#2: Number.prototype == +0'); +} + +delete Number.prototype.toString; + +if (Number.prototype.toString() !== "[object Number]") { + $ERROR('#3: The [[Class]] property of the Number prototype object is set to "Number"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A2.js new file mode 100644 index 000000000..62f2025f2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A2.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.7.4_A2; + * @section: 15.7.4; + * @assertion: The value of the internal [[Prototype]] property of the Number + * prototype object is the Object prototype object; + * @description: Checking Object.prototype.isPrototypeOf(Number.prototype); +*/ + +//CHECK#1 +if (!Object.prototype.isPrototypeOf(Number.prototype)) { + $ERROR('#1: Object prototype object is the prototype of Number prototype object'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.1.js new file mode 100644 index 000000000..1f7c32adf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.1.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.7.4_A3.1; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property constructor; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("constructor") !== true){ + $ERROR('#1: The Number prototype object has the property constructor'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.2.js new file mode 100644 index 000000000..b87d8e441 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.2.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.7.4_A3.2; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property toString; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("toString") !== true){ + $ERROR('#1: The Number prototype object has the property toString'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.3.js new file mode 100644 index 000000000..e93393fc6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.3.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.7.4_A3.3; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property toLocaleString; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("toLocaleString") !== true){ + $ERROR('#1: The Number prototype object has the property toLocaleString'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.4.js new file mode 100644 index 000000000..ecb000e19 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.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.7.4_A3.4; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property valueOf; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("valueOf") !== true){ + $ERROR('#1: The Number prototype object has the property valueOf'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.5.js new file mode 100644 index 000000000..aee9eb019 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.5.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.7.4_A3.5; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property toFixed; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("toFixed") !== true){ + $ERROR('#1: The Number prototype object has the property toFixed'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.6.js new file mode 100644 index 000000000..a60c3c8ba --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.6.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.7.4_A3.6; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property toExponential; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("toExponential") !== true){ + $ERROR('#1: The Number prototype object has the property toExponential'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.7.js new file mode 100644 index 000000000..0e9e26554 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.7_Number_Objects/15.7.4_Properties_of_the_Number_Prototype_Object/S15.7.4_A3.7.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.7.4_A3.7; + * @section: 15.7.4; + * @assertion: The Number prototype object has the property toPrecision; + * @description: The test uses hasOwnProperty() method; +*/ + +//CHECK#1 +if(Number.prototype.hasOwnProperty("toPrecision") !== true){ + $ERROR('#1: The Number prototype object has the property toPrecision'); +} + |