diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object')
140 files changed, 4789 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T1.js new file mode 100644 index 000000000..35a7870ba --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A1.1_T1; + * @section: 15.1.2.1; + * @assertion: If x is not a string value, return x; + * @description: Checking all primitive; +*/ + +//CHECK#1 +var x = 1; +if (eval(x) !== x) { + $ERROR('#1: x = 1; eval(x) === x. Actual: ' + (eval(x))); +} + +//CHECK#2 +if (eval(1) !== 1) { + $ERROR('#2: eval(1) === 1. Actual: ' + (eval(1))); +} + +//CHECK#3 +if (eval(true) !== true) { + $ERROR('#3: eval(true) === true. Actual: ' + (eval(true))); +} + +//CHECK#4 +if (eval(null) !== null) { + $ERROR('#4: eval(null) === null. Actual: ' + (eval(null))); +} + +//CHECK#5 +if (eval(undefined) !== undefined) { + $ERROR('#5: eval(undefined) === undefined. Actual: ' + (eval(undefined))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T2.js new file mode 100644 index 000000000..13c75be57 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.1_T2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A1.1_T2; + * @section: 15.1.2.1; + * @assertion: If x is not a string value, return x; + * @description: Checking all object; +*/ + +//CHECK#1 +var x = {}; +if (eval(x) !== x) { + $ERROR('#1: x = {}; eval(x) === x. Actual: ' + (eval(x))); +} + +//CHECK#2 +x = new Number(1); +if (eval(x) !== x) { + $ERROR('#2: x = new Number(1); eval(x) === x. Actual: ' + (eval(x))); +} + +//CHECK#3 +x = new Boolean(true); +if (eval(x) !== x) { + $ERROR('#3: x = new Boolean(true); eval(x) === x. Actual: ' + (eval(x))); +} + +//CHECK#4 +x = new String("1+1"); +if (eval(x) !== x) { + $ERROR('#4: x = new String("1"); eval(x) === x. Actual: ' + (eval(x))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.2_T1.js new file mode 100644 index 000000000..cc30c4b79 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A1.2_T1.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A1.2_T1; + * @section: 15.1.2.1; + * @assertion: If the eval function is called with some argument, then use a first argument; + * @description: eval("x = 1", "x = 2"), x equal 1, not 2; +*/ + +//CHECK#1 +var x; +eval("x = 1", "x = 2"); +if (x !== 1) { + $ERROR('#1: eval("x = 1", "x = 2"); x === 1. Actual: ' + (x)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T1.js new file mode 100644 index 000000000..ea6c85e45 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T1.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A2_T1; + * @section: 15.1.2.1, 16; + * @assertion: If the parse fails, throw a SyntaxError exception (but see also clause 16); + * @description: Checking if execution of "eval("x = 1; x\u000A++"), catch SyntaxError" passes; +*/ + +//CHECK#1 +var x; +try { + eval("x = 1; x\u000A++"); + $ERROR('#1.1: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (eval("x = 1; x\u000A++"))); +} catch (e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T2.js new file mode 100644 index 000000000..839e3b010 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A2_T2.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A2_T2; + * @section: 15.1.2.1, 16; + * @assertion: If the parse fails, throw a SyntaxError exception (but see also clause 16); + * @description: Checking if execution of "eval("x = 1; x\u000A++")" fails; + * @negative +*/ + +//CHECK#1 +var x; +eval("x = 1; x\u000A++"); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T1.js new file mode 100644 index 000000000..33b588ba6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T1.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.1_T1; + * @section: 15.1.2.1, 12.4; + * @assertion: If Result(3).type is normal and its completion value is a value V, + * then return the value V; + * @description: Expression statement. Eval return primitive value; +*/ + +var x; +//CHECK#1 +if (eval("x = 1") !== 1) { + $ERROR('#1: eval("x = 1") === 1. Actual: ' + (eval("x = 1"))); +} + +//CHECK#2 +if (eval("1") !== 1) { + $ERROR('#2: eval("1") === 1. Actual: ' + (eval("1"))); +} + +//CHECK#3 +if (eval("'1'") !== '1') { + $ERROR('#3: eval("\'1\'") === \'1\'. Actual: ' + (eval("'1'"))); +} + +//CHECK#4 +x = 1; +if (eval("++x") !== 2) { + $ERROR('#4: x = 1; eval("++x") === 2. Actual: ' + (x)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T2.js new file mode 100644 index 000000000..d98a0086a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.1_T2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.1_T2; + * @section: 15.1.2.1, 12.4; + * @assertion: If Result(3).type is normal and its completion value is a value V, + * then return the value V; + * @description: Expression statement. Eval return object value; +*/ + +//CHECK#1 +var x = {}; +var y; +if (eval("y = x") !== x) { + $ERROR('#1: var x = {}; eval("y = x") === x. Actual: ' + (eval("y = x"))); +} + + +//CHECK#2 +if (eval("x") !== x) { + $ERROR('#2: var x = {}; eval("x") === x. Actual: ' + (eval("x"))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T1.js new file mode 100644 index 000000000..8bff8c954 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T1.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.2_T1; + * @section: 15.1.2.1, 12.1; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: Block statement; +*/ + +//CHECK#1 +if (eval("{}") !== undefined) { + $ERROR('#1: eval("{}") === undefined. Actual: ' + (eval("{}"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T2.js new file mode 100644 index 000000000..78af4be93 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T2.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.2_T2; + * @section: 15.1.2.1, 12.2; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: Var statement; +*/ + +//CHECK#1 +if (eval("var x = 1") !== undefined) { + $ERROR('#1: eval("var x = 1") === undefined. Actual: ' + (eval("var x = 1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T3.js new file mode 100644 index 000000000..2fa8c3f8d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.2_T3; + * @section: 15.1.2.1, 12.3; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: Empty statement; +*/ + +//CHECK#1 +if (eval(";") !== undefined) { + $ERROR('#1: eval(";") === undefined. Actual: ' + (eval(";"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T4.js new file mode 100644 index 000000000..46470bb10 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T4.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.1.2.1_A3.2_T4; + * @section: 15.1.2.1, 12.5; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: If statement; +*/ + +//CHECK#1 +if (eval("if (false) ;") !== undefined) { + $ERROR('#1: eval("if (false) ;") === undefined. Actual: ' + eval("if (false) ;")); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T5.js new file mode 100644 index 000000000..ae9ea4e98 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T5.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.1.2.1_A3.2_T5; + * @section: 15.1.2.1, 12.11; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: Switch statement; +*/ + +//CHECK#1 +if (eval("switch(1){}") !== undefined) { + $ERROR('#1: eval("switch(1){}") === undefined. Actual: ' + (eval("switch(1){}"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T6.js new file mode 100644 index 000000000..9e52de151 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T6.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.1.2.1_A3.2_T6; + * @section: 15.1.2.1, 12.6.1; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: do-while statement; +*/ + +//CHECK#1 +if (eval("do ; while(false)") !== undefined) { + $ERROR('#1: eval("do ; while(false)") === undefined. Actual: ' + (eval("do ; while(false)"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T7.js new file mode 100644 index 000000000..421e265fb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T7.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.1.2.1_A3.2_T7; + * @section: 15.1.2.1, 12.6.2; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: do-while statement; +*/ + +//CHECK#1 +if (eval("while(false);") !== undefined) { + $ERROR('#1: eval("while(false);") === undefined. Actual: ' + (eval("while(false);"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T8.js new file mode 100644 index 000000000..19bdbfe78 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.2_T8.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.1.2.1_A3.2_T8; + * @section: 15.1.2.1, 12.6.3; + * @assertion: If Result(3).type is normal and its completion value is empty, + * then return the value undefined; + * @description: for statement; +*/ + +//CHECK#1 +if (eval("for(false;false;false);") !== undefined) { + $ERROR('#1: eval("for(false;false;false);") === undefined. Actual: ' + (eval("for(false;false;false);"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T1.js new file mode 100644 index 000000000..f5affb3af --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.3_T1; + * @section: 15.1.2.1, 12.7; + * @assertion: If Result(3).type is not normal, then Result(3).type must be throw. + * Throw Result(3).value as an exception; + * @description: Continue statement; +*/ + +//CHECK#1 +try { + eval("continue;"); + $ERROR('#1.1: continue must throw SyntaxError. Actual: ' + (eval("continue;"))); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: continue must throw SyntaxError. Actual ' + (e)); + } +} + +//CHECK#2 +try { + for (var i = 0; i <= 1; i++) { + for (var j = 0; j <= 1; j++) { + eval("continue;"); + } + } + $ERROR('#2.1: continue must throw SyntaxError. Actual: ' + (eval("continue;"))); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#2.2: continue must throw SyntaxError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T2.js new file mode 100644 index 000000000..f66ea4002 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T2.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.3_T2; + * @section: 15.1.2.1, 12.8; + * @assertion: If Result(3).type is not normal, then Result(3).type must be throw. + * Throw Result(3).value as an exception; + * @description: Break statement; +*/ + +//CHECK#1 +try { + eval("break;"); + $ERROR('#1.1: break must throw SyntaxError. Actual: ' + (eval("break;"))); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: break must throw SyntaxError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + for (var i = 0; i <= 1; i++) { + for (var j = 0; j <= 1; j++) { + eval("break;"); + } + } + $ERROR('#2.1: break must throw SyntaxError. Actual: ' + (eval("break;"))); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#2.2: break must throw SyntaxError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T3.js new file mode 100644 index 000000000..5ee0bedd0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T3.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.3_T3; + * @section: 15.1.2.1, 12.9; + * @assertion: If Result(3).type is not normal, then Result(3).type must be throw. + * Throw Result(3).value as an exception; + * @description: Return statement; +*/ + +//CHECK#1 +try { + eval("return;"); + $ERROR('#1.1: return must throw SyntaxError. Actual: ' + (eval("return;"))); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#1.2: return must throw SyntaxError. Actual: ' + (e)); + } +} + +//CHECK#2 + +function f() { eval("return;"); }; + +try { + f(); + $ERROR('#2.1: return must throw SyntaxError. Actual: ' + (f())); +} catch(e) { + if ((e instanceof SyntaxError) !== true) { + $ERROR('#2.2: return must throw SyntaxError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T4.js new file mode 100644 index 000000000..e1db69a52 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A3.3_T4.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A3.3_T4; + * @section: 15.1.2.1, 12.13; + * @assertion: If Result(3).type is not normal, then Result(3).type must be throw. + * Throw Result(3).value as an exception; + * @description: Throw statement; +*/ + +//CHECK#1 +try { + eval("throw 1;"); + $ERROR('#1.1: throw 1 must throw SyntaxError. Actual: ' + (eval("throw 1;"))); +} catch(e) { + if (e !== 1) { + $ERROR('#1.2: throw 1 must throw SyntaxError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.1.js new file mode 100644 index 000000000..2d5dad470 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A4.1; + * @section: 15.1.2.1, 15.2.4.7, 12.6.4; + * @assertion: The length property of eval has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (eval.propertyIsEnumerable('length') !== false) { + $ERROR('#1: eval.propertyIsEnumerable(\'length\') === false. Actual: ' + (eval.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (p in eval){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in eval) { if (p === "length") result = false; }; result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.2.js new file mode 100644 index 000000000..f1782f015 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.2.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A4.2; + * @section: 15.1.2.1, 15.2.4.5, 11.4.1; + * @assertion: The length property of eval has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; +*/ + +//CHECK#1 +if (eval.hasOwnProperty('length') !== true) { + $FAIL('#1: eval.hasOwnProperty(\'length\') === true. Actual: ' + (eval.hasOwnProperty('length'))); +} + +delete eval.length; + +//CHECK#2 +if (eval.hasOwnProperty('length') !== true) { + $ERROR('#2: delete eval.length; eval.hasOwnProperty(\'length\') === true. Actual: ' + (eval.hasOwnProperty('length'))); +} + +//CHECK#3 +if (eval.length === undefined) { + $ERROR('#3: delete eval.length; eval.length !== undefined'); +} + + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.3.js new file mode 100644 index 000000000..1668ed29c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A4.3; + * @section: 15.1.2.1; + * @assertion: The length property of eval has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +var x = eval.length; +eval.length = Infinity; +if (eval.length !== x) { + $ERROR('#1: x = eval.length; eval.length = Infinity; eval.length === x. Actual: ' + (eval.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.4.js new file mode 100644 index 000000000..74c6ac526 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A4.4; + * @section: 15.1.2.1; + * @assertion: The length property of eval is 1; + * @description: eval.length === 1; +*/ + +//CHECK#1 +if (eval.length !== 1) { + $ERROR('#1: eval.length === 1. Actual: ' + (eval.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.5.js new file mode 100644 index 000000000..fd55a100c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.1_A4.5; + * @section: 15.1.2.1, 15.2.4.7, 12.6.4; + * @assertion: The eval property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('eval') !== false) { + $ERROR('#1: this.propertyIsEnumerable(\'eval\') === false. Actual: ' + (this.propertyIsEnumerable('eval'))); +} + +//CHECK#2 +var result = true; +for (var p in this){ + if (p === "eval") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "eval") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.6.js new file mode 100644 index 000000000..6ba1e2a5c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.1_A4.6; +* @section: 15.1.2.1; +* @assertion: The eval property has not prototype property; +* @description: Checking eval.prototype; +*/ + +//CHECK#1 +if (eval.prototype !== undefined) { + $ERROR('#1: eval.prototype === undefined. Actual: ' + (eval.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.7.js new file mode 100644 index 000000000..c82ebd710 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.1_eval/S15.1.2.1_A4.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.1_A4.7; +* @section: 15.1.2.1, 11.2.2; +* @assertion: The eval property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new eval(); + $ERROR('#1.1: new eval() throw TypeError. Actual: ' + (new eval())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new eval() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T1.js new file mode 100644 index 000000000..6f07f553d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T1; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for boolean primitive; +*/ + +//CHECK#1 +if (!(isNaN(parseInt(true)) && isNaN(parseInt("NaN")))) { + $ERROR('#1: parseInt(true) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN"))); +} + +//CHECK#2 +if (String(parseInt(false)) !== "NaN") { + $ERROR('#2: String(parseInt(false)) === "NaN". Actual: ' + (String(parseInt(false)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T2.js new file mode 100644 index 000000000..781d3b055 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T2; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for number primitive; +*/ + +//CHECK#1 +if (parseInt(-1) !== parseInt("-1")) { + $ERROR('#1: parseInt(-1) === parseInt("-1"). Actual: ' + (parseInt(-1))); +} + +//CHECK#2 +if (String(parseInt(Infinity)) !== "NaN") { + $ERROR('#2: String(parseInt(Infinity)) === "NaN". Actual: ' + (String(parseInt(Infinity)))); +} + +//CHECK#3 +if (String(parseInt(NaN)) !== "NaN") { + $ERROR('#3: String(parseInt(NaN)) === "NaN". Actual: ' + (String(parseInt(NaN)))); +} + +//CHECK#4 +if (parseInt(-0) !== 0) { + $ERROR('#4: parseInt(-0) === 0. Actual: ' + (parseInt(-0))); +} else { + if (1 / parseInt(-0) !== Number.POSITIVE_INFINITY) { + $ERROR('#4: parseInt(-0) === +0. Actual: ' + (parseInt(-0))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T3.js new file mode 100644 index 000000000..25a3334dd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T3; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for undefined and null; +*/ + +//CHECK#1 +if (!(isNaN(parseInt(undefined)) && isNaN(parseInt("NaN")))) { + $ERROR('#1: parseInt(undefined) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN"))); +} + +//CHECK#2 +if (!(isNaN(parseInt(null)) && isNaN(parseInt("NaN")))) { + $ERROR('#2: parseInt(null) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN"))); +} + +//CHECK#3 +if (String(parseInt(undefined)) !== "NaN") { + $ERROR('#3: String(parseInt(undefined)) === "NaN". Actual: ' + (String(parseInt(undefined)))); +} + +//CHECK#4 +if (String(parseInt(null)) !== "NaN") { + $ERROR('#4: String(parseInt(null)) === "NaN". Actual: ' + (String(parseInt(null)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T4.js new file mode 100644 index 000000000..eb95903f2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T4.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.1.2.2_A1_T4; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Boolean object; +*/ + +//CHECK#1 +if (!(isNaN(parseInt(new Boolean(true))) && isNaN(parseInt("NaN")))) { + $ERROR('#1: parseInt(new Boolean(true)) === Not-a-Number; parseInt("NaN") === Not-a-Number. Actual: ' + (parseInt("NaN"))); +} + +//CHECK#2 +if (String(parseInt(new Boolean(false))) !== "NaN") { + $ERROR('#2: String(parseInt(new Boolean(false))) === "NaN". Actual: ' + (String(parseInt(new Boolean(false))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T5.js new file mode 100644 index 000000000..42d3c4349 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T5.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T5; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Number object; +*/ + +//CHECK#1 +if (parseInt(new Number(-1)) !== parseInt("-1")) { + $ERROR('#1: parseInt(new Number(-1)) === parseInt("-1"). Actual: ' + (parseInt(new Number(-1)))); +} + +//CHECK#2 +if (String(parseInt(new Number(Infinity))) !== "NaN") { + $ERROR('#2: String(parseInt(new Number(Infinity))) === "NaN". Actual: ' + (String(parseInt(new Number(Infinity))))); +} + +//CHECK#3 +if (String(parseInt(new Number(NaN))) !== "NaN") { + $ERROR('#3: String(parseInt(new Number(NaN))) === "NaN". Actual: ' + (String(parseInt(new Number(NaN))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T6.js new file mode 100644 index 000000000..733dd48dd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T6.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T6; + * @section: 15.1.2.2, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for String object; +*/ + +//CHECK#1 +if (parseInt(new String("-1")) !== parseInt("-1")) { + $ERROR('#1: parseInt(new String("-1")) === parseInt("-1"). Actual: ' + (parseInt(new String("-1")))); +} + +//CHECK#2 +if (String(parseInt(new String("Infinity"))) !== "NaN") { + $ERROR('#2: String(parseInt(new String("Infinity"))) === "NaN". Actual: ' + (String(parseInt(new String("Infinity"))))); +} + +//CHECK#3 +if (String(parseInt(new String("NaN"))) !== "NaN") { + $ERROR('#3: String(parseInt(new String("NaN"))) === "NaN". Actual: ' + (String(parseInt(new String("NaN"))))); +} + +//CHECK#4 +if (String(parseInt(new String("false"))) !== "NaN") { + $ERROR('#4: String(parseInt(new String("false"))) === "NaN". Actual: ' + (String(parseInt(new String("false"))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T7.js new file mode 100644 index 000000000..f57b22ee1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A1_T7.js @@ -0,0 +1,78 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A1_T7; + * @section: 15.1.2.2, 9.8, 8.6.2.6; + * @assertion: Operator use ToString; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, String); +*/ + +//CHECK#1 +var object = {valueOf: function() {return 1}}; +if (isNaN(parseInt(object)) !== true) { + $ERROR('#1: var object = {valueOf: function() {return 1}}; parseInt(object) === Not-a-Number. Actual: ' + (parseInt(object))); +} + +//CHECK#2 +var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +if (parseInt(object) !== 0) { + $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; parseInt(object) === 0. Actual: ' + (parseInt(object))); +} + +//CHECK#3 +var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +if (parseInt(object) !== 1) { + $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; parseInt(object) === 1. Actual: ' + (parseInt(object))); +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + if (parseInt(object) !== 1) { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseInt(object) === 1. Actual: ' + (parseInt(object))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseInt(object) not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseInt(object) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return 1}}; +if (parseInt(object) !== 1) { + $ERROR('#5: var object = {toString: function() {return 1}}; parseInt(object) === 1. Actual: ' + (parseInt(object))); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return 1}} +if (parseInt(object) !== 1) { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; parseInt(object) === 1. Actual: ' + (parseInt(object))); +} + +//CHECK#7 +try { + var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + parseInt(object); + $ERROR('#7.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (parseInt(object))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + parseInt(object); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (parseInt(object))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T1.js new file mode 100644 index 000000000..3ca83f46a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T1.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T1; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: TAB (U+0009); +*/ + +//CHECK#1 +if (parseInt("\u00091") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u00091") === parseInt("1"). Actual: ' + (parseInt("\u00091"))); +} + +//CHECK#2 +if (parseInt("\u0009\u0009-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u0009\\u0009-1") === parseInt("-1"). Actual: ' + (parseInt("\u0009\u0009-1"))); +} + +//CHECK#3 +if (parseInt(" 1") !== parseInt("1")) { + $ERROR('#3: parseInt(" 1") === parseInt("1"). Actual: ' + (parseInt(" 1"))); +} + +//CHECK#4 +if (parseInt(" 1") !== parseInt("1")) { + $ERROR('#4: parseInt(" 1") === parseInt("1"). Actual: ' + (parseInt(" 1"))); +} + +//CHECK#5 +if (parseInt(" \u0009 \u0009-1") !== parseInt("-1")) { + $ERROR('#5: parseInt(" \\u0009 \\u0009-1") === parseInt("-1"). Actual: ' + (parseInt(" \u0009 \u0009-1"))); +} + +//CHECK#6 +if (isNaN(parseInt("\u0009")) !== true) { + $ERROR('#6: parseInt("\\u0009") === Not-a-Number. Actual: ' + (parseInt("\u0009"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T10.js new file mode 100644 index 000000000..e87c6d8d8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T10.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T10; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: USP; +*/ + +//CHECK# +var count = 0; +var errorCount = 0; +var uspU = ["\u1680", "\u180E", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; +var uspS = ["1680", "180E", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; + +for (var index = 0; index < uspU.length; index++) { + var result = true; + if (parseInt(uspU[index] + "1") !== parseInt("1")) { + $ERROR('#1.' + uspS[index] + ' '); + result = false; + } + if (parseInt(uspU[index] + uspU[index] + uspU[index] + "1") !== parseInt("1")) { + $ERROR('#2.' + uspS[index] + ' '); + result = false; + } + if (isNaN(parseInt(uspU[index])) !== true) { + $ERROR('#3.' + uspS[index] + ' '); + result = false; + } + if (result !== true) { + errorCount++; + } + count++; +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T2.js new file mode 100644 index 000000000..eed95977b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T2; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: SP (U+0020); +*/ + +//CHECK#1 +if (parseInt("\u00201") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u00201") === parseInt("1"). Actual: ' + (parseInt("\u00201"))); +} + +//CHECK#2 +if (parseInt("\u0020\u0020-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u0020\\u0020-1") === parseInt("-1"). Actual: ' + (parseInt("\u0020\u0020-1"))); +} + +//CHECK#3 +if (parseInt(" 1") !== parseInt("1")) { + $ERROR('#3: parseInt(" 1") === parseInt("1"). Actual: ' + (parseInt(" 1"))); +} + +//CHECK#4 +if (parseInt(" 1") !== parseInt("1")) { + $ERROR('#4: parseInt(" 1") === parseInt("1"). Actual: ' + (parseInt(" 1"))); +} + +//CHECK#5 +if (parseInt(" \u0020 \u0020-1") !== parseInt("-1")) { + $ERROR('#5: parseInt(" \\u0020 \\u0020-1") === parseInt("-1"). Actual: ' + (parseInt(" \u0020 \u0020-1"))); +} + +//CHECK#6 +if (isNaN(parseInt("\u0020")) !== true) { + $ERROR('#6: parseInt("\\u0020") === Not-a-Number. Actual: ' + (parseInt("\u0020"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T3.js new file mode 100644 index 000000000..7d454d0b5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T3.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T3; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: NBSB (U+00A0); +*/ + +//CHECK#1 +if (parseInt("\u00A01") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u00A01") === parseInt("1"). Actual: ' + (parseInt("\u00A01"))); +} + +//CHECK#2 +if (parseInt("\u00A0\u00A0-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u00A0\\u00A0-1") === parseInt("-1"). Actual: ' + (parseInt("\u00A0\u00A0-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u00A0")) !== true) { + $ERROR('#3: parseInt("\\u00A0") === Not-a-Number. Actual: ' + (parseInt("\u00A0"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T4.js new file mode 100644 index 000000000..eee47779d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T4.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T4; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: FF (U+000C); +*/ + +//CHECK#1 +if (parseInt("\u000C1") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u000C1") === parseInt("1"). Actual: ' + (parseInt("\u000C1"))); +} + +//CHECK#2 +if (parseInt("\u000C\u000C-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u000C\\u000C-1") === parseInt("-1"). Actual: ' + (parseInt("\u000C\u000C-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u000C")) !== true) { + $ERROR('#3: parseInt("\\u000C") === Not-a-Number. Actual: ' + (parseInt("\u000C"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T5.js new file mode 100644 index 000000000..0c91ec8d8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T5.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T5; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: VT (U+000B); +*/ + +//CHECK#1 +if (parseInt("\u000B1") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u000B1") === parseInt("1"). Actual: ' + (parseInt("\u000B1"))); +} + +//CHECK#2 +if (parseInt("\u000B\u000B-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u000B\\u000B-1") === parseInt("-1"). Actual: ' + (parseInt("\u000B\u000B-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u000B")) !== true) { + $ERROR('#3: parseInt("\\u000B") === Not-a-Number. Actual: ' + (parseInt("\u000B"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T6.js new file mode 100644 index 000000000..c5b51a76d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T6.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T6; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: CR (U+000D); +*/ + +//CHECK#1 +if (parseInt("\u000D1") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u000D1") === parseInt("1"). Actual: ' + (parseInt("\u000D1"))); +} + +//CHECK#2 +if (parseInt("\u000D\u000D-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u000D\\u000D-1") === parseInt("-1"). Actual: ' + (parseInt("\u000D\u000D-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u000D")) !== true) { + $ERROR('#3: parseInt("\\u000D") === Not-a-Number. Actual: ' + (parseInt("\u000D"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T7.js new file mode 100644 index 000000000..bdc17a25a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T7.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T7; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LF (U+000A); +*/ + +//CHECK#1 +if (parseInt("\u000A1") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u000A1") === parseInt("1"). Actual: ' + (parseInt("\u000A1"))); +} + +//CHECK#2 +if (parseInt("\u000A\u000A-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u000A\\u000A-1") === parseInt("-1"). Actual: ' + (parseInt("\u000A\u000A-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u000A")) !== true) { + $ERROR('#3: parseInt("\\u000A") === Not-a-Number. Actual: ' + (parseInt("\u000A"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T8.js new file mode 100644 index 000000000..670b39a5f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T8.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T8; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LS (U+2028); +*/ + +//CHECK#1 +if (parseInt("\u20281") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u20281") === parseInt("1"). Actual: ' + (parseInt("\u20281"))); +} + +//CHECK#2 +if (parseInt("\u2028\u2028-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u2028\\u2028-1") === parseInt("-1"). Actual: ' + (parseInt("\u2028\u2028-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u2028")) !== true) { + $ERROR('#3: parseInt("\\u2028") === Not-a-Number. Actual: ' + (parseInt("\u2028"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T9.js new file mode 100644 index 000000000..fa285aabe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A2_T9.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A2_T9; + * @section: 15.1.2.2; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: PS (U+2029); +*/ + +//CHECK#1 +if (parseInt("\u20291") !== parseInt("1")) { + $ERROR('#1: parseInt("\\u20291") === parseInt("1"). Actual: ' + (parseInt("\u20291"))); +} + +//CHECK#2 +if (parseInt("\u2029\u2029-1") !== parseInt("-1")) { + $ERROR('#2: parseInt("\\u2029\\u2029-1") === parseInt("-1"). Actual: ' + (parseInt("\u2029\u2029-1"))); +} + +//CHECK#3 +if (isNaN(parseInt("\u2029")) !== true) { + $ERROR('#3: parseInt("\\u2029") === Not-a-Number. Actual: ' + (parseInt("\u2029"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T1.js new file mode 100644 index 000000000..58450dd5b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.1_T1; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for boolean primitive; +*/ + +//CHECK#1 +if (parseInt("11", false) !== parseInt("11", 10)) { + $ERROR('#1: parseInt("11", false) === parseInt("11", 10). Actual: ' + (parseInt("11", false))); +} + +//CHECK#2 +if (isNaN(parseInt("11", true)) !== true) { + $ERROR('#2: parseInt("11", true) === Not-a-Number. Actual: ' + (parseInt("11", true))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T2.js new file mode 100644 index 000000000..4364a12ca --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T2.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.1_T2; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for string primitive; +*/ + +//CHECK#1 +if (parseInt("11", "2") !== parseInt("11", 2)) { + $ERROR('#1: parseInt("11", "2") === parseInt("11", 2). Actual: ' + (parseInt("11", "2"))); +} + +//CHECK#2 +if (parseInt("11", "0") !== parseInt("11", 10)) { + $ERROR('#2: parseInt("11", "0") === parseInt("11", 10). Actual: ' + (parseInt("11", "0"))); +} + +//CHECK#3 +if (parseInt("11", "") !== parseInt("11", 10)) { + $ERROR('#3: parseInt("11", "") === parseInt("11", 10). Actual: ' + (parseInt("11", ""))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T3.js new file mode 100644 index 000000000..7c6e15af2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T3.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.1.2.2_A3.1_T3; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for undefined and null; +*/ + +//CHECK#1 +if (parseInt("11", undefined) !== parseInt("11", 10)) { + $ERROR('#1: parseInt("11", undefined) === parseInt("11", 10). Actual: ' + (parseInt("11", undefined))); +} + +//CHECK#2 +if (parseInt("11", null) !== parseInt("11", 10)) { + $ERROR('#2: parseInt("11", null) === parseInt("11", 10). Actual: ' + (parseInt("11", null))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T4.js new file mode 100644 index 000000000..be3801661 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T4.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.1.2.2_A3.1_T4; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for Boolean object; +*/ + +//CHECK#1 +if (parseInt("11", new Boolean(false)) !== parseInt("11", false)) { + $ERROR('#1: parseInt("11", new Boolean(false)) === parseInt("11", false). Actual: ' + (parseInt("11", new Boolean(false)))); +} + +//CHECK#2 +if (isNaN(parseInt("11", new Boolean(true))) !== true) { + $ERROR('#2: parseInt("11", new Boolean(true)) === Not-a-Number. Actual: ' + (parseInt("11", new Boolean(true)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T5.js new file mode 100644 index 000000000..818eecc1a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T5.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.1.2.2_A3.1_T5; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for Number object; +*/ + +//CHECK#1 +if (parseInt("11", new Number(2)) !== parseInt("11", 2)) { + $ERROR('#1: parseInt("11", new Number(2)) === parseInt("11", 2). Actual: ' + (parseInt("11", new Number(2)))); +} + +//CHECK#2 +if (parseInt("11", new Number(Infinity)) !== parseInt("11", Infinity)) { + $ERROR('#2: parseInt("11", new Number(Infinity)) === parseInt("11", Infinity). Actual: ' + (parseInt("11", new Number(Infinity)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T6.js new file mode 100644 index 000000000..4886116f8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T6.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.1.2.2_A3.1_T6; + * @section: 15.1.2.2, 9.3; + * @assertion: Operator use ToNumber; + * @description: Checking for String object; +*/ + +//CHECK#1 +if (parseInt("11", new String("2")) !== parseInt("11", 2)) { + $ERROR('#1: parseInt("11", new String("2")) === parseInt("11", 2). Actual: ' + (parseInt("11", new String("2")))); +} + +//CHECK#2 +if (parseInt("11", new String("Infinity")) !== parseInt("11", Infinity)) { + $ERROR('#2: parseInt("11", new String("Infinity")) === parseInt("11", Infinity). Actual: ' + (parseInt("11", new String("Infinity")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T7.js new file mode 100644 index 000000000..1fe067f49 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.1_T7.js @@ -0,0 +1,78 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.1_T7; + * @section: 15.1.2.2, 9.3, 8.6.2.6; + * @assertion: Operator use ToNumber; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, Number); +*/ + +//CHECK#1 +var object = {valueOf: function() {return 2}}; +if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#1: var object = {valueOf: function() {return 2}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); +} + +//CHECK#2 +var object = {valueOf: function() {return 2}, toString: function() {return 1}}; +if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#2: var object = {valueOf: function() {return 2}, toString: function() {return 1}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); +} + +//CHECK#3 +var object = {valueOf: function() {return 2}, toString: function() {return {}}}; +if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#3: var object = {valueOf: function() {return 2}, toString: function() {return {}}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); +} + +//CHECK#4 +try { + var object = {valueOf: function() {return 2}, toString: function() {throw "error"}}; + if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#4.1: var object = {valueOf: function() {return 2}, toString: function() {throw "error"}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {return 2}, toString: function() {throw "error"}}; parseInt("11", object) not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {return 2}, toString: function() {throw "error"}}; parseInt("11", object) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return 2}}; +if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#5: var object = {toString: function() {return 2}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return 2}} +if (parseInt("11", object) !== parseInt("11", 2)) { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 2}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object))); +} + +//CHECK#7 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; + parseInt("11", object); + $ERROR('#7.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (parseInt("11", object))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + parseInt("11", object); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (parseInt("11", object))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T1.js new file mode 100644 index 000000000..34fab3c5a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.2_T1; + * @section: 15.1.2.2; + * @assertion: Operator use ToInt32; + * @description: If radix is NaN, +0, -0, +Infinity, -Infinity, return radix = +0; +*/ + +//CHECK#1 +if (parseInt("11", NaN) !== parseInt("11", 10)) { + $ERROR('#1: parseInt("11", NaN) === parseInt("11", 10). Actual: ' + (parseInt("11", NaN))); +} + +//CHECK#2 +if (parseInt("11", +0) !== parseInt("11", 10)) { + $ERROR('#2: parseInt("11", +0) === parseInt("11", 10). Actual: ' + (parseInt("11", +0))); +} + +//CHECK#3 +if (parseInt("11", -0) !== parseInt("11", 10)) { + $ERROR('#3: parseInt("11", -0) === parseInt("11", 10). Actual: ' + (parseInt("11", -0))); +} + +//CHECK#4 +if (parseInt("11", Number.POSITIVE_INFINITY) !== parseInt("11", 10)) { + $ERROR('#4: parseInt("11", Number.POSITIVE_INFINITY) === parseInt("11", 10). Actual: ' + (parseInt("11", Number.POSITIVE_INFINITY))); +} + +//CHECK#5 +if (parseInt("11", Number.NEGATIVE_INFINITY) !== parseInt("11", 10)) { + $ERROR('#5: parseInt("11", Number.NEGATIVE_INFINITY) === parseInt("11", 10). Actual: ' + (parseInt("11", Number.NEGATIVE_INFINITY))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T2.js new file mode 100644 index 000000000..c3e33816d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T2.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.2_T2; + * @section: 15.1.2.2; + * @assertion: Operator use ToInt32; + * @description: ToInt32 use floor; +*/ + +//CHECK#1 +if (parseInt("11", 2.1) !== parseInt("11", 2)) { + $ERROR('#1: parseInt("11", 2.1) === parseInt("11", 2). Actual: ' + (parseInt("11", 2.1))); +} + +//CHECK#2 +if (parseInt("11", 2.5) !== parseInt("11", 2)) { + $ERROR('#2: parseInt("11", 2.5) === parseInt("11", 2). Actual: ' + (parseInt("11", 2.5))); +} + +//CHECK#3 +if (parseInt("11", 2.9) !== parseInt("11", 2)) { + $ERROR('#3: parseInt("11", 2.9) === parseInt("11", 2). Actual: ' + (parseInt("11", 2.9))); +} + +//CHECK#4 +if (parseInt("11", 2.000000000001) !== parseInt("11", 2)) { + $ERROR('#4: parseInt("11", 2.000000000001) === parseInt("11", 2). Actual: ' + (parseInt("11", 2.000000000001))); +} + +//CHECK#5 +if (parseInt("11", 2.999999999999) !== parseInt("11", 2)) { + $ERROR('#5: parseInt("11", 2.999999999999) === parseInt("11", 2). Actual: ' + (parseInt("11", 2.999999999999))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T3.js new file mode 100644 index 000000000..59ddad564 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A3.2_T3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A3.2_T3; + * @section: 15.1.2.2; + * @assertion: Operator use ToInt32; + * @description: ToInt32 use modulo; +*/ + +//CHECK#1 +if (parseInt("11", 4294967298) !== parseInt("11", 2)) { + $ERROR('#1: parseInt("11", 4294967298) === parseInt("11", 2). Actual: ' + (parseInt("11", 4294967298))); +} + +//CHECK#2 +if (parseInt("11", 4294967296) !== parseInt("11", 10)) { + $ERROR('#2: parseInt("11", 4294967296) === parseInt("11", 10). Actual: ' + (parseInt("11", 4294967296))); +} + +//CHECK#3 +if (isNaN(parseInt("11", -2147483650)) !== true) { + $ERROR('#3: parseInt("11", 2147483650) === Not-a-Number. Actual: ' + (parseInt("11", 2147483650))); +} + +//CHECK#4 +if (parseInt("11", -4294967294) !== parseInt("11", 2)) { + $ERROR('#4: parseInt("11", -4294967294) === parseInt("11", 2). Actual: ' + (parseInt("11", -4294967294))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T1.js new file mode 100644 index 000000000..cc43895d3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T1.js @@ -0,0 +1,74 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A4.1_T1; + * @section: 15.1.2.2; + * @assertion: If R = 0 or R = undefined, then R = 10; + * @description: R = 0; +*/ + +//CHECK#0 +if (parseInt("0", 0) !== parseInt("0", 10)) { + $ERROR('#0: parseInt("0", 0) === parseInt("0", 10). Actual: ' + (parseInt("0", 0))); +} + +//CHECK#1 +if (parseInt("1", 0) !== parseInt("1", 10)) { + $ERROR('#1: parseInt("1", 0) === parseInt("01", 10). Actual: ' + (parseInt("1", 0))); +} + +//CHECK#2 +if (parseInt("2", 0) !== parseInt("2", 10)) { + $ERROR('#2: parseInt("2", 0) === parseInt("2", 10). Actual: ' + (parseInt("2", 0))); +} + +//CHECK#3 +if (parseInt("3", 0) !== parseInt("3", 10)) { + $ERROR('#3: parseInt("3", 0) === parseInt("3", 10). Actual: ' + (parseInt("3", 0))); +} + +//CHECK#4 +if (parseInt("4", 0) !== parseInt("4", 10)) { + $ERROR('#4: parseInt("4", 0) === parseInt(4", 10). Actual: ' + (parseInt("4", 0))); +} + +//CHECK#5 +if (parseInt("5", 0) !== parseInt("5", 10)) { + $ERROR('#5: parseInt("5", 0) === parseInt("5", 10). Actual: ' + (parseInt("5", 0))); +} + +//CHECK#6 +if (parseInt("6", 0) !== parseInt("6", 10)) { + $ERROR('#6: parseInt("6", 0) === parseInt("6", 10). Actual: ' + (parseInt("6", 0))); +} + +//CHECK#7 +if (parseInt("7", 0) !== parseInt("7", 10)) { + $ERROR('#7: parseInt("7", 0) === parseInt("7", 10). Actual: ' + (parseInt("7", 0))); +} + +//CHECK#8 +if (parseInt("8", 0) !== parseInt("8", 10)) { + $ERROR('#8: parseInt("8", 0) === parseInt("8", 10). Actual: ' + (parseInt("8", 0))); +} + +//CHECK#9 +if (parseInt("9", 0) !== parseInt("9", 10)) { + $ERROR('#9: parseInt("9", 0) === parseInt("9", 10). Actual: ' + (parseInt("9", 0))); +} + +//CHECK#10 +if (parseInt("10", 0) !== parseInt("10", 10)) { + $ERROR('#10: parseInt("10", 0) === parseInt("10", 10). Actual: ' + (parseInt("10", 0))); +} + +//CHECK#11 +if (parseInt("11", 0) !== parseInt("11", 10)) { + $ERROR('#11: parseInt("11", 0) === parseInt("11", 10). Actual: ' + (parseInt("11", 0))); +} + +//CHECK#12 +if (parseInt("9999", 0) !== parseInt("9999", 10)) { + $ERROR('#12: parseInt("9999", 0) === parseInt("9999", 10). Actual: ' + (parseInt("9999", 0))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T2.js new file mode 100644 index 000000000..230989c7d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.1_T2.js @@ -0,0 +1,74 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A4.1_T2; + * @section: 15.1.2.2; + * @assertion: If R = 0 or R = undefined, then R = 10; + * @description: R = undefined; +*/ + +//CHECK#0 +if (parseInt("0") !== parseInt("0", 10)) { + $ERROR('#0: parseInt("0") === parseInt("0", 10). Actual: ' + (parseInt("0"))); +} + +//CHECK#1 +if (parseInt("1") !== parseInt("1", 10)) { + $ERROR('#1: parseInt("1") === parseInt("01", 10). Actual: ' + (parseInt("1"))); +} + +//CHECK#2 +if (parseInt("2") !== parseInt("2", 10)) { + $ERROR('#2: parseInt("2") === parseInt("2", 10). Actual: ' + (parseInt("2"))); +} + +//CHECK#3 +if (parseInt("3") !== parseInt("3", 10)) { + $ERROR('#3: parseInt("3") === parseInt("3", 10). Actual: ' + (parseInt("3"))); +} + +//CHECK#4 +if (parseInt("4") !== parseInt("4", 10)) { + $ERROR('#4: parseInt("4") === parseInt(4", 10). Actual: ' + (parseInt("4"))); +} + +//CHECK#5 +if (parseInt("5") !== parseInt("5", 10)) { + $ERROR('#5: parseInt("5") === parseInt("5", 10). Actual: ' + (parseInt("5"))); +} + +//CHECK#6 +if (parseInt("6") !== parseInt("6", 10)) { + $ERROR('#6: parseInt("6") === parseInt("6", 10). Actual: ' + (parseInt("6"))); +} + +//CHECK#7 +if (parseInt("7") !== parseInt("7", 10)) { + $ERROR('#7: parseInt("7") === parseInt("7", 10). Actual: ' + (parseInt("7"))); +} + +//CHECK#8 +if (parseInt("8") !== parseInt("8", 10)) { + $ERROR('#8: parseInt("8") === parseInt("8", 10). Actual: ' + (parseInt("8"))); +} + +//CHECK#9 +if (parseInt("9") !== parseInt("9", 10)) { + $ERROR('#9: parseInt("9") === parseInt("9", 10). Actual: ' + (parseInt("9"))); +} + +//CHECK#10 +if (parseInt("10") !== parseInt("10", 10)) { + $ERROR('#10: parseInt("10") === parseInt("10", 10). Actual: ' + (parseInt("10"))); +} + +//CHECK#11 +if (parseInt("11") !== parseInt("11", 10)) { + $ERROR('#11: parseInt("11") === parseInt("11", 10). Actual: ' + (parseInt("11"))); +} + +//CHECK#12 +if (parseInt("9999") !== parseInt("9999", 10)) { + $ERROR('#12: parseInt("9999") === parseInt("9999", 10). Actual: ' + (parseInt("9999"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T1.js new file mode 100644 index 000000000..9e0c8fb23 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T1.js @@ -0,0 +1,69 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A4.2_T1; + * @section: 15.1.2.2; + * @assertion: If R < 2 or R > 36, then return NaN; + * @description: R = 1; +*/ + +//CHECK#0 +if (isNaN(parseInt("0", 1)) !== true) { + $ERROR('#0: parseInt("0", 1) === Not-a-Number. Actual: ' + (parseInt("0", 1))); +} + +//CHECK#1 +if (isNaN(parseInt("1", 1)) !== true) { + $ERROR('#1: parseInt("1", 1) === Not-a-Number. Actual: ' + (parseInt("1", 1))); +} + +//CHECK#2 +if (isNaN(parseInt("2", 1)) !== true) { + $ERROR('#2: parseInt("2", 1) === Not-a-Number. Actual: ' + (parseInt("2", 1))); +} + +//CHECK#3 +if (isNaN(parseInt("3", 1)) !== true) { + $ERROR('#3: parseInt("3", 1) === Not-a-Number. Actual: ' + (parseInt("3", 1))); +} + +//CHECK#4 +if (isNaN(parseInt("4", 1)) !== true) { + $ERROR('#4: parseInt("4", 1) === Not-a-Number. Actual: ' + (parseInt("4", 1))); +} + +//CHECK#5 +if (isNaN(parseInt("5", 1)) !== true) { + $ERROR('#5: parseInt("5", 1) === Not-a-Number. Actual: ' + (parseInt("5", 1))); +} + +//CHECK#6 +if (isNaN(parseInt("6", 1)) !== true) { + $ERROR('#6: parseInt("6", 1) === Not-a-Number. Actual: ' + (parseInt("6", 1))); +} + +//CHECK#7 +if (isNaN(parseInt("7", 1)) !== true) { + $ERROR('#7: parseInt("7", 1) === Not-a-Number. Actual: ' + (parseInt("7", 1))); +} + +//CHECK#8 +if (isNaN(parseInt("8", 1)) !== true) { + $ERROR('#8: parseInt("8", 1) === Not-a-Number. Actual: ' + (parseInt("8", 1))); +} + +//CHECK#9 +if (isNaN(parseInt("9", 1)) !== true) { + $ERROR('#9: parseInt("9", 1) === Not-a-Number. Actual: ' + (parseInt("9", 1))); +} + +//CHECK#10 +if (isNaN(parseInt("10", 1)) !== true) { + $ERROR('#10: parseInt("10", 1) === Not-a-Number. Actual: ' + (parseInt("10", 1))); +} + +//CHECK#11 +if (isNaN(parseInt("11", 1)) !== true) { + $ERROR('#11: parseInt("11", 1) === Not-a-Number. Actual: ' + (parseInt("11", 1))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T2.js new file mode 100644 index 000000000..571c58cfa --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T2.js @@ -0,0 +1,69 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A4.2_T2; + * @section: 15.1.2.2; + * @assertion: If R < 2 or R > 36, then return NaN; + * @description: R = 37; +*/ + +//CHECK#0 +if (isNaN(parseInt("0", 37)) !== true) { + $ERROR('#0: parseInt("0", 37) === Not-a-Number. Actual: ' + (parseInt("0", 37))); +} + +//CHECK#1 +if (isNaN(parseInt("1", 37)) !== true) { + $ERROR('#1: parseInt("1", 37) === Not-a-Number. Actual: ' + (parseInt("1", 37))); +} + +//CHECK#2 +if (isNaN(parseInt("2", 37)) !== true) { + $ERROR('#2: parseInt("2", 37) === Not-a-Number. Actual: ' + (parseInt("2", 37))); +} + +//CHECK#3 +if (isNaN(parseInt("3", 37)) !== true) { + $ERROR('#3: parseInt("3", 37) === Not-a-Number. Actual: ' + (parseInt("3", 37))); +} + +//CHECK#4 +if (isNaN(parseInt("4", 37)) !== true) { + $ERROR('#4: parseInt("4", 37) === Not-a-Number. Actual: ' + (parseInt("4", 37))); +} + +//CHECK#5 +if (isNaN(parseInt("5", 37)) !== true) { + $ERROR('#5: parseInt("5", 37) === Not-a-Number. Actual: ' + (parseInt("5", 37))); +} + +//CHECK#6 +if (isNaN(parseInt("6", 37)) !== true) { + $ERROR('#6: parseInt("6", 37) === Not-a-Number. Actual: ' + (parseInt("6", 37))); +} + +//CHECK#7 +if (isNaN(parseInt("7", 37)) !== true) { + $ERROR('#7: parseInt("7", 37) === Not-a-Number. Actual: ' + (parseInt("7", 37))); +} + +//CHECK#8 +if (isNaN(parseInt("8", 37)) !== true) { + $ERROR('#8: parseInt("8", 37) === Not-a-Number. Actual: ' + (parseInt("8", 37))); +} + +//CHECK#9 +if (isNaN(parseInt("9", 37)) !== true) { + $ERROR('#9: parseInt("9", 37) === Not-a-Number. Actual: ' + (parseInt("9", 37))); +} + +//CHECK#10 +if (isNaN(parseInt("10", 37)) !== true) { + $ERROR('#10: parseInt("10", 37) === Not-a-Number. Actual: ' + (parseInt("10", 37))); +} + +//CHECK#11 +if (isNaN(parseInt("11", 37)) !== true) { + $ERROR('#11: parseInt("11", 37) === Not-a-Number. Actual: ' + (parseInt("11", 37))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T3.js new file mode 100644 index 000000000..414f29322 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A4.2_T3.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A4.2_T3; + * @section: 15.1.2.2; + * @assertion: If R < 2 or R > 36, then return NaN; + * @description: Complex test; +*/ + +//CHECK# +var pow = 2; +for (var i = 1; i < 32; i++) { + if (pow > 36) { + var res = true; + if (isNaN(parseInt(1, pow)) !== true) { + $ERROR('#1.' + i + ': If R < 2 or R > 36, then return NaN'); + } + if (isNaN(parseInt(1, -pow)) !== true) { + $ERROR('#2.' + i + ': If R < 2 or R > 36, then return NaN'); + } + } + pow = pow * 2; +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.1_T1.js new file mode 100644 index 000000000..f0038dc61 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A5.1_T1; + * @section: 15.1.2.2; + * @assertion: If the length of S is at least 1 and the first character of S is 0, + * then at the implementation's discretion either let R = 8 or R = 10; + * @description: Either R = 8, or R = 10; +*/ + +//CHECK# +var res8 = 1; +var res10 = 1; +if (parseInt("08") !== parseInt("08", 8)) { + res8 = 0; +} +if (parseInt("08") !== parseInt("08", 10)) { + res10 = 0; +} +if (parseInt("09") !== parseInt("09", 8)) { + res8 = 0; +} +if (parseInt("09") !== parseInt("09", 10)) { + res10 = 0; +} +if (parseInt("010") !== parseInt("010", 8)) { + res8 = 0; +} +if (parseInt("010") !== parseInt("010", 10)) { + res10 = 0; +} +if (res8 + res10 !== 1) { + $ERROR('#1: If the length of S is at least 1 and the first character of S is 0, then at the implementation\'s discretion either let R = 8 or R = 10'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T1.js new file mode 100644 index 000000000..d26b2ae82 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T1.js @@ -0,0 +1,100 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A5.2_T1; + * @section: 15.1.2.2; + * @assertion: If the length of S is at least 2 and the first two characters of S + * are either 0x or 0X, then remove the first two characters from S and let R = 16; + * @description: : 0x; +*/ + +//CHECK#0 +if (parseInt("0x0", 0) !== parseInt("0", 16)) { + $ERROR('#0: parseInt("0x0", 0) === parseInt("0", 16). Actual: ' + (parseInt("0x0", 0))); +} + +//CHECK#1 +if (parseInt("0x1", 0) !== parseInt("1", 16)) { + $ERROR('#1: parseInt("0x1", 0) === parseInt("1", 16). Actual: ' + (parseInt("0x1", 0))); +} + +//CHECK#2 +if (parseInt("0x2", 0) !== parseInt("2", 16)) { + $ERROR('#2: parseInt("0x2", 0) === parseInt("2", 16). Actual: ' + (parseInt("0x2", 0))); +} + +//CHECK#3 +if (parseInt("0x3", 0) !== parseInt("3", 16)) { + $ERROR('#3: parseInt("0x3", 0) === parseInt("3", 16). Actual: ' + (parseInt("0x3", 0))); +} + +//CHECK#4 +if (parseInt("0x4", 0) !== parseInt("4", 16)) { + $ERROR('#4: parseInt("0x4", 0) === parseInt("4", 16). Actual: ' + (parseInt("0x4", 0))); +} + +//CHECK#5 +if (parseInt("0x5", 0) !== parseInt("5", 16)) { + $ERROR('#5: parseInt("0x5", 0) === parseInt("5", 16). Actual: ' + (parseInt("0x5", 0))); +} + +//CHECK#6 +if (parseInt("0x6", 0) !== parseInt("6", 16)) { + $ERROR('#6: parseInt("0x6", 0) === parseInt("6", 16). Actual: ' + (parseInt("0x6", 0))); +} + +//CHECK#7 +if (parseInt("0x7", 0) !== parseInt("7", 16)) { + $ERROR('#7: parseInt("0x7", 0) === parseInt("7", 16). Actual: ' + (parseInt("0x7", 0))); +} + +//CHECK#8 +if (parseInt("0x8", 0) !== parseInt("8", 16)) { + $ERROR('#8: parseInt("0x8", 0) === parseInt("8", 16). Actual: ' + (parseInt("0x8", 0))); +} + +//CHECK#9 +if (parseInt("0x9", 0) !== parseInt("9", 16)) { + $ERROR('#9: parseInt("0x9", 0) === parseInt("9", 16). Actual: ' + (parseInt("0x9", 0))); +} + +//CHECK#A +if (parseInt("0xA", 0) !== parseInt("A", 16)) { + $ERROR('#A: parseInt("0xA", 0) === parseInt("A", 16). Actual: ' + (parseInt("0xA", 0))); +} + +//CHECK#B +if (parseInt("0xB", 0) !== parseInt("B", 16)) { + $ERROR('#B: parseInt("0xB", 0) === parseInt("B", 16). Actual: ' + (parseInt("0xB", 0))); +} + +//CHECK#C +if (parseInt("0xC", 0) !== parseInt("C", 16)) { + $ERROR('#C: parseInt("0xC", 0) === parseInt("C", 16). Actual: ' + (parseInt("0xC", 0))); +} + +//CHECK#D +if (parseInt("0xD", 0) !== parseInt("D", 16)) { + $ERROR('#D: parseInt("0xD", 0) === parseInt("D", 16). Actual: ' + (parseInt("0xD", 0))); +} + +//CHECK#E +if (parseInt("0xE", 0) !== parseInt("E", 16)) { + $ERROR('#E: parseInt("0xE", 0) === parseInt("E", 16). Actual: ' + (parseInt("0xE", 0))); +} + +//CHECK#F +if (parseInt("0xF", 0) !== parseInt("F", 16)) { + $ERROR('#F: parseInt("0xF", 0) === parseInt("F", 16). Actual: ' + (parseInt("0xF", 0))); +} + +//CHECK#E +if (parseInt("0xE", 0) !== parseInt("E", 16)) { + $ERROR('#E: parseInt("0xE", 0) === parseInt("E", 16). Actual: ' + (parseInt("0xE", 0))); +} + +//CHECK#ABCDEF +if (parseInt("0xABCDEF", 0) !== parseInt("ABCDEF", 16)) { + $ERROR('#ABCDEF: parseInt("0xABCDEF", 0) === parseInt("ABCDEF", 16). Actual: ' + (parseInt("0xABCDEF", 0))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T2.js new file mode 100644 index 000000000..bcf86389d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A5.2_T2.js @@ -0,0 +1,100 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A5.2_T2; + * @section: 15.1.2.2; + * @assertion: If the length of S is at least 2 and the first two characters of S + * are either 0x or 0X, then remove the first two characters from S and let R = 16; + * @description: : 0X; +*/ + +//CHECK#0 +if (parseInt("0X0", 0) !== parseInt("0", 16)) { + $ERROR('#0: parseInt("0X0", 0) === parseInt("0", 16). Actual: ' + (parseInt("0X0", 0))); +} + +//CHECK#1 +if (parseInt("0X1") !== parseInt("1", 16)) { + $ERROR('#1: parseInt("0X1") === parseInt("1", 16). Actual: ' + (parseInt("0X1"))); +} + +//CHECK#2 +if (parseInt("0X2") !== parseInt("2", 16)) { + $ERROR('#2: parseInt("0X2") === parseInt("2", 16). Actual: ' + (parseInt("0X2"))); +} + +//CHECK#3 +if (parseInt("0X3") !== parseInt("3", 16)) { + $ERROR('#3: parseInt("0X3") === parseInt("3", 16). Actual: ' + (parseInt("0X3"))); +} + +//CHECK#4 +if (parseInt("0X4") !== parseInt("4", 16)) { + $ERROR('#4: parseInt("0X4") === parseInt("4", 16). Actual: ' + (parseInt("0X4"))); +} + +//CHECK#5 +if (parseInt("0X5") !== parseInt("5", 16)) { + $ERROR('#5: parseInt("0X5") === parseInt("5", 16). Actual: ' + (parseInt("0X5"))); +} + +//CHECK#6 +if (parseInt("0X6") !== parseInt("6", 16)) { + $ERROR('#6: parseInt("0X6") === parseInt("6", 16). Actual: ' + (parseInt("0X6"))); +} + +//CHECK#7 +if (parseInt("0X7") !== parseInt("7", 16)) { + $ERROR('#7: parseInt("0X7") === parseInt("7", 16). Actual: ' + (parseInt("0X7"))); +} + +//CHECK#8 +if (parseInt("0X8") !== parseInt("8", 16)) { + $ERROR('#8: parseInt("0X8") === parseInt("8", 16). Actual: ' + (parseInt("0X8"))); +} + +//CHECK#9 +if (parseInt("0X9") !== parseInt("9", 16)) { + $ERROR('#9: parseInt("0X9") === parseInt("9", 16). Actual: ' + (parseInt("0X9"))); +} + +//CHECK#A +if (parseInt("0XA") !== parseInt("A", 16)) { + $ERROR('#A: parseInt("0XA") === parseInt("A", 16). Actual: ' + (parseInt("0XA"))); +} + +//CHECK#B +if (parseInt("0XB") !== parseInt("B", 16)) { + $ERROR('#B: parseInt("0XB") === parseInt("B", 16). Actual: ' + (parseInt("0XB"))); +} + +//CHECK#C +if (parseInt("0XC") !== parseInt("C", 16)) { + $ERROR('#C: parseInt("0XC") === parseInt("C", 16). Actual: ' + (parseInt("0XC"))); +} + +//CHECK#D +if (parseInt("0XD") !== parseInt("D", 16)) { + $ERROR('#D: parseInt("0XD") === parseInt("D", 16). Actual: ' + (parseInt("0XD"))); +} + +//CHECK#E +if (parseInt("0XE") !== parseInt("E", 16)) { + $ERROR('#E: parseInt("0XE") === parseInt("E", 16). Actual: ' + (parseInt("0XE"))); +} + +//CHECK#F +if (parseInt("0XF") !== parseInt("F", 16)) { + $ERROR('#F: parseInt("0XF") === parseInt("F", 16). Actual: ' + (parseInt("0XF"))); +} + +//CHECK#E +if (parseInt("0XE") !== parseInt("E", 16)) { + $ERROR('#E: parseInt("0XE") === parseInt("E", 16). Actual: ' + (parseInt("0XE"))); +} + +//CHECK#ABCDEF +if (parseInt("0XABCDEF") !== parseInt("ABCDEF", 16)) { + $ERROR('#ABCDEF: parseInt("0XABCDEF") === parseInt("ABCDEF", 16). Actual: ' + (parseInt("0XABCDEF"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T1.js new file mode 100644 index 000000000..32a873c7f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T1.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A6.1_T1; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. R in [2, 36]; +*/ + +//CHECK# +for (var i = 2; i <= 36; i++) { + if (parseInt("10$1", i) !== i) { + $ERROR('#' + i +': i = ' + i + 'parseInt("10$1", i) === i. Actual: ' + (parseInt("10$1", i))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T2.js new file mode 100644 index 000000000..51469579c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T2.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.1.2.2_A6.1_T2; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. Radix-R notation in [0..9, A-Z]; +*/ + +//CHECK# +var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; +for (var i = 2; i <= 36; i++) { + if (parseInt(R_digit[i - 2] + "$", i) !== i - 1) { + $ERROR('#' + i + ': '); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T3.js new file mode 100644 index 000000000..9eca01526 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T3.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.1.2.2_A6.1_T3; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. Radix-R notation in [0..9, a-z]; +*/ + +//CHECK# +var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +for (var i = 2; i <= 36; i++) { + if (parseInt(R_digit[i - 2] + "$", i) !== i - 1) { + $ERROR('#' + i + ': '); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T4.js new file mode 100644 index 000000000..899ed126d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T4.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.1.2.2_A6.1_T4; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. Radix-R notation in [0..9, A-Z]; +*/ + +//CHECK# +var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; +for (var i = 2; i <= 35; i++) { + if (parseInt(R_digit[i - 2] + R_digit[i - 1], i) !== i - 1) { + $ERROR('#' + i + ': '); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T5.js new file mode 100644 index 000000000..1b3f9dd39 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T5.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.1.2.2_A6.1_T5; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. Radix-R notation in [0..9, a-z]; +*/ + +//CHECK# +var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +for (var i = 2; i <= 35; i++) { + if (parseInt(R_digit[i - 2] + R_digit[i - 1], i) !== i - 1) { + $ERROR('#' + i + ': '); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T6.js new file mode 100644 index 000000000..1c7a9da44 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A6.1_T6.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A6.1_T6; + * @section: 15.1.2.2; + * @assertion: If S contains any character that is not a radix-R digit, + * then let Z be the substring of S consisting of all characters before + * the first such character; otherwise, let Z be S; + * @description: Complex test. Radix-R notation in [0..9]; +*/ + +//CHECK#2 +if (parseInt("0123456789", 2) !== 1) { + $ERROR('#2: parseInt("0123456789", 2) === 1. Actual: ' + (parseInt("0123456789", 2))); +} + +//CHECK#3 +if (parseInt("01234567890", 3) !== 5) { + $ERROR('#3: parseInt("01234567890", 3) === 5. Actual: ' + (parseInt("01234567890", 3))); +} + +//CHECK#4 +if (parseInt("01234567890", 4) !== 27) { + $ERROR('#4: parseInt("01234567890", 4) === 27. Actual: ' + (parseInt("01234567890", 4))); +} + +//CHECK#5 +if (parseInt("01234567890", 5) !== 194) { + $ERROR('#5: parseInt("01234567890", 5) === 194. Actual: ' + (parseInt("01234567890", 5))); +} + +//CHECK#6 +if (parseInt("01234567890", 6) !== 1865) { + $ERROR('#6: parseInt("01234567890", 6) === 1865. Actual: ' + (parseInt("01234567890", 6))); +} + +//CHECK#7 +if (parseInt("01234567890", 7) !== 22875) { + $ERROR('#7: parseInt("01234567890", 7) === 22875. Actual: ' + (parseInt("01234567890", 7))); +} + +//CHECK#8 +if (parseInt("01234567890", 8) !== 342391) { + $ERROR('#8: parseInt("01234567890", 8) === 342391. Actual: ' + (parseInt("01234567890", 8))); +} + +//CHECK#9 +if (parseInt("01234567890", 9) !== 6053444) { + $ERROR('#9: parseInt("01234567890", 9) === 6053444. Actual: ' + (parseInt("01234567890", 9))); +} + +//CHECK#10 +if (parseInt("01234567890", 10) !== Number(1234567890)) { + $ERROR('#10: parseInt("01234567890", 10) === Number(1234567890). Actual: ' + (parseInt("01234567890", 10))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T1.js new file mode 100644 index 000000000..82de152e3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T1.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.1_T1; + * @section: 15.1.2.2; + * @assertion: If Z is empty, return NaN; + * @description: Complex test. R in [2, 36]; +*/ + +//CHECK# +for (var i = 2; i <= 36; i++) { + if (isNaN(parseInt("$string", i)) !== true) { + $ERROR('#' + i + ': parseInt("$string", i) === Not-a-Number. Actual: ' + (parseInt("$string", i))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T2.js new file mode 100644 index 000000000..7d4a82162 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.1_T2.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.1_T2; + * @section: 15.1.2.2; + * @assertion: If Z is empty, return NaN; + * @description: x is not a radix-R digit; +*/ + +//CHECK#1 +if (isNaN(parseInt("$0x")) !== true) { + $ERROR('#1: parseInt("$0x") === Not-a-Number. Actual: ' + (parseInt("$0x"))); +} + +//CHECK#2 +if (isNaN(parseInt("$0X")) !== true) { + $ERROR('#2: parseInt("$0X") === Not-a-Number. Actual: ' + (parseInt("$0X"))); +} + +//CHECK#3 +if (isNaN(parseInt("$$$")) !== true) { + $ERROR('#3: parseInt("$$$") === Not-a-Number. Actual: ' + (parseInt("$$$"))); +} + +//CHECK#4 +if (isNaN(parseInt("")) !== true) { + $ERROR('#4: parseInt("") === Not-a-Number. Actual: ' + (parseInt(""))); +} + +//CHECK#5 +if (isNaN(parseInt(" ")) !== true) { + $ERROR('#5: parseInt(" ") === Not-a-Number. Actual: ' + (parseInt(" "))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T1.js new file mode 100644 index 000000000..a7e2feac7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.2_T1; + * @section: 15.1.2.2; + * @assertion: Compute the mathematical integer value + * that is represented by Z in radix-R notation, using the + * letters A-Z and a-z for digits with values 10 through 35. + * Compute the number value for Result(16); + * @description: Complex test. Check algorithm; +*/ + +//CHECK# +var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; +var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +for (var i = 2; i <= 36; i++) { + for (var j = 0; j < 10; j++) { + var str = ""; + var num = 0; + var pow = 1; + var k0 = Math.max(2, i - j); + for (var k = k0; k <= i; k++) { + if (k % 2 === 0) { + str = str + R_digit1[k - 2]; + } else { + str = str + R_digit2[k - 2]; + } + num = num + (i + (k0 - k) - 1) * pow; + pow = pow * i; + } + if (parseInt(str, i) !== num) { + $ERROR('#' + i + '.' + j + ' : '); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T2.js new file mode 100644 index 000000000..86af2de0f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T2.js @@ -0,0 +1,112 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.2_T2; + * @section: 15.1.2.2; + * @assertion: Compute the mathematical integer value + * that is represented by Z in radix-R notation, using the + * letters A-Z and a-z for digits with values 10 through 35. + * Compute the number value for Result(16); + * @description: Checking algorithm for R = 2; +*/ + +//CHECK#1 +if (parseInt("1", 2) !== 1) { + $ERROR('#1: parseInt("1", 2) === 1. Actual: ' + (parseInt("1", 2))); +} + +//CHECK#2 +if (parseInt("11", 2) !== 3) { + $ERROR('#2: parseInt("11", 2) === 3. Actual: ' + (parseInt("11", 2))); +} + +//CHECK#3 +if (parseInt("111", 2) !== 7) { + $ERROR('#3: parseInt("111", 2) === 7. Actual: ' + (parseInt("111", 2))); +} + +//CHECK#4 +if (parseInt("1111", 2) !== 15) { + $ERROR('#4: parseInt("1111", 2) === 15. Actual: ' + (parseInt("1111", 2))); +} + +//CHECK#5 +if (parseInt("11111", 2) !== 31) { + $ERROR('#5: parseInt("11111", 2) === 31. Actual: ' + (parseInt("11111", 2))); +} + +//CHECK#6 +if (parseInt("111111", 2) !== 63) { + $ERROR('#6: parseInt("111111", 2) === 63. Actual: ' + (parseInt("111111", 2))); +} + +//CHECK#7 +if (parseInt("1111111", 2) !== 127) { + $ERROR('#7: parseInt("1111111", 2) === 127. Actual: ' + (parseInt("1111111", 2))); +} + +//CHECK#8 +if (parseInt("11111111", 2) !== 255) { + $ERROR('#8: parseInt("11111111", 2) === 255. Actual: ' + (parseInt("11111111", 2))); +} + +//CHECK#9 +if (parseInt("111111111", 2) !== 511) { + $ERROR('#9: parseInt("111111111", 2) === 511. Actual: ' + (parseInt("111111111", 2))); +} + +//CHECK#10 +if (parseInt("1111111111", 2) !== 1023) { + $ERROR('#10: parseInt("1111111111", 2) === 1023. Actual: ' + (parseInt("1111111111", 2))); +} + +//CHECK#11 +if (parseInt("11111111111", 2) !== 2047) { + $ERROR('#11: parseInt("11111111111", 2) === 2047. Actual: ' + (parseInt("11111111111", 2))); +} + +//CHECK#12 +if (parseInt("111111111111", 2) !== 4095) { + $ERROR('#12: parseInt("111111111111", 2) === 4095. Actual: ' + (parseInt("111111111111", 2))); +} + +//CHECK#13 +if (parseInt("1111111111111", 2) !== 8191) { + $ERROR('#13: parseInt("1111111111111", 2) === 8191. Actual: ' + (parseInt("1111111111111", 2))); +} + +//CHECK#14 +if (parseInt("11111111111111", 2) !== 16383) { + $ERROR('#14: parseInt("11111111111111", 2) === 16383. Actual: ' + (parseInt("11111111111111", 2))); +} + +//CHECK#15 +if (parseInt("111111111111111", 2) !== 32767) { + $ERROR('#15: parseInt("111111111111111", 2) === 32767. Actual: ' + (parseInt("111111111111111", 2))); +} + +//CHECK#16 +if (parseInt("1111111111111111", 2) !== 65535) { + $ERROR('#16: parseInt("1111111111111111", 2) === 65535. Actual: ' + (parseInt("1111111111111111", 2))); +} + +//CHECK#17 +if (parseInt("11111111111111111", 2) !== 131071) { + $ERROR('#17: parseInt("11111111111111111", 2) === 131071. Actual: ' + (parseInt("11111111111111111", 2))); +} + +//CHECK#18 +if (parseInt("111111111111111111", 2) !== 262143) { + $ERROR('#18: parseInt("111111111111111111", 2) === 262143. Actual: ' + (parseInt("111111111111111111", 2))); +} + +//CHECK#19 +if (parseInt("1111111111111111111", 2) !== 524287) { + $ERROR('#19: parseInt("1111111111111111111", 2) === 524287. Actual: ' + (parseInt("1111111111111111111", 2))); +} + +//CHECK#20 +if (parseInt("11111111111111111111", 2) !== 1048575) { + $ERROR('#20: parseInt("11111111111111111111", 2) === 1048575. Actual: ' + (parseInt("11111111111111111111", 2))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T3.js new file mode 100644 index 000000000..90b855ef0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.2_T3.js @@ -0,0 +1,112 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.2_T3; + * @section: 15.1.2.2; + * @assertion: Compute the mathematical integer value + * that is represented by Z in radix-R notation, using the + * letters A-Z and a-z for digits with values 10 through 35. + * Compute the number value for Result(16); + * @description: Checking algorithm for R = 16; +*/ + +//CHECK#1 +if (parseInt("0x1", 16) !== 1) { + $ERROR('#1: parseInt("0x1", 16) === 1. Actual: ' + (parseInt("0x1", 16))); +} + +//CHECK#2 +if (parseInt("0X10", 16) !== 16) { + $ERROR('#2: parseInt("0X10", 16) === 16. Actual: ' + (parseInt("0X10", 16))); +} + +//CHECK#3 +if (parseInt("0x100", 16) !== 256) { + $ERROR('#3: parseInt("0x100", 16) === 256. Actual: ' + (parseInt("0x100", 16))); +} + +//CHECK#4 +if (parseInt("0X1000", 16) !== 4096) { + $ERROR('#4: parseInt("0X1000", 16) === 4096. Actual: ' + (parseInt("0X1000", 16))); +} + +//CHECK#5 +if (parseInt("0x10000", 16) !== 65536) { + $ERROR('#5: parseInt("0x10000", 16) === 65536. Actual: ' + (parseInt("0x10000", 16))); +} + +//CHECK#6 +if (parseInt("0X100000", 16) !== 1048576) { + $ERROR('#6: parseInt("x100000", 16) === 1048576. Actual: ' + (parseInt("x100000", 16))); +} + +//CHECK#7 +if (parseInt("0x1000000", 16) !== 16777216) { + $ERROR('#7: parseInt("0x1000000", 16) === 16777216. Actual: ' + (parseInt("0x1000000", 16))); +} + +//CHECK#8 +if (parseInt("0x10000000", 16) !== 268435456) { + $ERROR('#8: parseInt("0x10000000", 16) === 268435456. Actual: ' + (parseInt("0x10000000", 16))); +} + +//CHECK#9 +if (parseInt("0x100000000", 16) !== 4294967296) { + $ERROR('#9: parseInt("0x100000000", 16) === 4294967296. Actual: ' + (parseInt("0x100000000", 16))); +} + +//CHECK#10 +if (parseInt("0x1000000000", 16) !== 68719476736) { + $ERROR('#10: parseInt("0x1000000000", 16) === 68719476736. Actual: ' + (parseInt("0x1000000000", 16))); +} + +//CHECK#10 +if (parseInt("0x10000000000", 16) !== 1099511627776) { + $ERROR('#10: parseInt("0x10000000000", 16) === 1099511627776. Actual: ' + (parseInt("0x10000000000", 16))); +} + +//CHECK#12 +if (parseInt("0x100000000000", 16) !== 17592186044416) { + $ERROR('#12: parseInt("0x100000000000", 16) === 17592186044416. Actual: ' + (parseInt("0x100000000000", 16))); +} + +//CHECK#13 +if (parseInt("0x1000000000000", 16) !== 281474976710656) { + $ERROR('#13: parseInt("0x1000000000000", 16) === 281474976710656. Actual: ' + (parseInt("0x1000000000000", 16))); +} + +//CHECK#14 +if (parseInt("0x10000000000000", 16) !== 4503599627370496) { + $ERROR('#14: parseInt("0x10000000000000", 16) === 4503599627370496. Actual: ' + (parseInt("0x10000000000000", 16))); +} + +//CHECK#15 +if (parseInt("0x100000000000000", 16) !== 72057594037927936) { + $ERROR('#15: parseInt("0x100000000000000", 16) === 72057594037927936. Actual: ' + (parseInt("0x100000000000000", 16))); +} + +//CHECK#16 +if (parseInt("0x1000000000000000", 16) !== 1152921504606846976) { + $ERROR('#16: parseInt("0x1000000000000000", 16) === 1152921504606846976. Actual: ' + (parseInt("0x1000000000000000", 16))); +} + +//CHECK#17 +if (parseInt("0x10000000000000000", 16) !== 18446744073709551616) { + $ERROR('#17: parseInt("0x10000000000000000", 16) === 18446744073709551616. Actual: ' + (parseInt("0x10000000000000000", 16))); +} + +//CHECK#18 +if (parseInt("0x100000000000000000", 16) !== 295147905179352825856) { + $ERROR('#18: parseInt("0x100000000000000000", 16) === 295147905179352825856. Actual: ' + (parseInt("0x100000000000000000", 16))); +} + +//CHECK#19 +if (parseInt("0x1000000000000000000", 16) !== 4722366482869645213696) { + $ERROR('#19: parseInt("0x1000000000000000000", 16) === 4722366482869645213696. Actual: ' + (parseInt("0x1000000000000000000", 16))); +} + +//CHECK#20 +if (parseInt("0x10000000000000000000", 16) !== 75557863725914323419136) { + $ERROR('#20: parseInt("0x10000000000000000000", 16) === 75557863725914323419136. Actual: ' + (parseInt("0x10000000000000000000", 16))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T1.js new file mode 100644 index 000000000..9fa19756e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T1.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.3_T1; + * @section: 15.1.2.2; + * @assertion: Return sign * Result(17); + * @description: Complex test. Check algorithm; +*/ + +//CHECK# +var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; +var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; +for (var i = 2; i <= 36; i++) { + for (var j = 0; j < 10; j++) { + var str = "+"; + var sign = 1; + if (j % 2 !== 0) { + str = "-"; + sign= -1; + } + var num = 0; + var pow = 1; + var k0 = Math.max(2, i - j); + for (var k = k0; k <= i; k++) { + if (k % 2 === 0) { + str = str + R_digit1[k - 2]; + } else { + str = str + R_digit2[k - 2]; + } + num = num + (i + (k0 - k) - 1) * pow; + pow = pow * i; + } + if (parseInt(str, i) !== num * sign) { + $ERROR('#' + i + '.' + j + ' : '); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T2.js new file mode 100644 index 000000000..8ca4598c6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T2.js @@ -0,0 +1,109 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.3_T2; + * @section: 15.1.2.2; + * @assertion: Return sign * Result(17); + * @description: Checking algorithm for R = 2; +*/ + +//CHECK#1 +if (parseInt("-1", 2) !== -1) { + $ERROR('#1: parseInt("-1", 2) === -1. Actual: ' + (parseInt("-1", 2))); +} + +//CHECK#2 +if (parseInt("-11", 2) !== -3) { + $ERROR('#2: parseInt("-11", 2) === -3. Actual: ' + (parseInt("-11", 2))); +} + +//CHECK#3 +if (parseInt("-111", 2) !== -7) { + $ERROR('#3: parseInt("-111", 2) === -7. Actual: ' + (parseInt("-111", 2))); +} + +//CHECK#4 +if (parseInt("-1111", 2) !== -15) { + $ERROR('#4: parseInt("-1111", 2) === -15. Actual: ' + (parseInt("-1111", 2))); +} + +//CHECK#5 +if (parseInt("-11111", 2) !== -31) { + $ERROR('#5: parseInt("-11111", 2) === -31. Actual: ' + (parseInt("-11111", 2))); +} + +//CHECK#6 +if (parseInt("-111111", 2) !== -63) { + $ERROR('#6: parseInt("-111111", 2) === -63. Actual: ' + (parseInt("-111111", 2))); +} + +//CHECK#7 +if (parseInt("-1111111", 2) !== -127) { + $ERROR('#7: parseInt("-1111111", 2) === -127. Actual: ' + (parseInt("-1111111", 2))); +} + +//CHECK#8 +if (parseInt("-11111111", 2) !== -255) { + $ERROR('#8: parseInt("-11111111", 2) === -255. Actual: ' + (parseInt("-11111111", 2))); +} + +//CHECK#9 +if (parseInt("-111111111", 2) !== -511) { + $ERROR('#9: parseInt("-111111111", 2) === -511. Actual: ' + (parseInt("-111111111", 2))); +} + +//CHECK#10 +if (parseInt("-1111111111", 2) !== -1023) { + $ERROR('#10: parseInt("-1111111111", 2) === -1023. Actual: ' + (parseInt("-1111111111", 2))); +} + +//CHECK#11 +if (parseInt("-11111111111", 2) !== -2047) { + $ERROR('#11: parseInt("-11111111111", 2) === -2047. Actual: ' + (parseInt("-11111111111", 2))); +} + +//CHECK#12 +if (parseInt("-111111111111", 2) !== -4095) { + $ERROR('#12: parseInt("-111111111111", 2) === -4095. Actual: ' + (parseInt("-111111111111", 2))); +} + +//CHECK#13 +if (parseInt("-1111111111111", 2) !== -8191) { + $ERROR('#13: parseInt("-1111111111111", 2) === -8191. Actual: ' + (parseInt("-1111111111111", 2))); +} + +//CHECK#14 +if (parseInt("-11111111111111", 2) !== -16383) { + $ERROR('#14: parseInt("-11111111111111", 2) === -16383. Actual: ' + (parseInt("-11111111111111", 2))); +} + +//CHECK#15 +if (parseInt("-111111111111111", 2) !== -32767) { + $ERROR('#15: parseInt("-111111111111111", 2) === -32767. Actual: ' + (parseInt("-111111111111111", 2))); +} + +//CHECK#16 +if (parseInt("-1111111111111111", 2) !== -65535) { + $ERROR('#16: parseInt("-1111111111111111", 2) === -65535. Actual: ' + (parseInt("-1111111111111111", 2))); +} + +//CHECK#17 +if (parseInt("-11111111111111111", 2) !== -131071) { + $ERROR('#17: parseInt("-11111111111111111", 2) === -131071. Actual: ' + (parseInt("-11111111111111111", 2))); +} + +//CHECK#18 +if (parseInt("-111111111111111111", 2) !== -262143) { + $ERROR('#18: parseInt("-111111111111111111", 2) === -262143. Actual: ' + (parseInt("-111111111111111111", 2))); +} + +//CHECK#19 +if (parseInt("-1111111111111111111", 2) !== -524287) { + $ERROR('#19: parseInt("-1111111111111111111", 2) === -524287. Actual: ' + (parseInt("-1111111111111111111", 2))); +} + +//CHECK#20 +if (parseInt("-11111111111111111111", 2) !== -1048575) { + $ERROR('#20: parseInt("-11111111111111111111", 2) === -1048575. Actual: ' + (parseInt("-11111111111111111111", 2))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T3.js new file mode 100644 index 000000000..7bad7645e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A7.3_T3.js @@ -0,0 +1,109 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A7.3_T3; + * @section: 15.1.2.2; + * @assertion: Return sign * Result(17); + * @description: Checking algorithm for R = 10; +*/ + +//CHECK#1 +if (parseInt("-1", 10) !== -1) { + $ERROR('#1: parseInt("-1", 10) === -1. Actual: ' + (parseInt("-1", 10))); +} + +//CHECK#2 +if (parseInt("-10", 10) !== -10) { + $ERROR('#2: parseInt("-10", 10) === -10. Actual: ' + (parseInt("-10", 10))); +} + +//CHECK#3 +if (parseInt("-100", 10) !== -100) { + $ERROR('#3: parseInt("-100", 10) === -100. Actual: ' + (parseInt("-100", 10))); +} + +//CHECK#4 +if (parseInt("-1000", 10) !== -1000) { + $ERROR('#4: parseInt("-1000", 10) === -1000. Actual: ' + (parseInt("-1000", 10))); +} + +//CHECK#5 +if (parseInt("-10000", 10) !== -10000) { + $ERROR('#5: parseInt("-10000", 10) === -10000. Actual: ' + (parseInt("-10000", 10))); +} + +//CHECK#6 +if (parseInt("-100000", 10) !== -100000) { + $ERROR('#6: parseInt("-100000", 10) === -100000. Actual: ' + (parseInt("-100000", 10))); +} + +//CHECK#7 +if (parseInt("-1000000", 10) !== -1000000) { + $ERROR('#7: parseInt("-1000000", 10) === -1000000. Actual: ' + (parseInt("-1000000", 10))); +} + +//CHECK#8 +if (parseInt("-10000000", 10) !== -10000000) { + $ERROR('#8: parseInt("-10000000", 10) === -10000000. Actual: ' + (parseInt("-10000000", 10))); +} + +//CHECK#9 +if (parseInt("-100000000", 10) !== -100000000) { + $ERROR('#9: parseInt("-100000000", 10) === -100000000. Actual: ' + (parseInt("-100000000", 10))); +} + +//CHECK#10 +if (parseInt("-1000000000", 10) !== -1000000000) { + $ERROR('#10: parseInt("-1000000000", 10) === -1000000000. Actual: ' + (parseInt("-1000000000", 10))); +} + +//CHECK#10 +if (parseInt("-10000000000", 10) !== -10000000000) { + $ERROR('#10: parseInt("-10000000000", 10) === -10000000000. Actual: ' + (parseInt("-10000000000", 10))); +} + +//CHECK#12 +if (parseInt("-100000000000", 10) !== -100000000000) { + $ERROR('#12: parseInt("-100000000000", 10) === -100000000000. Actual: ' + (parseInt("-100000000000", 10))); +} + +//CHECK#13 +if (parseInt("-1000000000000", 10) !== -1000000000000) { + $ERROR('#13: parseInt("-1000000000000", 10) === -1000000000000. Actual: ' + (parseInt("-1000000000000", 10))); +} + +//CHECK#14 +if (parseInt("-10000000000000", 10) !== -10000000000000) { + $ERROR('#14: parseInt("-10000000000000", 10) === -10000000000000. Actual: ' + (parseInt("-10000000000000", 10))); +} + +//CHECK#15 +if (parseInt("-100000000000000", 10) !== -100000000000000) { + $ERROR('#15: parseInt("-100000000000000", 10) === -100000000000000. Actual: ' + (parseInt("-100000000000000", 10))); +} + +//CHECK#10 +if (parseInt("-1000000000000000", 10) !== -1000000000000000) { + $ERROR('#10: parseInt("-1000000000000000", 10) === -1000000000000000. Actual: ' + (parseInt("-1000000000000000", 10))); +} + +//CHECK#17 +if (parseInt("-10000000000000000", 10) !== -10000000000000000) { + $ERROR('#17: parseInt("-10000000000000000", 10) === -10000000000000000. Actual: ' + (parseInt("-10000000000000000", 10))); +} + +//CHECK#18 +if (parseInt("-100000000000000000", 10) !== -100000000000000000) { + $ERROR('#18: parseInt("-100000000000000000", 10) === -100000000000000000. Actual: ' + (parseInt("-100000000000000000", 10))); +} + +//CHECK#19 +if (parseInt("-1000000000000000000", 10) !== -1000000000000000000) { + $ERROR('#19: parseInt("-1000000000000000000", 10) === -1000000000000000000. Actual: ' + (parseInt("-1000000000000000000", 10))); +} + +//CHECK#20 +if (parseInt("-10000000000000000000", 10) !== -10000000000000000000) { + $ERROR('#20: parseInt("-10000000000000000000", 10) === -10000000000000000000. Actual: ' + (parseInt("-10000000000000000000", 10))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A8.js new file mode 100644 index 000000000..f668ccd62 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A8.js @@ -0,0 +1,82 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A8; + * @section: 15.1.2.2, 9.3.1; + * @assertion: parseInt may interpret only a leading portion of the string as + * a number value; it ignores any characters that cannot be interpreted as part + * of the notation of an decimal literal, and no indication is given that any such + * characters were ignored. + * @description: Complex test without eval; +*/ + +//CHECK +var errorCount = 0; +var count = 0; +var indexP; +var indexO = 0; +for (var index = 0; index <= 65535; index++) { + if ((index < 0x0030) || (index > 0x0039) && + (index < 0x0041) || (index > 0x005A) && + (index < 0x0061) || (index > 0x007A)) { + var hex = decimalToHexString(index); + if (parseInt("1Z" + String.fromCharCode(index), 36) !== 71) { + if (indexO === 0) { + indexO = index; + } else { + if ((index - indexP) !== 1) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } + else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + indexO = index; + } + } + indexP = index; + errorCount++; + } + count++; + } +} + +if (errorCount > 0) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' '); +} + +function decimalToHexString(n) { + n = Number(n); + var h = ""; + for (var i = 3; i >= 0; i--) { + if (n >= Math.pow(16, i)) { + var t = Math.floor(n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { h += "A"; } + if ( t == 11 ) { h += "B"; } + if ( t == 12 ) { h += "C"; } + if ( t == 13 ) { h += "D"; } + if ( t == 14 ) { h += "E"; } + if ( t == 15 ) { h += "F"; } + } else { + h += String(t); + } + } else { + h += "0"; + } + } + return h; +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.1.js new file mode 100644 index 000000000..493dbb706 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A9.1; + * @section: 15.1.2.2, 15.2.4.7, 12.6.4; + * @assertion: The length property of parseInt has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (parseInt.propertyIsEnumerable('length') !== false) { + $ERROR('#1: parseInt.propertyIsEnumerable(\'length\') === false. Actual: ' + (parseInt.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in parseInt){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in parseInt) { if (p === "length") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.2.js new file mode 100644 index 000000000..84c1112bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.2.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A9.2; + * @section: 15.1.2.2, 15.2.4.5, 11.4.1; + * @assertion: The length property of parseInt has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; + * @strict_mode_negative +*/ + +//CHECK#1 +if (parseInt.hasOwnProperty('length') !== true) { + $FAIL('#1: parseInt.hasOwnProperty(\'length\') === true. Actual: ' + (parseInt.hasOwnProperty('length'))); +} + +delete parseInt.length; + +//CHECK#2 +if (parseInt.hasOwnProperty('length') !== true) { + $ERROR('#2: delete parseInt.length; parseInt.hasOwnProperty(\'length\') === true. Actual: ' + (parseInt.hasOwnProperty('length'))); +} + +//CHECK#3 +if (parseInt.length === undefined) { + $ERROR('#3: delete parseInt.length; parseInt.length !== undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.3.js new file mode 100644 index 000000000..b56c90fad --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A9.3; + * @section: 15.1.2.2; + * @assertion: The length property of parseInt has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +x = parseInt.length; +parseInt.length = Infinity; +if (parseInt.length !== x) { + $ERROR('#1: x = parseInt.length; parseInt.length = Infinity; parseInt.length === x. Actual: ' + (parseInt.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.4.js new file mode 100644 index 000000000..2b81bc082 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.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.1.2.2_A9.4; + * @section: 15.1.2.2; + * @assertion: The length property of parseInt is 2; + * @description: parseInt.length === 2; +*/ + +//CHECK#1 +if (parseInt.length !== 2) { + $ERROR('#1: parseInt.length === 2. Actual: ' + (parseInt.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.5.js new file mode 100644 index 000000000..e5ca5558e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.2_A9.5; + * @section: 15.1.2.2, 15.2.4.7, 12.6.4; + * @assertion: The parseInt property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('parseInt') !== false) { + $ERROR('#1: this.propertyIsEnumerable(\'parseInt\') === false. Actual: ' + (this.propertyIsEnumerable('parseInt'))); +} + +//CHECK#2 +var result = true; +for (var p in this){ + if (p === "parseInt") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "parseInt") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.6.js new file mode 100644 index 000000000..66af13b8d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.2_A9.6; +* @section: 15.1.2.2; +* @assertion: The parseInt property has not prototype property; +* @description: Checking parseInt.prototype; +*/ + +//CHECK#1 +if (parseInt.prototype !== undefined) { + $ERROR('#1: parseInt.prototype === undefined. Actual: ' + (parseInt.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.7.js new file mode 100644 index 000000000..123be57fe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.2_parseInt/S15.1.2.2_A9.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.2_A9.7; +* @section: 15.1.2.2, 11.2.2; +* @assertion: The parseInt property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new parseInt(); + $ERROR('#1.1: new parseInt() throw TypeError. Actual: ' + (new parseInt())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new parseInt() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T1.js new file mode 100644 index 000000000..25e593b6e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T1; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for boolean primitive; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(true)) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(true) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (String(parseFloat(false)) !== "NaN") { + $ERROR('#2: String(parseFloat(false)) === "NaN". Actual: ' + (String(parseFloat(false)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js new file mode 100644 index 000000000..a0f81e2f7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T2; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for number primitive; +*/ + +//CHECK#1 +if (parseFloat(-1.1) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(-1.1) === parseFloat("-1.1"). Actual: ' + (parseFloat(-1.1))); +} + +//CHECK#2 +if (parseFloat(Infinity) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(Infinity) === parseFloat("Infinity"). Actual: ' + (parseFloat(Infinity))); +} + +//CHECK#3 +if (String(parseFloat(NaN)) !== "NaN") { + $ERROR('#3: String(parseFloat(NaN)) === "NaN". Actual: ' + (String(parseFloat(NaN)))); +} + +//CHECK#4 +if (parseFloat(.01e+2) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(.01e+2) === parseFloat(".01e+2"). Actual: ' + (parseFloat(.01e+2))); +} + +//CHECK#5 +if (parseFloat(-0) !== 0) { + $ERROR('#5: parseFloat(-0) === 0. Actual: ' + (parseFloat(-0))); +} else { + if (1 / parseFloat(-0) !== Number.POSITIVE_INFINITY) { + $ERROR('#5: parseFloat(-0) === +0. Actual: ' + (parseFloat(-0))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.js new file mode 100644 index 000000000..ea793257f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T3; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for undefined and null; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(undefined)) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(undefined) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (!(isNaN(parseFloat(null)) && isNaN(parseFloat("NaN")))) { + $ERROR('#2: parseFloat(null) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + + +//CHECK#3 +if (String(parseFloat(undefined)) !== "NaN") { + $ERROR('#3: String(parseFloat(undefined)) === "NaN". Actual: ' + (String(parseFloat(undefined)))); +} + +//CHECK#4 +if (String(parseFloat(null)) !== "NaN") { + $ERROR('#4: String(parseFloat(null)) === "NaN". Actual: ' + (String(parseFloat(null)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T4.js new file mode 100644 index 000000000..033b76ad8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T4.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.1.2.3_A1_T4; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Boolean object; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(new Boolean(true))) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(new Boolean(true)) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (String(parseFloat(new Boolean(false))) !== "NaN") { + $ERROR('#2: String(parseFloat(new Boolean(false))) === "NaN". Actual: ' + (String(parseFloat(new Boolean(false))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.js new file mode 100644 index 000000000..8604f1a43 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T5; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Number object; +*/ + +//CHECK#1 +if (parseFloat(new Number(-1.1)) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(new Number(-1.1)) === parseFloat("-1.1"). Actual: ' + (parseFloat(new Number(-1.1)))); +} + +//CHECK#2 +if (parseFloat(new Number(Infinity)) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(new Number(Infinity)) === parseFloat("Infinity"). Actual: ' + (parseFloat(new Number(Infinity)))); +} + +//CHECK#3 +if (String(parseFloat(new Number(NaN))) !== "NaN") { + $ERROR('#3: String(parseFloat(new Number(NaN))) === "NaN". Actual: ' + (String(parseFloat(new Number(NaN))))); +} + +//CHECK#4 +if (parseFloat(new Number(.01e+2)) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(new Number(.01e+2)) === parseFloat(".01e+2"). Actual: ' + (parseFloat(new Number(.01e+2)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.js new file mode 100644 index 000000000..dfc73b198 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T6; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for String object; +*/ + +//CHECK#1 +if (parseFloat(new String("-1.1")) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(new String("-1.1")) === parseFloat("-1.1"). Actual: ' + (parseFloat(new String("-1.1")))); +} + +//CHECK#2 +if (parseFloat(new String("Infinity")) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(new String("Infinity")) === parseFloat("Infinity"). Actual: ' + (parseFloat(new String("Infinity")))); +} + +//CHECK#3 +if (String(parseFloat(new String("NaN"))) !== "NaN") { + $ERROR('#3: String(parseFloat(new String("NaN"))) === "NaN". Actual: ' + (String(parseFloat(new String("NaN"))))); +} + +//CHECK#4 +if (parseFloat(new String(".01e+2")) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(new String(".01e+2")) === parseFloat(".01e+2"). Actual: ' + (parseFloat(new String(".01e+2")))); +} + +//CHECK#5 +if (String(parseFloat(new String("false"))) !== "NaN") { + $ERROR('#5: String(parseFloat(new String("false"))) === "NaN". Actual: ' + (String(parseFloat(new String("false"))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js new file mode 100644 index 000000000..2eab8eccb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js @@ -0,0 +1,78 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T7; + * @section: 15.1.2.3, 9.8, 8.6.2.6; + * @assertion: Operator use ToString; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, String); +*/ + +//CHECK#1 +var object = {valueOf: function() {return 1}}; +if (isNaN(parseFloat(object)) !== true) { + $ERROR('#1: var object = {valueOf: function() {return 1}}; parseFloat(object) === Not-a-Number. Actual: ' + (parseFloat(object))); +} + +//CHECK#2 +var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +if (parseFloat(object) !== 0) { + $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; parseFloat(object) === 0. Actual: ' + (parseFloat(object))); +} + +//CHECK#3 +var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +if (parseFloat(object) !== 1) { + $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + if (parseFloat(object) !== 1) { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return 1}}; +if (parseFloat(object) !== 1) { + $ERROR('#5: var object = {toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return 1}} +if (parseFloat(object) !== 1) { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#7 +try { + var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + parseFloat(object); + $ERROR('#7.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseFloat(object) throw "error". Actual: ' + (parseFloat(object))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseFloat(object) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + parseFloat(object); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseFloat(object) throw TypeError. Actual: ' + (parseFloat(object))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseFloat(object) throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js new file mode 100644 index 000000000..a259bdd33 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T1; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: TAB (U+0009); +*/ + +//CHECK#1 +if (parseFloat("\u00091.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00091.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00091.1"))); +} + +//CHECK#2 +if (parseFloat("\u0009\u0009-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u0009\\u0009-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u0009\u0009-1.1"))); +} + +//CHECK#3 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#3: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#4 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#4: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#5 +if (parseFloat(" \u0009 \u0009-1.1") !== parseFloat("-1.1")) { + $ERROR('#5: parseFloat(" \\u0009 \\u0009-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat(" \u0009 \u0009-1.1"))); +} + +//CHECK#6 +if (isNaN(parseFloat("\u0009")) !== true) { + $ERROR('#6: parseFloat("\\u0009") === Not-a-Number. Actual: ' + (parseFloat("\u0009"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.js new file mode 100644 index 000000000..9fa2cb5c6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.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.1.2.3_A2_T10; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: USP; +*/ + +//CHECK# +var count = 0; +var errorCount = 0; +var uspU = ["\u1680", "\u180E", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; +var uspS = ["1680", "180E", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; +for (var index = 0; index < uspU.length; index++) { + var result = true; + if (parseFloat(uspU[index] + "1.1") !== parseFloat("1.1")) { + $ERROR('#1.' + uspS[index] + ' '); + result = false; + } + if (parseFloat(uspU[index] + uspU[index] + uspU[index] + "1.1") !== parseFloat("1.1")) { + $ERROR('#2.' + uspS[index] + ' '); + result = false; + } + if (isNaN(parseFloat(uspU[index])) !== true) { + $ERROR('#3.' + uspS[index] + ' '); + result = false; + } + if (result !== true) { + errorCount++; + } + count++; +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js new file mode 100644 index 000000000..4c942ea1f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T2; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: SP (U+0020); +*/ + +//CHECK#1 +if (parseFloat("\u00201.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00201.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00201.1"))); +} + +//CHECK#2 +if (parseFloat("\u0020\u0020-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u0020\\u0020-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u0020\u0020-1.1"))); +} + +//CHECK#3 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#3: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#4 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#4: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#5 +if (parseFloat(" \u0020 \u0020-1.1") !== parseFloat("-1.1")) { + $ERROR('#5: parseFloat(" \\u0020 \\u0020-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat(" \u0020 \u0020-1.1"))); +} + +//CHECK#6 +if (isNaN(parseFloat("\u0020")) !== true) { + $ERROR('#6: parseFloat("\\u0020") === Not-a-Number. Actual: ' + (parseFloat("\u0020"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.js new file mode 100644 index 000000000..13d1eb022 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T3; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: NBSB (U+00A0); +*/ + +//CHECK#1 +if (parseFloat("\u00A01.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00A01.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00A01.1"))); +} + +//CHECK#2 +if (parseFloat("\u00A0\u00A0-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u00A0\\u00A0-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u00A0\u00A0-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u00A0")) !== true) { + $ERROR('#3: parseFloat("\\u00A0") === Not-a-Number. Actual: ' + (parseFloat("\u00A0"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.js new file mode 100644 index 000000000..494a1947e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T4; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: FF (U+000C); +*/ + +//CHECK#1 +if (parseFloat("\u000C1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000C1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000C1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000C\u000C-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000C\\u000C-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000C\u000C-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000C")) !== true) { + $ERROR('#3: parseFloat("\\u000C") === Not-a-Number. Actual: ' + (parseFloat("\u000C"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T5.js new file mode 100644 index 000000000..6b28ea1d1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T5.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T5; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: VT (U+000B); +*/ + +//CHECK#1 +if (parseFloat("\u000B1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000B1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000B1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000B\u000B-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000B\\u000B-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000B\u000B-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000B")) !== true) { + $ERROR('#3: parseFloat("\\u000B") === Not-a-Number. Actual: ' + (parseFloat("\u000B"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.js new file mode 100644 index 000000000..6c0aee42f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T6; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: CR (U+000D); +*/ + +//CHECK#1 +if (parseFloat("\u000D1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000D1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000D1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000D\u000D-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000D\\u000D-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000D\u000D-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000D")) !== true) { + $ERROR('#3: parseFloat("\\u000D") === Not-a-Number. Actual: ' + (parseFloat("\u000D"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.js new file mode 100644 index 000000000..30e3dcb24 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T7; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LF (U+000A); +*/ + +//CHECK#1 +if (parseFloat("\u000A1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000A1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000A1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000A\u000A-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000A\\u000A-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000A\u000A-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000A")) !== true) { + $ERROR('#3: parseFloat("\\u000A") === Not-a-Number. Actual: ' + (parseFloat("\u000A"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.js new file mode 100644 index 000000000..648e19e2a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T8; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LS (U+2028); +*/ + +//CHECK#1 +if (parseFloat("\u20281.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u20281.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u20281.1"))); +} + +//CHECK#2 +if (parseFloat("\u2028\u2028-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u2028\\u2028-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u2028\u2028-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u2028")) !== true) { + $ERROR('#3: parseFloat("\\u2028") === Not-a-Number. Actual: ' + (parseFloat("\u2028"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.js new file mode 100644 index 000000000..4802ad16b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T9; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: PS (U+2029); +*/ + +//CHECK#1 +if (parseFloat("\u20291.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u20291.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u20291.1"))); +} + +//CHECK#2 +if (parseFloat("\u2029\u2029-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u2029\\u2029-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u2029\u2029-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u2029")) !== true) { + $ERROR('#3: parseFloat("\\u2029") === Not-a-Number. Actual: ' + (parseFloat("\u2029"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js new file mode 100644 index 000000000..5e7bcb81e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A3_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("some string") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat("str")) !== true) { + $ERROR('#1: parseFloat("str") === Not-a-Number. Actual: ' + (parseFloat("str"))); +} + +//CHECK#2 +if (isNaN(parseFloat("s1")) !== true) { + $ERROR('#2: parseFloat("s1") === Not-a-Number. Actual: ' + (parseFloat("s1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("")) !== true) { + $ERROR('#3: parseFloat("") === Not-a-Number. Actual: ' + (parseFloat(""))); +} + +//CHECK#4 +if (String(parseFloat("str")) !== "NaN") { + $ERROR('#4: String(parseFloat("str")) === "NaN". Actual: ' + (String(parseFloat("str")))); +} + +//CHECK#5 +if (String(parseFloat("s1")) !== "NaN") { + $ERROR('#5: String(parseFloat("s1")) === "NaN". Actual: ' + (String(parseFloat("s1")))); +} + +//CHECK#6 +if (String(parseFloat("")) !== "NaN") { + $ERROR('#6: String(parseFloat("")) === "NaN". Actual: ' + (String(parseFloat("")))); +} + +//CHECK#7 +if (String(parseFloat("+")) !== "NaN") { + $ERROR('#7: String(parseFloat("+")) === "NaN". Actual: ' + (String(parseFloat("+")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js new file mode 100644 index 000000000..8e3c91b23 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A3_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("wrong number format with ExponentIndicator") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat("e1")) !== true) { + $ERROR('#1: parseFloat("e1") === Not-a-Number. Actual: ' + (parseFloat("e1"))); +} + +//CHECK#2 +if (isNaN(parseFloat("e-1")) !== true) { + $ERROR('#2: parseFloat("e-1") === Not-a-Number. Actual: ' + (parseFloat("e-1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("E+1")) !== true) { + $ERROR('#3: parseFloat("E+1") === Not-a-Number. Actual: ' + (parseFloat("E+1"))); +} + +//CHECK#4 +if (isNaN(parseFloat("E0")) !== true) { + $ERROR('#4: parseFloat("E0") === Not-a-Number. Actual: ' + (parseFloat("E0"))); +} + +//CHECK#5 +if (String(parseFloat("e1")) !== "NaN") { + $ERROR('#5: String(parseFloat("e1")) === "NaN". Actual: ' + (String(parseFloat("e1")))); +} + +//CHECK#6 +if (String(parseFloat("e-1")) !== "NaN") { + $ERROR('#6: String(parseFloat("e-1")) === "NaN". Actual: ' + (String(parseFloat("e-1")))); +} + +//CHECK#7 +if (String(parseFloat("E+1")) !== "NaN") { + $ERROR('#73: String(parseFloat("E+1")) === "NaN". Actual: ' + (String(parseFloat("E+1")))); +} + +//CHECK#8 +if (String(parseFloat("E0")) !== "NaN") { + $ERROR('#8: String(parseFloat("E0")) === "NaN". Actual: ' + (String(parseFloat("E0")))); +} + +//CHECK#9 +if (isNaN(parseFloat("-.e-1")) !== true) { + $ERROR('#9: parseFloat("-.e-1") === Not-a-Number. Actual: ' + (parseFloat("-.e-1"))); +} + +//CHECK#10 +if (isNaN(parseFloat(".e1")) !== true) { + $ERROR('#10: parseFloat(".e1") === Not-a-Number. Actual: ' + (parseFloat(".e1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.js new file mode 100644 index 000000000..cfa374acf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A3_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("wrong numbr format") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat(".x")) !== true) { + $ERROR('#1: parseFloat(".x") === Not-a-Number. Actual: ' + (parseFloat(".x"))); +} + +//CHECK#2 +if (isNaN(parseFloat("+x")) !== true) { + $ERROR('#2: parseFloat("+x") === Not-a-Number. Actual: ' + (parseFloat("+x"))); +} + +//CHECK#3 +if (isNaN(parseFloat("infinity")) !== true) { + $ERROR('#3: parseFloat("infinity") === Not-a-Number. Actual: ' + (parseFloat("infinity"))); +} + +//CHECK#4 +if (isNaN(parseFloat("A")) !== true) { + $ERROR('#4: parseFloat("A") === Not-a-Number. Actual: ' + (parseFloat("A"))); +} + +//CHECK#5 +if (String(parseFloat(".s")) !== "NaN") { + $ERROR('#5: String(parseFloat(".s")) === "NaN". Actual: ' + (String(parseFloat(".s")))); +} + +//CHECK#6 +if (String(parseFloat("+x")) !== "NaN") { + $ERROR('#6: String(parseFloat("+x")) === "NaN". Actual: ' + (String(parseFloat("+x")))); +} + +//CHECK#7 +if (String(parseFloat("infinity")) !== "NaN") { + $ERROR('#73: String(parseFloat("infinity")) === "NaN". Actual: ' + (String(parseFloat("infinity")))); +} + +//CHECK#8 +if (String(parseFloat("A")) !== "NaN") { + $ERROR('#8: String(parseFloat("A")) === "NaN". Actual: ' + (String(parseFloat("A")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js new file mode 100644 index 000000000..70b3f930c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Some wrong number; +*/ + +//CHECK#1 +if (parseFloat("0x") !== 0) { + $ERROR('#1: parseFloat("0x") === 0. Actual: ' + (parseFloat("0x"))); +} + +//CHECK#2 +if (parseFloat("11x") !== 11) { + $ERROR('#2: parseFloat("11x") === 11. Actual: ' + (parseFloat("11x"))); +} + +//CHECK#3 +if (parseFloat("11s1") !== 11) { + $ERROR('#3: parseFloat("11s1") === 11. Actual: ' + (parseFloat("11s1"))); +} + +//CHECK#4 +if (parseFloat("11.s1") !== 11) { + $ERROR('#4: parseFloat("11.s1") === 11. Actual: ' + (parseFloat("11.s1"))); +} + +//CHECK#5 +if (parseFloat(".0s1") !== 0) { + $ERROR('#5: parseFloat(".0s1") === 0. Actual: ' + (parseFloat(".0s1"))); +} + +//CHECK#6 +if (parseFloat("1.s1") !== 1) { + $ERROR('#6: parseFloat("1.s1") === 1. Actual: ' + (parseFloat("1.s1"))); +} + +//CHECK#7 +if (parseFloat("1..1") !== 1) { + $ERROR('#7: parseFloat("1..1") === 1. Actual: ' + (parseFloat("1..1"))); +} + +//CHECK#8 +if (parseFloat("0.1.1") !== 0.1) { + $ERROR('#8: parseFloat("0.1.1") === 0.1. Actual: ' + (parseFloat("0.1.1"))); +} + +//CHECK#9 +if (parseFloat("0. 1") !== 0) { + $ERROR('#9: parseFloat("0. 1") === 0. Actual: ' + (parseFloat("0. 1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js new file mode 100644 index 000000000..612c8197c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: With ExponentIndicator; +*/ + +//CHECK#1 +if (parseFloat("1ex") !== 1) { + $ERROR('#1: parseFloat("1ex") === 1. Actual: ' + (parseFloat("1ex"))); +} + +//CHECK#2 +if (parseFloat("1e-x") !== 1) { + $ERROR('#2: parseFloat("1e-x") === 1. Actual: ' + (parseFloat("1e-x"))); +} + +//CHECK#3 +if (parseFloat("1e1x") !== 10) { + $ERROR('#3: parseFloat("1e1x") === 10. Actual: ' + (parseFloat("1e1x"))); +} + +//CHECK#4 +if (parseFloat("1e-1x") !== 0.1) { + $ERROR('#4: parseFloat("1e-1x") === 0.1. Actual: ' + (parseFloat("1e-1x"))); +} + +//CHECK#5 +if (parseFloat("0.1e-1x") !== 0.01) { + $ERROR('#5: parseFloat("0.1e-1x") === 0.01. Actual: ' + (parseFloat("0.1e-1x"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js new file mode 100644 index 000000000..d24c6e6ad --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: StrDecimalLiteral not contain HexIntegerLiteral; +*/ + +//CHECK#0 +if (parseFloat("0x0") !== 0) { + $ERROR('#0: parseFloat("0x0") === 0. Actual: ' + (parseFloat("0x0"))); +} + +//CHECK#1 +if (parseFloat("0x1") !== 0) { + $ERROR('#1: parseFloat("0x1") === 0. Actual: ' + (parseFloat("0x1"))); +} + +//CHECK#2 +if (parseFloat("0x2") !== 0) { + $ERROR('#2: parseFloat("0x2") === 0. Actual: ' + (parseFloat("0x2"))); +} + +//CHECK#3 +if (parseFloat("0x3") !== 0) { + $ERROR('#3: parseFloat("0x3") === 0. Actual: ' + (parseFloat("0x3"))); +} + +//CHECK#4 +if (parseFloat("0x4") !== 0) { + $ERROR('#4: parseFloat("0x4") === 0. Actual: ' + (parseFloat("0x4"))); +} + +//CHECK#5 +if (parseFloat("0x5") !== 0) { + $ERROR('#5: parseFloat("0x5") === 0. Actual: ' + (parseFloat("0x5"))); +} + +//CHECK#6 +if (parseFloat("0x6") !== 0) { + $ERROR('#6: parseFloat("0x6") === 0. Actual: ' + (parseFloat("0x6"))); +} + +//CHECK#7 +if (parseFloat("0x7") !== 0) { + $ERROR('#7: parseFloat("0x7") === 0. Actual: ' + (parseFloat("0x7"))); +} + +//CHECK#8 +if (parseFloat("0x8") !== 0) { + $ERROR('#8: parseFloat("0x8") === 0. Actual: ' + (parseFloat("0x8"))); +} + +//CHECK#9 +if (parseFloat("0x9") !== 0) { + $ERROR('#9: parseFloat("0x9") === 0. Actual: ' + (parseFloat("0x9"))); +} + +//CHECK#A +if (parseFloat("0xA") !== 0) { + $ERROR('#A: parseFloat("0xA") === 0. Actual: ' + (parseFloat("0xA"))); +} + +//CHECK#B +if (parseFloat("0xB") !== 0) { + $ERROR('#B: parseFloat("0xB") === 0. Actual: ' + (parseFloat("0xB"))); +} + +//CHECK#C +if (parseFloat("0xC") !== 0) { + $ERROR('#C: parseFloat("0xC") === 0. Actual: ' + (parseFloat("0xC"))); +} + +//CHECK#D +if (parseFloat("0xD") !== 0) { + $ERROR('#D: parseFloat("0xD") === 0. Actual: ' + (parseFloat("0xD"))); +} + +//CHECK#E +if (parseFloat("0xE") !== 0) { + $ERROR('#E: parseFloat("0xE") === 0. Actual: ' + (parseFloat("0xE"))); +} + +//CHECK#F +if (parseFloat("0xF") !== 0) { + $ERROR('#F: parseFloat("0xF") === 0. Actual: ' + (parseFloat("0xF"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.js new file mode 100644 index 000000000..19b434f51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T4; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: "Infinity"+"some string"; +*/ + +//CHECK#1 +if (parseFloat("Infinity1") !== Number.POSITIVE_INFINITY) { + $ERROR('#1: parseFloat("Infinity1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity1"))); +} + +//CHECK#2 +if (parseFloat("Infinityx") !== Number.POSITIVE_INFINITY) { + $ERROR('#2: parseFloat("Infinityx") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinityx"))); +} + +//CHECK#3 +if (parseFloat("Infinity+1") !== Number.POSITIVE_INFINITY) { + $ERROR('#3: parseFloat("Infinity+1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity+1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js new file mode 100644 index 000000000..510df03a4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T5; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking DecimalDigits . DecimalDigits_opt ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11.string") !== -11) { + $ERROR('#1: parseFloat("-11.string") === -11. Actual: ' + (parseFloat("-11.string"))); +} + +//CHECK#2 +if (parseFloat("01.string") !== 1) { + $ERROR('#2: parseFloat("01.string") === 1. Actual: ' + (parseFloat("01.string"))); +} + +//CHECK#3 +if (parseFloat("+11.1string") !== 11.1) { + $ERROR('#3: parseFloat("+11.1string") === 11.1. Actual: ' + (parseFloat("+11.1string"))); +} + +//CHECK#4 +if (parseFloat("01.1string") !== 1.1) { + $ERROR('#4: parseFloat("01.1string") === 1.1. Actual: ' + (parseFloat("01.1string"))); +} + +//CHECK#5 +if (parseFloat("-11.e-1string") !== -1.1) { + $ERROR('#5: parseFloat("-11.e-1string") === -1.1. Actual: ' + (parseFloat("-11.e-1string"))); +} + +//CHECK#6 +if (parseFloat("01.e1string") !== 10) { + $ERROR('#6: parseFloat("01.e1string") === 10. Actual: ' + (parseFloat("01.e1string"))); +} + +//CHECK#7 +if (parseFloat("+11.22e-1string") !== 1.122) { + $ERROR('#7: parseFloat("+11.22e-1string") === 1.122. Actual: ' + (parseFloat("+11.22e-1string"))); +} + +//CHECK#8 +if (parseFloat("01.01e1string") !== 10.1) { + $ERROR('#8: parseFloat("01.01e1string") === 10.1. Actual: ' + (parseFloat("01.01e1string"))); +} + +//CHECK#9 +if (parseFloat("001.string") !== 1) { + $ERROR('#9: parseFloat("001.string") === 1. Actual: ' + (parseFloat("001.string"))); +} + +//CHECK#10 +if (parseFloat("010.string") !== 10) { + $ERROR('#10: parseFloat("010.string") === 10. Actual: ' + (parseFloat("010.string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.js new file mode 100644 index 000000000..d707c8e0a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T6; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking . DecimalDigits ExponentPart_opt; +*/ + + +//CHECK#1 +if (parseFloat("+.1string") !== 0.1) { + $ERROR('#1: parseFloat("+.1string") === 0.1. Actual: ' + (parseFloat("+.1string"))); +} + +//CHECK#2 +if (parseFloat(".01string") !== 0.01) { + $ERROR('#2: parseFloat(".01string") === 0.01. Actual: ' + (parseFloat(".01string"))); +} + +//CHECK#3 +if (parseFloat("+.22e-1string") !== 0.022) { + $ERROR('#3: parseFloat("+.22e-1string") === 0.022. Actual: ' + (parseFloat("+.22e-1string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js new file mode 100644 index 000000000..bd2e9a62b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T7; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking DecimalDigits ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11string") !== -11) { + $ERROR('#1: parseFloat("-11string") === -11. Actual: ' + (parseFloat("-11string"))); +} + +//CHECK#2 +if (parseFloat("01string") !== 1) { + $ERROR('#2: parseFloat("01string") === 1. Actual: ' + (parseFloat("01string"))); +} + +//CHECK#3 +if (parseFloat("-11e-1string") !== -1.1) { + $ERROR('#3: parseFloat("-11e-1string") === -1.1. Actual: ' + (parseFloat("-11e-1string"))); +} + +//CHECK#4 +if (parseFloat("01e1string") !== 10) { + $ERROR('#4: parseFloat("01e1string") === 10. Actual: ' + (parseFloat("01e1string"))); +} + +//CHECK#5 +if (parseFloat("001string") !== 1) { + $ERROR('#5: parseFloat("001string") === 1. Actual: ' + (parseFloat("001string"))); +} + +//CHECK#6 +if (parseFloat("1e001string") !== 10) { + $ERROR('#6: parseFloat("1e001string") === 10. Actual: ' + (parseFloat("1e001string"))); +} + +//CHECK#7 +if (parseFloat("010string") !== 10) { + $ERROR('#7: parseFloat("010string") === 10. Actual: ' + (parseFloat("010string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.js new file mode 100644 index 000000000..3e526bbf3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A5_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking Infinity; +*/ + +//CHECK#1 +if (parseFloat("Infinity") !== Number.POSITIVE_INFINITY) { + $ERROR('#1: parseFloat("Infinity") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity"))); +} + +//CHECK#2 +if (parseFloat("+Infinity") !== Number.POSITIVE_INFINITY) { + $ERROR('#2: parseFloat("+Infinity") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("+Infinity"))); +} + +//CHECK#3 +if (parseFloat("-Infinity") !== Number.NEGATIVE_INFINITY) { + $ERROR('#3: parseFloat("-Infinity") === Number.NEGATIVE_INFINITY. Actual: ' + (parseFloat("-Infinity"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.js new file mode 100644 index 000000000..d7b94c3c8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A5_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking DecimalDigits . DecimalDigits_opt ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11.") !== -11) { + $ERROR('#1: parseFloat("-11.") === -11. Actual: ' + (parseFloat("-11."))); +} + +//CHECK#2 +if (parseFloat("01.") !== 1) { + $ERROR('#2: parseFloat("01.") === 1. Actual: ' + (parseFloat("01."))); +} + +//CHECK#3 +if (parseFloat("+11.1") !== 11.1) { + $ERROR('#3: parseFloat("+11.1") === 11.1. Actual: ' + (parseFloat("+11.1"))); +} + +//CHECK#4 +if (parseFloat("01.1") !== 1.1) { + $ERROR('#4: parseFloat("01.1") === 1.1. Actual: ' + (parseFloat("01.1"))); +} + +//CHECK#5 +if (parseFloat("-11.e-1") !== -1.1) { + $ERROR('#5: parseFloat("-11.e-1") === -1.1. Actual: ' + (parseFloat("-11.e-1"))); +} + +//CHECK#6 +if (parseFloat("01.e1") !== 10) { + $ERROR('#6: parseFloat("01.e1") === 10. Actual: ' + (parseFloat("01.e1"))); +} + +//CHECK#7 +if (parseFloat("+11.22e-1") !== 1.122) { + $ERROR('#7: parseFloat("+11.22e-1") === 1.122. Actual: ' + (parseFloat("+11.22e-1"))); +} + +//CHECK#8 +if (parseFloat("01.01e1") !== 10.1) { + $ERROR('#8: parseFloat("01.01e1") === 10.1. Actual: ' + (parseFloat("01.01e1"))); +} + +//CHECK#9 +if (parseFloat("001.") !== 1) { + $ERROR('#9: parseFloat("001.") === 1. Actual: ' + (parseFloat("001."))); +} + +//CHECK#10 +if (parseFloat("010.") !== 10) { + $ERROR('#10: parseFloat("010.") === 10. Actual: ' + (parseFloat("010."))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T3.js new file mode 100644 index 000000000..a6629049a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T3.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A5_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking . DecimalDigits ExponentPart_opt; +*/ + + +//CHECK#1 +if (parseFloat("+.1") !== 0.1) { + $ERROR('#1: parseFloat("+.1") === 0.1. Actual: ' + (parseFloat("+.1"))); +} + +//CHECK#2 +if (parseFloat(".01") !== 0.01) { + $ERROR('#2: parseFloat(".01") === 0.01. Actual: ' + (parseFloat(".01"))); +} + +//CHECK#3 +if (parseFloat("+.22e-1") !== 0.022) { + $ERROR('#3: parseFloat("+.22e-1") === 0.022. Actual: ' + (parseFloat("+.22e-1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.js new file mode 100644 index 000000000..b0fef7c1c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A5_T4; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking DecimalDigits ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11") !== -11) { + $ERROR('#1: parseFloat("-11") === -11. Actual: ' + (parseFloat("-11"))); +} + +//CHECK#2 +if (parseFloat("01") !== 1) { + $ERROR('#2: parseFloat("01") === 1. Actual: ' + (parseFloat("01"))); +} + +//CHECK#3 +if (parseFloat("-11e-1") !== -1.1) { + $ERROR('#3: parseFloat("-11e-1") === -1.1. Actual: ' + (parseFloat("-11e-1"))); +} + +//CHECK#4 +if (parseFloat("01e1") !== 10) { + $ERROR('#4: parseFloat("01e1") === 10. Actual: ' + (parseFloat("01e1"))); +} + +//CHECK#5 +if (parseFloat("001") !== 1) { + $ERROR('#5: parseFloat("001") === 1. Actual: ' + (parseFloat("001"))); +} + +//CHECK#6 +if (parseFloat("1e001") !== 10) { + $ERROR('#6: parseFloat("1e001") === 10. Actual: ' + (parseFloat("1e001"))); +} + +//CHECK#7 +if (parseFloat("010") !== 10) { + $ERROR('#7: parseFloat("010") === 10. Actual: ' + (parseFloat("010"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js new file mode 100644 index 000000000..361060a9c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A6; + * @section: 15.1.2.3, 9.3.1; + * @assertion: parseFloat may interpret only a leading portion of the string as + * a number value; it ignores any characters that cannot be interpreted as part + * of the notation of an decimal literal, and no indication is given that any such + * characters were ignored. + * @description: Complex test without eval; +*/ + +//CHECK +var errorCount = 0; +var count = 0; +var indexP; +var indexO = 0; +for (var index = 0; index <= 65535; index++) { + if ((index < 0x0030) || (index > 0x0039)) { + var hex = decimalToHexString(index); + if (parseFloat("0.1e1" + String.fromCharCode(index)) !== 1) { + if (indexO === 0) { + indexO = index; + } else { + if ((index - indexP) !== 1) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } + else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + indexO = index; + } + } + indexP = index; + errorCount++; + } + count++; + } +} + +if (errorCount > 0) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' '); +} + +function decimalToHexString(n) { + n = Number(n); + var h = ""; + for (var i = 3; i >= 0; i--) { + if (n >= Math.pow(16, i)) { + var t = Math.floor(n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { h += "A"; } + if ( t == 11 ) { h += "B"; } + if ( t == 12 ) { h += "C"; } + if ( t == 13 ) { h += "D"; } + if ( t == 14 ) { h += "E"; } + if ( t == 15 ) { h += "F"; } + } else { + h += String(t); + } + } else { + h += "0"; + } + } + return h; +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.js new file mode 100644 index 000000000..4e896241f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.1; + * @section: 15.1.2.3, 15.2.4.7, 12.6.4; + * @assertion: The length property of parseFloat has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (parseFloat.propertyIsEnumerable('length') !== false) { + $ERROR('#1: parseFloat.propertyIsEnumerable(\'length\') === false. Actual: ' + (parseFloat.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in parseFloat){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in parseFloat) { if (p === "length") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.js new file mode 100644 index 000000000..93482ebf5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.2; + * @section: 15.1.2.3, 15.2.4.5, 11.4.1; + * @assertion: The length property of parseFloat has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; + * @strict_mode_negative +*/ + +//CHECK#1 +if (parseFloat.hasOwnProperty('length') !== true) { + $FAIL('#1: parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length'))); +} + +delete parseFloat.length; + +//CHECK#2 +if (parseFloat.hasOwnProperty('length') !== true) { + $ERROR('#2: delete parseFloat.length; parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length'))); +} + +//CHECK#3 +if (parseFloat.length === undefined) { + $ERROR('#3: delete parseFloat.length; parseFloat.length !== undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.js new file mode 100644 index 000000000..b08cc1ca1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.3; + * @section: 15.1.2.3; + * @assertion: The length property of parseFloat has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +var x = parseFloat.length; +parseFloat.length = Infinity; +if (parseFloat.length !== x) { + $ERROR('#1: x = parseFloat.length; parseFloat.length = Infinity; parseFloat.length === x. Actual: ' + (parseFloat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js new file mode 100644 index 000000000..b955f7127 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.4; + * @section: 15.1.2.3; + * @assertion: The length property of parseFloat is 1; + * @description: parseFloat.length === 1; +*/ + +//CHECK#1 +if (parseFloat.length !== 1) { + $ERROR('#1: parseFloat.length === 1. Actual: ' + (parseFloat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.js new file mode 100644 index 000000000..d2f4fe176 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.5; + * @section: 15.1.2.3, 15.2.4.7, 12.6.4; + * @assertion: The parseFloat property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('parseFloat') !== false) { + $ERROR('#1:this.propertyIsEnumerable(\'parseFloat\') === false. Actual: ' + (this.propertyIsEnumerable('parseFloat'))); +} + +//CHECK#2 +var result = true; +for (var p in this){ + if (p === "parseFloat") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "parseFloat") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js new file mode 100644 index 000000000..192650f8b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.3_A7.6; +* @section: 15.1.2.3; +* @assertion: The parseFloat property has not prototype property; +* @description: Checking parseFloat.prototype; +*/ + +//CHECK#1 +if (parseFloat.prototype !== undefined) { + $ERROR('#1: parseFloat.prototype === undefined. Actual: ' + (parseFloat.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js new file mode 100644 index 000000000..e3d902adc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.3_A7.7; +* @section: 15.1.2.3, 11.2.2; +* @assertion: The parseFloat property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new parseFloat(); + $ERROR('#1.1: new parseFloat() throw TypeError. Actual: ' + (new parseFloat())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new parseFloat() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T1.js new file mode 100644 index 000000000..b426c645e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T1.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.1.2.4_A1_T1; + * @section: 15.1.2.4; + * @assertion: isNaN applies ToNumber to its argument, then return true if the result is NaN, and otherwise return false; + * @description: Checking all primitive; +*/ + +// CHECK#1 +if (!(isNaN(NaN) === true)) { + $ERROR('#1: NaN === Not-a-Number. Actual: ' + (NaN)); +} + +// CHECK#2 +if (!(isNaN(Number.NaN) === true)) { + $ERROR('#2: Number.NaN === Not-a-Number. Actual: ' + (Number.NaN)); +} + +// CHECK#3 +if (!(isNaN(Number(void 0)) === true)) { + $ERROR('#3: Number(void 0) === Not-a-Number. Actual: ' + (Number(void 0))); +} + +// CHECK#4 +if (!(isNaN(void 0) === true)) { + $ERROR('#4: void 0 === Not-a-Number. Actual: ' + (void 0)); +} + +// CHECK#5 +if (!(isNaN("string") === true)) { + $ERROR('#5: "string" === Not-a-Number. Actual: ' + ("string")); +} + +// CHECK#6 +if (isNaN(Number.POSITIVE_INFINITY) === true) { + $ERROR('#6: Number.POSITIVE_INFINITY !== Not-a-Number'); +} + +// CHECK#7 +if (isNaN(Number.NEGATIVE_INFINITY) === true) { + $ERROR('#7: Number.NEGATIVE_INFINITY !== Not-a-Number'); +} + +// CHECK#8 +if (isNaN(Number.MAX_VALUE) === true) { + $ERROR('#8: Number.MAX_VALUE !== Not-a-Number'); +} + +// CHECK#9 +if (isNaN(Number.MIN_VALUE) === true) { + $ERROR('#9: Number.MIN_VALUE !== Not-a-Number'); +} + +// CHECK#10 +if (isNaN(-0) === true) { + $ERROR('#10: -0 !== Not-a-Number'); +} + +// CHECK#11 +if (isNaN(true) === true) { + $ERROR('#11: true !== Not-a-Number'); +} + +// CHECK#12 +if (isNaN("1") === true) { + $ERROR('#12: "1" !== Not-a-Number'); +} + + + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T2.js new file mode 100644 index 000000000..6be2762bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A1_T2.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.4_A1_T2; + * @section: 15.1.2.4; + * @assertion: isNaN applies ToNumber to its argument, then return true if the result is NaN, and otherwise return false; + * @description: Checking all object; +*/ + +// CHECK#1 +if (!(isNaN({}) === true)) { + $ERROR('#1: {} === Not-a-Number. Actual: ' + ({})); +} + +// CHECK#2 +if (!(isNaN(new String("string")) === true)) { + $ERROR('#2: new String("string") === Not-a-Number. Actual: ' + (new String("string"))); +} + +// CHECK#3 +if (isNaN(new String("1")) === true) { + $ERROR('#3: new String("1") === Not-a-Number. Actual: ' + (new String("1"))); +} + +// CHECK#4 +if (isNaN(new Number(1)) === true) { + $ERROR('#4: new Number(1) !== Not-a-Number'); +} + +// CHECK#5 +if (!(isNaN(new Number(NaN)) === true)) { + $ERROR('#5: new Number(NaN) === Not-a-Number. Actual: ' + (new Number(NaN))); +} + +// CHECK#6 +if (isNaN(new Boolean(true)) === true) { + $ERROR('#6: new Boolean(true) !== Not-a-Number'); +} + + + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.1.js new file mode 100644 index 000000000..c8bf95da2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.4_A2.1; + * @section: 15.1.2.4, 15.2.4.7, 12.6.4; + * @assertion: The length property of isNaN has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (isNaN.propertyIsEnumerable('length') !== false) { + $ERROR('#1: isNaN.propertyIsEnumerable(\'length\') === false. Actual: ' + (isNaN.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (p in isNaN){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in isNaN) { if (p === "length") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.2.js new file mode 100644 index 000000000..37992570e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.2.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.4_A2.2; + * @section: 15.1.2.4, 15.2.4.5, 11.4.1; + * @assertion: The length property of isNaN has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; + * @strict_mode_negative +*/ + +//CHECK#1 +if (isNaN.hasOwnProperty('length') !== true) { + $FAIL('#1: isNaN.hasOwnProperty(\'length\') === true. Actual: ' + (isNaN.hasOwnProperty('length'))); +} + +delete isNaN.length; + +//CHECK#2 +if (isNaN.hasOwnProperty('length') !== true) { + $ERROR('#2: delete isNaN.length; isNaN.hasOwnProperty(\'length\') === true. Actual: ' + (isNaN.hasOwnProperty('length'))); +} + +//CHECK#3 +if (isNaN.length === undefined) { + $ERROR('#3: delete isNaN.length; isNaN.length !== undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.3.js new file mode 100644 index 000000000..0e8f44fc7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.4_A2.3; + * @section: 15.1.2.4; + * @assertion: The length property of isNaN has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +x = isNaN.length; +isNaN.length = Infinity; +if (isNaN.length !== x) { + $ERROR('#1: x = isNaN.length; isNaN.length = Infinity; isNaN.length === x. Actual: ' + (isNaN.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.4.js new file mode 100644 index 000000000..48af19758 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.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.1.2.4_A2.4; + * @section: 15.1.2.4; + * @assertion: The length property of isNaN is 1; + * @description: isNaN.length === 1; +*/ + +//CHECK#1 +if (isNaN.length !== 1) { + $ERROR('#1: isNaN.length === 1. Actual: ' + (isNaN.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.5.js new file mode 100644 index 000000000..e42438535 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.4_A2.5; + * @section: 15.1.2.4, 15.2.4.7, 12.6.4; + * @assertion: The isNaN property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('isNaN') !== false) { + $ERROR('#1: this.propertyIsEnumerable(\'isNaN\') === false. Actual: ' + (this.propertyIsEnumerable('isNaN'))); +} + +//CHECK#2 +var result = true; +for (p in this){ + if (p === "isNaN") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "isNaN") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.6.js new file mode 100644 index 000000000..f1595ffb7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.4_A2.6; +* @section: 15.1.2.4; +* @assertion: The isNaN property has not prototype property; +* @description: Checking isNaN.prototype; +*/ + +//CHECK#1 +if (isNaN.prototype !== undefined) { + $ERROR('#1: isNaN.prototype === undefined. Actual: ' + (isNaN.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.7.js new file mode 100644 index 000000000..844d8db5c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.4_isNaN/S15.1.2.4_A2.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.4_A2.7; +* @section: 15.1.2.4, 11.2.2; +* @assertion: The isNaN property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new isNaN(); + $ERROR('#1.1: new isNaN() throw TypeError. Actual: ' + (new isNaN())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new isNaN() throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T1.js new file mode 100644 index 000000000..3c7a0744c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T1.js @@ -0,0 +1,69 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A1_T1; + * @section: 15.1.2.5; + * @assertion: isFinite applies ToNumber to its argument, then return false if the result is NaN, +Infinity, -Infinity, and otherwise return true; + * @description: Checking all primitive; +*/ + +// CHECK#1 +if (!(isFinite(NaN) === false)) { + $ERROR('#1: NaN === Not-a-Finite. Actual: ' + (NaN)); +} + +// CHECK#2 +if (!(isFinite(Number.NaN) === false)) { + $ERROR('#2: Number.NaN === Not-a-Finite. Actual: ' + (Number.NaN)); +} + +// CHECK#3 +if (!(isFinite(Number(void 0)) === false)) { + $ERROR('#3: Number(void 0) === Not-a-Finite. Actual: ' + (Number(void 0))); +} + +// CHECK#4 +if (!(isFinite(void 0) === false)) { + $ERROR('#4: void 0 === Not-a-Finite. Actual: ' + (void 0)); +} + +// CHECK#5 +if (!(isFinite("string") === false)) { + $ERROR('#5: "string" === Not-a-Finite. Actual: ' + ("string")); +} + +// CHECK#6 +if (isFinite(Number.POSITIVE_INFINITY) !== false) { + $ERROR('#6: Number.POSITIVE_INFINITY === Not-a-Finite. Actual: ' + (Number.POSITIVE_INFINITY)); +} + +// CHECK#7 +if (isFinite(Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#7: Number.NEGATIVE_INFINITY === Not-a-Finite. Actual: ' + (Number.NEGATIVE_INFINITY)); +} + +// CHECK#8 +if (isFinite(Number.MAX_VALUE) === false) { + $ERROR('#8: Number.MAX_VALUE !== Not-a-Finite'); +} + +// CHECK#9 +if (isFinite(Number.MIN_VALUE) === false) { + $ERROR('#9: Number.MIN_VALUE !== Not-a-Finite'); +} + +// CHECK#10 +if (isFinite(-0) === false) { + $ERROR('#10: -0 !== Not-a-Finite'); +} + +// CHECK#11 +if (isFinite(false) === false) { + $ERROR('#11: false !== Not-a-Finite'); +} + +// CHECK#12 +if (isFinite("1") === false) { + $ERROR('#12: "1" !== Not-a-Finite'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T2.js new file mode 100644 index 000000000..8557087e7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A1_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A1_T2; + * @section: 15.1.2.5; + * @assertion: isFinite applies ToNumber to its argument, then return false if the result is NaN, +Infinity, -Infinity, and otherwise return true; + * @description: Checking all object; +*/ + +// CHECK#1 +if (!(isFinite({}) === false)) { + $ERROR('#1: {} === Not-a-Finite. Actual: ' + ({})); +} + +// CHECK#2 +if (!(isFinite(new String("string")) === false)) { + $ERROR('#2: new String("string") === Not-a-Finite. Actual: ' + (new String("string"))); +} + +// CHECK#3 +if (isFinite(new String("1")) === false) { + $ERROR('#3: new String("1") === Not-a-Finite. Actual: ' + (new String("1"))); +} + +// CHECK#4 +if (isFinite(new Number(1)) === false) { + $ERROR('#4: new Number(1) !== Not-a-Finite'); +} + +// CHECK#5 +if (!(isFinite(new Number(NaN)) === false)) { + $ERROR('#5: new Number(NaN) === Not-a-Finite. Actual: ' + (new Number(NaN))); +} + +// CHECK#6 +if (isFinite(new Boolean(true)) === false) { + $ERROR('#6: new Boolean(true) !== Not-a-Finite'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.1.js new file mode 100644 index 000000000..59cbe8a12 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A2.1; + * @section: 15.1.2.5, 15.2.4.7, 12.6.4; + * @assertion: The length property of isFinite has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (isFinite.propertyIsEnumerable('length') !== false) { + $ERROR('#1: isFinite.propertyIsEnumerable(\'length\') === false. Actual: ' + (isFinite.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (p in isFinite){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in isFinite) { if (p === "length") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.2.js new file mode 100644 index 000000000..f106d908c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.2.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A2.2; + * @section: 15.1.2.5, 15.2.4.5, 11.4.1; + * @assertion: The length property of isFinite has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; + * @strict_mode_negative +*/ + +//CHECK#1 +if (isFinite.hasOwnProperty('length') !== true) { + $FAIL('#1: isFinite.hasOwnProperty(\'length\') === true. Actual: ' + (isFinite.hasOwnProperty('length'))); +} + +delete isFinite.length; + +//CHECK#2 +if (isFinite.hasOwnProperty('length') !== true) { + $ERROR('#2: delete isFinite.length; isFinite.hasOwnProperty(\'length\') === true. Actual: ' + (isFinite.hasOwnProperty('length'))); +} + +//CHECK#3 +if (isFinite.length === undefined) { + $ERROR('#3: delete isFinite.length; isFinite.length !== undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.3.js new file mode 100644 index 000000000..4cc8f8bff --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A2.3; + * @section: 15.1.2.5; + * @assertion: The length property of isFinite has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +x = isFinite.length; +isFinite.length = Infinity; +if (isFinite.length !== x) { + $ERROR('#1: x = isFinite.length; isFinite.length = Infinity; isFinite.length === x. Actual: ' + (isFinite.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.4.js new file mode 100644 index 000000000..73d9fcda0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.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.1.2.5_A2.4; + * @section: 15.1.2.5; + * @assertion: The length property of isFinite is 1; + * @description: isFinite.length === 1; +*/ + +//CHECK#1 +if (isFinite.length !== 1) { + $ERROR('#1: isFinite.length === 1. Actual: ' + (isFinite.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.5.js new file mode 100644 index 000000000..d89b2cc1d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.5.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.5_A2.5; + * @section: 15.1.2.5, 15.2.4.7, 12.6.4; + * @assertion: The isFinite property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('isFinite') !== false) { + $ERROR('#1: this.propertyIsEnumerable(\'isFinite\') === false. Actual: ' + (this.propertyIsEnumerable('isFinite'))); +} + +//CHECK#2 +var result = true; +for (p in this){ + if (p === "isFinite") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "isFinite") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.6.js new file mode 100644 index 000000000..15e691b3f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.5_A2.6; +* @section: 15.1.2.5; +* @assertion: The isFinite property has not prototype property; +* @description: Checking isFinit.prototype; +*/ + +//CHECK#1 +if (isFinite.prototype !== undefined) { + $ERROR('#1: isFinite.prototype === undefined. Actual: ' + (isFinite.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.7.js new file mode 100644 index 000000000..43519bd6a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.5_isFinite/S15.1.2.5_A2.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.5_A2.7; +* @section: 15.1.2.5, 11.2.2; +* @assertion: The isFinite property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new isFinite(); + $ERROR('#1.1: new isFinite() throw TypeError. Actual: ' + (new isFinite())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new isFinite() throw TypeError. Actual: ' + (e)); + } +} |