diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts')
88 files changed, 2883 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A1.js new file mode 100644 index 000000000..f2aa5c164 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A1.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.3_A1; + * @section: 10.1.3; + * @assertion: If the caller supplies fewer parameter values than there are + * formal parameters, the extra formal parameters have value undefined; + * @description: Calling function excluding a few parameters; +*/ + +//CHECK#1 +function f1(a, b){ + return (b === undefined); +} +if(!(f1(1, 2) === false)){ + $ERROR('#1: f1(1, 2) === false'); +} else if(!(f1(1) === true)){ + $ERROR('#1: f1(1) === true'); +} + +//CHECK#2 +function f2(a, b, c){ + return (b === undefined) && (c === undefined); +} +if(!(f2(1) === true)){ + $ERROR('#2: f2(1, 2) === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A2.js new file mode 100644 index 000000000..ff5c3ac61 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A2.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: S10.1.3_A2; + * @section: 10.1.3; + * @assertion: If two or more formal parameters share the same name, hence + * the same property, the corresponding property is given the value that was + * supplied for the last parameter with this name; + * @description: Creating functions initialized with two or more formal parameters, which have the same name; +*/ + +//CHECK#1 +function f1(x, x) { + return x; +} +if(!(f1(1, 2) === 2)) { + $ERROR("#1: f1(1, 2) === 2"); +} + +//CHECK#2 +function f2(x, x, x){ + return x*x*x; +} +if(!(f2(1, 2, 3) === 27)){ + $ERROR("f2(1, 2, 3) === 27"); +} + +//CHECK#3 +function f3(x, x) { + return 'a' + x; +} +if(!(f3(1, 2) === 'a2')){ + $ERROR("#3: f3(1, 2) === 'a2'"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A3.js new file mode 100644 index 000000000..da923f14b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A3.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: S10.1.3_A3; + * @section: 10.1.3; + * @assertion: If the value of this last parameter (which has the same + * name as some previous parameters do) was not supplied by the + * caller, the value of the corresponding property is undefined; + * @description: Creating functions with two or more formal parameters, + * that have the same name. Calling this function excluding a few last parameters; +*/ + +//CHECK#1 +function f1(x, a, b, x){ + return x; +} +if(!(f1(1, 2) === undefined)){ + $ERROR('#1: f1(1, 2) === undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T1.js new file mode 100644 index 000000000..bc556a80d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T1.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.3_A4_T1; + * @section: 10.1.3; + * @assertion: Function declaration in function code - If the variable object + * already has a property with the name of Function Identifier, replace its + * value and attributes. Semantically, this step must follow the creation of + * FormalParameterList properties; + * @description: Checking existence of a function with passed parameter; +*/ + +//CHECK#1 +function f1(x){ + return x; + + function x(){ + return 7; + } +} +if(!(f1().constructor.prototype === Function.prototype)){ + $ERROR('#1: f1() returns function'); +} + +//CHECK#2 +function f2(x){ + return typeof x; + + function x(){ + return 7; + } +} +if(!(f2() === "function")){ + $ERROR('#2: f2() === "function"'); +} + +//CHECK#3 +function f3() { + return typeof arguments; + function arguments() { + return 7; + } +} +if (!(f3() === "function")){ + $ERROR('#3: f3() === "function"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T2.js new file mode 100644 index 000000000..9f0fcf281 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A4_T2.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.3_A4_T2; + * @section: 10.1.3; + * @assertion: Function declaration in function code - If the variable object + * already has a property with the name of Function Identifier, replace its + * value and attributes. Semantically, this step must follow the creation of + * FormalParameterList properties; + * @description: Checking existence of a function with declared variable; +*/ + +//CHECK#1 +function f1(){ + var x; + + return x; + + function x(){ + return 7; + } +} +if(!(f1().constructor.prototype === Function.prototype)){ + $PRINT('#1: f1() returns function'); +} + +//CHECK#2 +function f2(){ + var x; + + return typeof x; + + function x(){ + return 7; + } +} +if(!(f2() === "function")){ + $PRINT('#2: f2() === "function"'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.1_T1.js new file mode 100644 index 000000000..a2a487e4e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.1_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: S10.1.3_A5.1_T1; + * @section: 10.1.3; + * @assertion: For each VariableDeclaration or VariableDeclarationNoIn in the + * code, create a property of the variable object whose name is the Identifier + * in the VariableDeclaration or VariableDeclarationNoIn, whose value is + * undefined and whose attributes are determined by the type of code; + * @description: Checking variable existence only; +*/ + +//CHECK#1 +function f1(){ + var x; + + return typeof x; +} + +if(!(f1() === "undefined")){ + $PRINT('#1: f1() === "undefined"'); +} + +//CHECK#2 +function f2(){ + var x; + + return x; +} + +if(!(f2() === undefined)){ + $PRINT('#1: f2() === undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.1_T2.js new file mode 100644 index 000000000..2325854d9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.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: S10.1.3_A5.1_T2; + * @section: 10.1.3; + * @assertion: For each VariableDeclaration or VariableDeclarationNoIn in the + * code, create a property of the variable object whose name is the Identifier + * in the VariableDeclaration or VariableDeclarationNoIn, whose value is + * undefined and whose attributes are determined by the type of code; + * @description: Checking existence of the variable object property with formal parameter; +*/ + +//CHECK#1 +function f1(x){ + var x; + + return typeof x; +} + +if(!(f1() === "undefined")){ + $PRINT('#1: f1(1) === "undefined"'); +} + +//CHECK#2 +function f2(x){ + var x; + + return x; +} + +if(!(f2() === undefined)){ + $PRINT('#1: f2(1) === undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.2_T1.js new file mode 100644 index 000000000..f681058c8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.3_Variable_Instantiation/S10.1.3_A5.2_T1.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: S10.1.3_A5.2_T1; + * @section: 10.1.3; + * @assertion: If there is already a property of the variable object with the + * name of a declared variable, the value of the property and its attributes + * are not changed; + * @description: Checking existence of the variable object property with formal parameter; +*/ + +//CHECK#1 +function f1(x){ + var x; + + return typeof x; +} + +if(!(f1(1) === "number")){ + $PRINT('#1: f1(1) === "number"'); +} + +//CHECK#2 +function f2(x){ + var x; + + return x; +} + +if(!(f2(1) === 1)){ + $PRINT('#1: f2(1) === 1'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T1.js new file mode 100644 index 000000000..9b3366270 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.4_A1_T1; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations; +*/ + +var x = 0; + +function f1(){ + var x = 1; + function f2(){ + return x; + }; + return f2(); +} + +if(!(f1() === 1)){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T2.js new file mode 100644 index 000000000..b73e3467a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_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: S10.1.4_A1_T2; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations; +*/ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + return f2(); +} + +if(!(f1() === 0)){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T3.js new file mode 100644 index 000000000..4d6e17dd1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T3.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: S10.1.4_A1_T3; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations; +*/ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + return f2(); + + var x = 1; +} + +if(!(f1() === undefined)){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T4.js new file mode 100644 index 000000000..bbc27a27e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T4.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: S10.1.4_A1_T4; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations; +*/ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + + var x = 1; + return f2(); +} + +if(!(f1() === 1)){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T5.js new file mode 100644 index 000000000..4374e9832 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_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: S10.1.4_A1_T5; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations and "with"; +*/ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + var x = 1; + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T6.js new file mode 100644 index 000000000..14f878114 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T6.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.4_A1_T6; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations and "with"; +*/ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T7.js new file mode 100644 index 000000000..2edd0c379 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T7.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: S10.1.4_A1_T7; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations and "with"; +*/ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); + + var x = 1; +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T8.js new file mode 100644 index 000000000..0286c468d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T8.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: S10.1.4_A1_T8; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations and "with"; +*/ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + + var x = 1; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T9.js new file mode 100644 index 000000000..173cb43da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.4_Scope_Chain_and_Identifier_Resolution/S10.1.4_A1_T9.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: S10.1.4_A1_T9; + * @section: 10.1.4; + * @assertion: Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier; + * @description: Checking scope chain containing function declarations and "with"; +*/ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + with(myObj){ + return x; + } +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T1.js new file mode 100644 index 000000000..49db4a2e6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.1_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Global execution context - Value Properties; +*/ + +//CHECK#1 +if ( NaN === null ) { + $ERROR("#1: NaN === null"); +} + +//CHECK#2 +if ( Infinity === null ) { + $ERROR("#2: Infinity === null"); +} + +//CHECK#3 +if ( undefined === null ) { + $ERROR("#3: undefined === null"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T2.js new file mode 100644 index 000000000..dccfa891c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T2.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.1_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Global execution context - Function Properties; +*/ + +//CHECK#4 +if ( eval === null ) { + $ERROR("#4: eval === null"); +} + +//CHECK#5 +if ( parseInt === null ) { + $ERROR("#5: parseInt === null"); +} + +//CHECK#6 +if ( parseFloat === null ) { + $ERROR("#6: parseFloat === null"); +} + +//CHECK#7 +if ( isNaN === null ) { + $ERROR("#7: isNaN === null"); +} + +//CHECK#8 +if ( isFinite === null ) { + $ERROR("#8: isFinite === null"); +} + +//CHECK#9 +if ( decodeURI === null ) { + $ERROR("#9: decodeURI === null"); +} + +//CHECK#10 +if ( decodeURIComponent === null ) { + $ERROR("#10: decodeURIComponent === null"); +} + +//CHECK#11 +if ( encodeURI === null ) { + $ERROR("#11: encodeURI === null"); +} + +//CHECK#12 +if ( encodeURIComponent === null ) { + $ERROR("#12: encodeURIComponent === null"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T3.js new file mode 100644 index 000000000..6f48b7d55 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T3.js @@ -0,0 +1,86 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.1_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Global execution context - Constructor Properties; +*/ + +//CHECK#13 +if ( Object === null ) { + $ERROR("#13: Object === null"); +} + +//CHECK#14 +if ( Function === null ) { + $ERROR("#14: Function === null"); +} + +//CHECK#15 +if ( String === null ) { + $ERROR("#15: String === null"); +} + +//CHECK#16 +if ( Number === null ) { + $ERROR("#16: Number === null"); +} + +//CHECK#17 +if ( Array === null ) { + $ERROR("#17: Array === null"); +} + +//CHECK#18 +if ( Boolean === null ) { + $ERROR("#20: Boolean === null"); +} + +//CHECK#18 +if ( Date === null ) { + $ERROR("#18: Date === null"); +} + +//CHECK#19 +if ( RegExp === null ) { + $ERROR("#19: RegExp === null"); +} + +//CHECK#20 +if ( Error === null ) { + $ERROR("#20: Error === null"); +} + +//CHECK#21 +if ( EvalError === null ) { + $ERROR("#21: EvalError === null"); +} + +//CHECK#22 +if ( RangeError === null ) { + $ERROR("#22: RangeError === null"); +} + +//CHECK#23 +if ( ReferenceError === null ) { + $ERROR("#23: ReferenceError === null"); +} + +//CHECK#24 +if ( SyntaxError === null ) { + $ERROR("#24: SyntaxError === null"); +} + +//CHECK#25 +if ( TypeError === null ) { + $ERROR("#25: TypeError === null"); +} + +//CHECK#26 +if ( URIError === null ) { + $ERROR("#26: URIError === null"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_T4.js new file mode 100644 index 000000000..aecf44d86 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.1_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: S10.1.5_A1.1_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Global execution context - Other Properties; +*/ + +//CHECK#27 +if ( Math === null ) { + $ERROR("#27: Math === null"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T1.js new file mode 100644 index 000000000..e89b59215 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T1.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.2_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Function execution context - Value Properties; +*/ + +function test() { + //CHECK#1 + if ( NaN === null ) { + $ERROR("#1: NaN === null"); + } + + //CHECK#2 + if ( Infinity === null ) { + $ERROR("#2: Infinity === null"); + } + + //CHECK#3 + if ( undefined === null ) { + $ERROR("#3: undefined === null"); + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T2.js new file mode 100644 index 000000000..464a53267 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_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: S10.1.5_A1.2_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Function execution context - Function Properties; +*/ + +function test() { + //CHECK#4 + if ( eval === null ) { + $ERROR("#4: eval === null"); + } + + //CHECK#5 + if ( parseInt === null ) { + $ERROR("#5: parseInt === null"); + } + + //CHECK#6 + if ( parseFloat === null ) { + $ERROR("#6: parseFloat === null"); + } + + //CHECK#7 + if ( isNaN === null ) { + $ERROR("#7: isNaN === null"); + } + + //CHECK#8 + if ( isFinite === null ) { + $ERROR("#8: isFinite === null"); + } + + //CHECK#9 + if ( decodeURI === null ) { + $ERROR("#9: decodeURI === null"); + } + + //CHECK#10 + if ( decodeURIComponent === null ) { + $ERROR("#10: decodeURIComponent === null"); + } + + //CHECK#11 + if ( encodeURI === null ) { + $ERROR("#11: encodeURI === null"); + } + + //CHECK#12 + if ( encodeURIComponent === null ) { + $ERROR("#12: encodeURIComponent === null"); + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T3.js new file mode 100644 index 000000000..174752415 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T3.js @@ -0,0 +1,89 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.2_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Function execution context - Constructor Properties; +*/ + +function test() { + //CHECK#13 + if ( Object === null ) { + $ERROR("#13: Object === null"); + } + + //CHECK#14 + if ( Function === null ) { + $ERROR("#14: Function === null"); + } + + //CHECK#15 + if ( String === null ) { + $ERROR("#15: String === null"); + } + + //CHECK#16 + if ( Number === null ) { + $ERROR("#16: Function === null"); + } + + //CHECK#17 + if ( Array === null ) { + $ERROR("#17: Array === null"); + } + + //CHECK#18 + if ( Boolean === null ) { + $ERROR("#20: Boolean === null"); + } + + //CHECK#18 + if ( Date === null ) { + $ERROR("#18: Date === null"); + } + + //CHECK#19 + if ( RegExp === null ) { + $ERROR("#19: RegExp === null"); + } + + //CHECK#20 + if ( Error === null ) { + $ERROR("#20: Error === null"); + } + + //CHECK#21 + if ( EvalError === null ) { + $ERROR("#21: EvalError === null"); + } + + //CHECK#22 + if ( RangeError === null ) { + $ERROR("#22: RangeError === null"); + } + + //CHECK#23 + if ( ReferenceError === null ) { + $ERROR("#23: ReferenceError === null"); + } + + //CHECK#24 + if ( SyntaxError === null ) { + $ERROR("#24: SyntaxError === null"); + } + + //CHECK#25 + if ( TypeError === null ) { + $ERROR("#25: TypeError === null"); + } + + //CHECK#26 + if ( URIError === null ) { + $ERROR("#26: URIError === null"); + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_T4.js new file mode 100644 index 000000000..bad81c43a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.2_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: S10.1.5_A1.2_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Function execution context - Other Properties; +*/ + +function test() { + //CHECK#27 + if ( Math === null ) { + $ERROR("#27: Math === null"); + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T1.js new file mode 100644 index 000000000..20e07d349 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T1.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.3_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Eval execution context - Value Properties; +*/ + +var evalStr = +'//CHECK#1\n'+ +'if ( NaN === null ) {\n'+ +' $ERROR("#1: NaN === null");\n'+ +'}\n'+ + +'//CHECK#2\n'+ +'if ( Infinity === null ) {\n'+ +' $ERROR("#2: Infinity === null");\n'+ +'}\n'+ + +'//CHECK#3\n'+ +'if ( undefined === null ) {\n'+ +' $ERROR("#3: undefined === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T2.js new file mode 100644 index 000000000..8925b29be --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_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: S10.1.5_A1.3_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Eval execution context - Function Properties; +*/ + +var evalStr = +'//CHECK#4\n'+ +'if ( eval === null ) {\n'+ +' $ERROR("#4: eval === null");\n'+ +'}\n'+ + +'//CHECK#5\n'+ +'if ( parseInt === null ) {\n'+ +' $ERROR("#5: parseInt === null");\n'+ +'}\n'+ + +'//CHECK#6\n'+ +'if ( parseFloat === null ) {\n'+ +' $ERROR("#6: parseFloat === null");\n'+ +'}\n'+ + +'//CHECK#7\n'+ +'if ( isNaN === null ) {\n'+ +' $ERROR("#7: isNaN === null");\n'+ +'}\n'+ + +'//CHECK#8\n'+ +'if ( isFinite === null ) {\n'+ +' $ERROR("#8: isFinite === null");\n'+ +'}\n'+ + +'//CHECK#9\n'+ +'if ( decodeURI === null ) {\n'+ +' $ERROR("#9: decodeURI === null");\n'+ +'}\n'+ + +'//CHECK#10\n'+ +'if ( decodeURIComponent === null ) {\n'+ +' $ERROR("#10: decodeURIComponent === null");\n'+ +'}\n'+ + +'//CHECK#11\n'+ +'if ( encodeURI === null ) {\n'+ +' $ERROR("#11: encodeURI === null");\n'+ +'}\n'+ + +'//CHECK#12\n'+ +'if ( encodeURIComponent === null ) {\n'+ +' $ERROR("#12: encodeURIComponent === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T3.js new file mode 100644 index 000000000..050c8bfcf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T3.js @@ -0,0 +1,89 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A1.3_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Eval execution context - Constructor Properties; +*/ + +var evalStr = +'//CHECK#13\n'+ +'if ( Object === null ) {\n'+ +' $ERROR("#13: Object === null");\n'+ +'}\n'+ + +'//CHECK#14\n'+ +'if ( Function === null ) {\n'+ +' $ERROR("#14: Function === null");\n'+ +'}\n'+ + +'//CHECK#15\n'+ +'if ( String === null ) {\n'+ +' $ERROR("#15: String === null");\n'+ +'}\n'+ + +'//CHECK#16\n'+ +'if ( Number === null ) {\n'+ +' $ERROR("#16: Function === null");\n'+ +'}\n'+ + +'//CHECK#17\n'+ +'if ( Array === null ) {\n'+ +' $ERROR("#17: Array === null");\n'+ +'}\n'+ + +'//CHECK#18\n'+ +'if ( Boolean === null ) {\n'+ +' $ERROR("#20: Boolean === null");\n'+ +'}\n'+ + +'//CHECK#18\n'+ +'if ( Date === null ) {\n'+ +' $ERROR("#18: Date === null");\n'+ +'}\n'+ + +'//CHECK#19\n'+ +'if ( RegExp === null ) {\n'+ +' $ERROR("#19: RegExp === null");\n'+ +'}\n'+ + +'//CHECK#20\n'+ +'if ( Error === null ) {\n'+ +' $ERROR("#20: Error === null");\n'+ +'}\n'+ + +'//CHECK#21\n'+ +'if ( EvalError === null ) {\n'+ +' $ERROR("#21: EvalError === null");\n'+ +'}\n'+ + +'//CHECK#22\n'+ +'if ( RangeError === null ) {\n'+ +' $ERROR("#22: RangeError === null");\n'+ +'}\n'+ + +'//CHECK#23\n'+ +'if ( ReferenceError === null ) {\n'+ +' $ERROR("#23: ReferenceError === null");\n'+ +'}\n'+ + +'//CHECK#24\n'+ +'if ( SyntaxError === null ) {\n'+ +' $ERROR("#24: SyntaxError === null");\n'+ +'}\n'+ + +'//CHECK#25\n'+ +'if ( TypeError === null ) {\n'+ +' $ERROR("#25: TypeError === null");\n'+ +'}\n'+ + +'//CHECK#26\n'+ +'if ( URIError === null ) {\n'+ +' $ERROR("#26: URIError === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_T4.js new file mode 100644 index 000000000..62418aad3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A1.3_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: S10.1.5_A1.3_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc; + * @description: Eval execution context - Other Properties; +*/ + +var evalStr = +'//CHECK#27\n'+ +'if ( Math === null ) {\n'+ +' $ERROR("#27: Math === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T1.js new file mode 100644 index 000000000..caa0d1ba1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_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: S10.1.5_A2.1_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Value Properties; +*/ + +//CHECK#1 +for (var x in this) { + if ( x === 'NaN' ) { + $ERROR("#1: 'NaN' have attribute DontEnum"); + } else if ( x === 'Infinity' ) { + $ERROR("#1: 'Infinity' have attribute DontEnum"); + } else if ( x === 'undefined' ) { + $ERROR("#1: 'undefined' have attribute DontEnum"); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T2.js new file mode 100644 index 000000000..f9fb53f23 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T2.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: S10.1.5_A2.1_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Function Properties; +*/ + +//CHECK#1 +for (var x in this) { + if ( x === 'eval' ) { + $ERROR("#1: 'eval' have attribute DontEnum"); + } else if ( x === 'parseInt' ) { + $ERROR("#1: 'parseInt' have attribute DontEnum"); + } else if ( x === 'parseFloat' ) { + $ERROR("#1: 'parseFloat' have attribute DontEnum"); + } else if ( x === 'isNaN' ) { + $ERROR("#1: 'isNaN' have attribute DontEnum"); + } else if ( x === 'isFinite' ) { + $ERROR("#1: 'isFinite' have attribute DontEnum"); + } else if ( x === 'decodeURI' ) { + $ERROR("#1: 'decodeURI' have attribute DontEnum"); + } else if ( x === 'decodeURIComponent' ) { + $ERROR("#1: 'decodeURIComponent' have attribute DontEnum"); + } else if ( x === 'encodeURI' ) { + $ERROR("#1: 'encodeURI' have attribute DontEnum"); + } else if ( x === 'encodeURIComponent' ) { + $ERROR("#1: 'encodeURIComponent' have attribute DontEnum"); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T3.js new file mode 100644 index 000000000..d341c9247 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T3.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: S10.1.5_A2.1_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Constructor Properties; +*/ + +//CHECK#1 +for (var x in this) { + if ( x === 'Object' ) { + $ERROR("#1: 'property 'Object' have attribute DontEnum"); + } else if ( x === 'Function') { + $ERROR("#1: 'Function' have attribute DontEnum"); + } else if ( x === 'String' ) { + $ERROR("#1: 'String' have attribute DontEnum"); + } else if ( x === 'Number' ) { + $ERROR("#1: 'Number' have attribute DontEnum"); + } else if ( x === 'Array' ) { + $ERROR("#1: 'Array' have attribute DontEnum"); + } else if ( x === 'Boolean' ) { + $ERROR("#1: 'Boolean' have attribute DontEnum"); + } else if ( x === 'Date' ) { + $ERROR("#1: 'Date' have attribute DontEnum"); + } else if ( x === 'RegExp' ) { + $ERROR("#1: 'RegExp' have attribute DontEnum"); + } else if ( x === 'Error' ) { + $ERROR("#1: 'Error' have attribute DontEnum"); + } else if ( x === 'EvalError' ) { + $ERROR("#1: 'EvalError' have attribute DontEnum"); + } else if ( x === 'RangeError' ) { + $ERROR("#1: 'RangeError' have attribute DontEnum"); + } else if ( x === 'ReferenceError' ) { + $ERROR("#1: 'ReferenceError' have attribute DontEnum"); + } else if ( x === 'SyntaxError' ) { + $ERROR("#1: 'SyntaxError' have attribute DontEnum"); + } else if ( x === 'TypeError' ) { + $ERROR("#1: 'TypeError' have attribute DontEnum"); + } else if ( x === 'URIError' ) { + $ERROR("#1: 'URIError' have attribute DontEnum"); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T4.js new file mode 100644 index 000000000..d26b2c5ca --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.1_T4.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: S10.1.5_A2.1_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Other Properties; +*/ + +//CHECK#1 +for (var x in this) { + if ( x === 'Math' ) { + $ERROR("#1: 'Math' have attribute DontEnum"); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T1.js new file mode 100644 index 000000000..ab90dba4f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_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: S10.1.5_A2.2_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Function execution context - Value Properties; +*/ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'NaN' ) { + $ERROR("#1: 'NaN' have attribute DontEnum"); + } else if ( x === 'Infinity' ) { + $ERROR("#1: 'Infinity' have attribute DontEnum"); + } else if ( x === 'undefined' ) { + $ERROR("#1: 'undefined' have attribute DontEnum"); + } + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T2.js new file mode 100644 index 000000000..115edc89c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T2.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A2.2_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Function execution context - Function Properties; +*/ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'eval' ) { + $ERROR("#1: 'eval' have attribute DontEnum"); + } else if ( x === 'parseInt' ) { + $ERROR("#1: 'parseInt' have attribute DontEnum"); + } else if ( x === 'parseFloat' ) { + $ERROR("#1: 'parseFloat' have attribute DontEnum"); + } else if ( x === 'isNaN' ) { + $ERROR("#1: 'isNaN' have attribute DontEnum"); + } else if ( x === 'isFinite' ) { + $ERROR("#1: 'isFinite' have attribute DontEnum"); + } else if ( x === 'decodeURI' ) { + $ERROR("#1: 'decodeURI' have attribute DontEnum"); + } else if ( x === 'decodeURIComponent' ) { + $ERROR("#1: 'decodeURIComponent' have attribute DontEnum"); + } else if ( x === 'encodeURI' ) { + $ERROR("#1: 'encodeURI' have attribute DontEnum"); + } else if ( x === 'encodeURIComponent' ) { + $ERROR("#1: 'encodeURIComponent' have attribute DontEnum"); + } + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T3.js new file mode 100644 index 000000000..c200c7488 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T3.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A2.2_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Function execution context - Constructor Properties; +*/ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'Object' ) { + $ERROR("#1: 'property 'Object' have attribute DontEnum"); + } else if ( x === 'Function') { + $ERROR("#1: 'Function' have attribute DontEnum"); + } else if ( x === 'String' ) { + $ERROR("#1: 'String' have attribute DontEnum"); + } else if ( x === 'Number' ) { + $ERROR("#1: 'Number' have attribute DontEnum"); + } else if ( x === 'Array' ) { + $ERROR("#1: 'Array' have attribute DontEnum"); + } else if ( x === 'Boolean' ) { + $ERROR("#1: 'Boolean' have attribute DontEnum"); + } else if ( x === 'Date' ) { + $ERROR("#1: 'Date' have attribute DontEnum"); + } else if ( x === 'RegExp' ) { + $ERROR("#1: 'RegExp' have attribute DontEnum"); + } else if ( x === 'Error' ) { + $ERROR("#1: 'Error' have attribute DontEnum"); + } else if ( x === 'EvalError' ) { + $ERROR("#1: 'EvalError' have attribute DontEnum"); + } else if ( x === 'RangeError' ) { + $ERROR("#1: 'RangeError' have attribute DontEnum"); + } else if ( x === 'ReferenceError' ) { + $ERROR("#1: 'ReferenceError' have attribute DontEnum"); + } else if ( x === 'SyntaxError' ) { + $ERROR("#1: 'SyntaxError' have attribute DontEnum"); + } else if ( x === 'TypeError' ) { + $ERROR("#1: 'TypeError' have attribute DontEnum"); + } else if ( x === 'URIError' ) { + $ERROR("#1: 'URIError' have attribute DontEnum"); + } + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_T4.js new file mode 100644 index 000000000..0b1519040 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.2_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: S10.1.5_A2.2_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Function execution context - Other Properties; +*/ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'Math' ) { + $ERROR("#1: 'Math' have attribute DontEnum"); + } + } +} + +test(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T1.js new file mode 100644 index 000000000..c0979bada --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A2.3_T1; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Value Properties; +*/ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'NaN\' ) {\n'+ +' $ERROR("#1: \'NaN\' have attribute DontEnum");\n'+ +' } else if ( x === \'Infinity\' ) {\n'+ +' $ERROR("#1: \'Infinity\' have attribute DontEnum");\n'+ +' } else if ( x === \'undefined\' ) {\n'+ +' $ERROR("#1: \'undefined\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T2.js new file mode 100644 index 000000000..0bc4bbd63 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_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: S10.1.5_A2.3_T2; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Function Properties; +*/ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'eval\' ) {\n'+ +' $ERROR("#1: \'eval\' have attribute DontEnum");\n'+ +' } else if ( x === \'parseInt\' ) {\n'+ +' $ERROR("#1: \'parseInt\' have attribute DontEnum");\n'+ +' } else if ( x === \'parseFloat\' ) {\n'+ +' $ERROR("#1: \'parseFloat\' have attribute DontEnum");\n'+ +' } else if ( x === \'isNaN\' ) {\n'+ +' $ERROR("#1: \'isNaN\' have attribute DontEnum");\n'+ +' } else if ( x === \'isFinite\' ) {\n'+ +' $ERROR("#1: \'isFinite\' have attribute DontEnum");\n'+ +' } else if ( x === \'decodeURI\' ) {\n'+ +' $ERROR("#1: \'decodeURI\' have attribute DontEnum");\n'+ +' } else if ( x === \'decodeURIComponent\' ) {\n'+ +' $ERROR("#1: \'decodeURIComponent\' have attribute DontEnum");\n'+ +' } else if ( x === \'encodeURI\' ) {\n'+ +' $ERROR("#1: \'encodeURI\' have attribute DontEnum");\n'+ +' } else if ( x === \'encodeURIComponent\' ) {\n'+ +' $ERROR("#1: \'encodeURIComponent\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T3.js new file mode 100644 index 000000000..aadefec4e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T3.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.5_A2.3_T3; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Constructor Properties; +*/ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'Object\' ) {\n'+ +' $ERROR("#1: \'Object\' have attribute DontEnum");\n'+ +' } else if ( x === \'Function\') {\n'+ +' $ERROR("#1: \'Function\' have attribute DontEnum");\n'+ +' } else if ( x === \'String\' ) {\n'+ +' $ERROR("#1: \'String\' have attribute DontEnum");\n'+ +' } else if ( x === \'Number\' ) {\n'+ +' $ERROR("#1: \'Number\' have attribute DontEnum");\n'+ +' } else if ( x === \'Array\' ) {\n'+ +' $ERROR("#1: \'Array\' have attribute DontEnum");\n'+ +' } else if ( x === \'Boolean\' ) {\n'+ +' $ERROR("#1: \'Boolean\' have attribute DontEnum");\n'+ +' } else if ( x === \'Date\' ) {\n'+ +' $ERROR("#1: \'Date\' have attribute DontEnum");\n'+ +' } else if ( x === \'RegExp\' ) {\n'+ +' $ERROR("#1: \'RegExp\' have attribute DontEnum");\n'+ +' } else if ( x === \'Error\' ) {\n'+ +' $ERROR("#1: \'Error\' have attribute DontEnum");\n'+ +' } else if ( x === \'EvalError\' ) {\n'+ +' $ERROR("#1: \'EvalError\' have attribute DontEnum");\n'+ +' } else if ( x === \'RangeError\' ) {\n'+ +' $ERROR("#1: \'RangeError\' have attribute DontEnum");\n'+ +' } else if ( x === \'ReferenceError\' ) {\n'+ +' $ERROR("#1: \'ReferenceError\' have attribute DontEnum");\n'+ +' } else if ( x === \'SyntaxError\' ) {\n'+ +' $ERROR("#1: \'SyntaxError\' have attribute DontEnum");\n'+ +' } else if ( x === \'TypeError\' ) {\n'+ +' $ERROR("#1: \'TypeError\' have attribute DontEnum");\n'+ +' } else if ( x === \'URIError\' ) {\n'+ +' $ERROR("#1: \'URIError\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_T4.js new file mode 100644 index 000000000..c74bcd02b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.5_Global_Object/S10.1.5_A2.3_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: S10.1.5_A2.3_T4; + * @section: 10.1.5, 15.1; + * @assertion: Global object properties have attributes { DontEnum }; + * @description: Global execution context - Other Properties; +*/ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'Math\' ) {\n'+ +' $ERROR("#1: \'Math\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A1.js new file mode 100644 index 000000000..030d57d74 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A1.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: S10.1.8_A1; + * @section: 10.1.8; + * @assertion: When control enters an execution context for function code, + * an arguments object is created and initialised; + * @description: Executing function which uses arguments object; +*/ + +//CHECK#1 +function f1(){ + return arguments; +} + +try{ + var x = f1(); +} +catch(e){ + $ERROR("#1: arguments doesn't exists"); +} + +//CHECK#2 +var f2 = function(){ + return arguments; +} + +try{ + var x = f2(); +} +catch(e){ + $ERROR("#2: arguments doesn't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A2.js new file mode 100644 index 000000000..ad12b57e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A2.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: S10.1.8_A2; + * @section: 10.1.8; + * @assertion: The value of the internal [[Prototype]] property of the + * created arguments object is the original Object prototype object, the one + * that is the initial value of Object.prototype; + * @description: Checking arguments.constructor.prototype===Object.prototype; +*/ + +//CHECK#1 +function f1(){ + return arguments.constructor.prototype; +} +try{ + if(f1() !== Object.prototype){ + $ERROR('#1: arguments.constructor.prototype === Object.prototype'); + } +} +catch(e){ + $ERROR("#1: arguments doesn't exists"); +} + +//CHECK#2 +var f2 = function(){return arguments.constructor.prototype;}; +try{ + if(f2() !== Object.prototype){ + $ERROR('#2: arguments.constructor.prototype === Object.prototype'); + } +} +catch(e){ + $ERROR("#2: arguments doesn't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T1.js new file mode 100644 index 000000000..4b970d33d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_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: S10.1.8_A3_T1; + * @section: 10.1.8; + * @assertion: A property is created with name callee with property + * attributes { DontEnum } and no others; + * @description: Checking existence of arguments.callee property; +*/ + +//CHECK#1 +function f1(){ + return arguments.hasOwnProperty("callee"); +} +try{ + if(f1() !== true){ + $ERROR("#1: arguments object doesn't contains property 'callee'"); + } +} +catch(e){ + $ERROR("#1: arguments object doesn't exists"); +} + +//CHECK#2 +var f2 = function(){return arguments.hasOwnProperty("callee");}; +try{ + if(f2() !== true){ + $ERROR("#2: arguments object doesn't contains property 'callee'"); + } +} +catch(e){ + $ERROR("#2: arguments object doesn't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T2.js new file mode 100644 index 000000000..3c1bf9af5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T2.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A3_T2; + * @section: 10.1.8; + * @assertion: A property is created with name callee with property + * attributes { DontEnum } and no others; + * @description: Checking if enumerating the arguments.callee property fails; +*/ + +//CHECK#1 +function f1(){ + for(var x in arguments){ + if (x === "callee"){ + return false; + } + } + return true; +} + +try{ + if(!f1()){ + $ERROR("#1: A property callee don't have attribute { DontEnum }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + for(var x in arguments){ + if (x === "callee"){ + return false; + } + } + return true; +} + +try{ + if(!f2()){ + $ERROR("#2: A property callee don't have attribute { DontEnum }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T3.js new file mode 100644 index 000000000..4f0da4090 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T3.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A3_T3; + * @section: 10.1.8; + * @assertion: A property is created with name callee with property + * attributes { DontEnum } and no others; + * @description: Checking if deleting arguments.callee property fails; +*/ + +//CHECK#1 +function f1(){ + return (delete arguments.callee); +} + +try{ + if(!f1()){ + $ERROR("#1: A property callee have attribute { DontDelete }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + return (delete arguments.callee); +} + +try{ + if(!f2()){ + $ERROR("#2: A property callee have attribute { DontDelete }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T4.js new file mode 100644 index 000000000..b125a58e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T4.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A3_T4; + * @section: 10.1.8; + * @assertion: A property is created with name callee with property + * attributes { DontEnum } and no others; + * @description: Overriding arguments.callee property; +*/ + +var str = "something different"; +//CHECK#1 +function f1(){ + arguments.callee = str; + return arguments; +} + +try{ + if(f1().callee !== str){ + $ERROR("#1: A property callee have attribute { ReadOnly }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + arguments.callee = str; + return arguments; + } +try{ + if(f2().callee !== str){ + $ERROR("#2: A property callee have attribute { ReadOnly }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A4.js new file mode 100644 index 000000000..181d8d749 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A4.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: S10.1.8_A4; + * @section: 10.1.8; + * @assertion: The initial value of the created property callee is the + * Function object being executed; + * @description: Checking that arguments.callee === function object; +*/ + +//CHECK#1 +function f1(){ + return arguments.callee; +} + +try{ + if(f1 !== f1()){ + $ERROR('#1: arguments.callee === f1'); + } +} +catch(e){ + $ERROR("#1: arguments object doesn't exists"); +} + +//CHECK#2 +var f2 = function(){return arguments.callee;}; + +try{ + if(f2 !== f2()){ + $ERROR('#2: arguments.callee === f2'); + } +} +catch(e){ + $ERROR("#1: arguments object doesn't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T1.js new file mode 100644 index 000000000..6b678821f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_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: S10.1.8_A5_T1; + * @section: 10.1.8; + * @assertion: A property is created with name length with property + * attributes { DontEnum } and no others; + * @description: Checking existence of arguments.length property; +*/ + +//CHECK#1 +function f1(){ + return arguments.hasOwnProperty("length"); +} +try{ + if(f1() !== true){ + $ERROR("#1: arguments object doesn't contains property 'length'"); + } +} +catch(e){ + $ERROR("#1: arguments object doesn't exists"); +} + +//CHECK#2 +var f2 = function(){return arguments.hasOwnProperty("length");}; +try{ + if(f2() !== true){ + $ERROR("#2: arguments object doesn't contains property 'length'"); + } +} +catch(e){ + $ERROR("#2: arguments object doesn't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T2.js new file mode 100644 index 000000000..8a2556049 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T2.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A5_T2; + * @section: 10.1.8; + * @assertion: A property is created with name length with property + * attributes { DontEnum } and no others; + * @description: Checking if enumerating the arguments.length property fails; +*/ + + +//CHECK#1 +function f1(){ + for(var x in arguments){ + if (x === "length"){ + return false; + } + } + return true; +} + +try{ + if(!f1()){ + $ERROR("#1: A property length don't have attribute { DontEnum }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + for(var x in arguments){ + if (x === "length"){ + return false; + } + } + return true; +} + +try{ + if(!f2()){ + $ERROR("#2: A property length don't have attribute { DontEnum }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T3.js new file mode 100644 index 000000000..2dc5c7b7e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T3.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A5_T3; + * @section: 10.1.8; + * @assertion: A property is created with name length with property + * attributes { DontEnum } and no others; + * @description: Checking if deleting arguments.length property fails; +*/ + +//CHECK#1 +function f1(){ + return (delete arguments.length); +} + +try{ + if(!f1()){ + $ERROR("#1: A property length have attribute { DontDelete }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + return (delete arguments.length); +} + +try{ + if(!f2()){ + $ERROR("#2: A property length have attribute { DontDelete }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T4.js new file mode 100644 index 000000000..e3a66113a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A5_T4.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A5_T4; + * @section: 10.1.8; + * @assertion: A property is created with name length with property + * attributes { DontEnum } and no others; + * @description: Overriding arguments.length property; +*/ + +var str = "something different"; +//CHECK#1 +function f1(){ + arguments.length = str; + return arguments; +} + +try{ + if(f1().length !== str){ + $ERROR("#1: A property length have attribute { ReadOnly }"); + } +} +catch(e){ + $ERROR("#1: arguments object don't exists"); +} + +//CHECK#2 +var f2 = function(){ + arguments.length = str; + return arguments; + } +try{ + if(f2().length !== str){ + $ERROR("#2: A property length have attribute { ReadOnly }"); + } +} +catch(e){ + $ERROR("#2: arguments object don't exists"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A6.js new file mode 100644 index 000000000..e921368f1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A6.js @@ -0,0 +1,66 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.8_A6; + * @section: 10.1.8; + * @assertion: The initial value of the created property length is the number + * of actual parameter values supplied by the caller; + * @description: Create function, that returned arguments.length; +*/ + +function f1(){ + return arguments.length; +} + +//CHECK#1 +if(!(f1() === 0)){ + $ERROR('#1: argument.length === 0'); +} + +//CHECK#2 +if(!(f1(0) === 1)){ + $ERROR('#2: argument.length === 1'); +} + +//CHECK#3 +if(!(f1(0, 1) === 2)){ + $ERROR('#3: argument.length === 2'); +} + +//CHECK#4 +if(!(f1(0, 1, 2) === 3)){ + $ERROR('#4: argument.length === 3'); +} + +//CHECK#5 +if(!(f1(0, 1, 2, 3) === 4)){ + $ERROR('#5: argument.length === 4'); +} + +var f2 = function(){return arguments.length;}; + +//CHECK#6 +if(!(f2() === 0)){ + $ERROR('#6: argument.length === 0'); +} + +//CHECK#7 +if(!(f2(0) === 1)){ + $ERROR('#7: argument.length === 1'); +} + +//CHECK#8 +if(!(f2(0, 1) === 2)){ + $ERROR('#8: argument.length === 2'); +} + +//CHECK#9 +if(!(f2(0, 1, 2) === 3)){ + $ERROR('#9: argument.length === 3'); +} + +//CHECK#10 +if(!(f2(0, 1, 2, 3) === 4)){ + $ERROR('#10: argument.length === 4'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A7.js new file mode 100644 index 000000000..2c595596c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A7.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: S10.1.8_A7; + * @section: 10.1.8; + * @assertion: Get arguments of function; + * @description: Use property arguments; +*/ + +function f1() { + return arguments; +} + +//CHECK#1-5 +for(var i = 1; i < 5; i++){ +if (f1(1,2,3,4,5)[i] !== (i+1)) + $ERROR("#"+i+": Returning function's arguments work wrong, f1(1,2,3,4,5)["+i+"] !== "+(i+1)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T1.js new file mode 100644 index 000000000..1fc260895 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T1.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.1.1_A1_T1; + * @section: 10.1.1; + * @assertion: Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor; + * @description: Defining function by a FunctionDeclaration; +*/ + +//CHECK#1 +function f1(){ + return 1; +} +if(typeof(f1)!=="function") + $ERROR('#1: typeof(f1)!=="function"'); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T2.js new file mode 100644 index 000000000..8ca5142fe --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T2.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: S10.1.1_A1_T2; + * @section: 10.1.1; + * @assertion: Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor; + * @description: Creating function dynamically by using a FunctionExpression; +*/ + +//CHECK#1 +var x=function f1(){return 1;}(); +if(x!==1) + $ERROR('#1: Create function dynamically either by using a FunctionExpression'); + +//CHECK#2 +var y=function (){return 2;}(); +if(y!==2){ + $ERROR('#2: Create an anonymous function dynamically either by using a FunctionExpression'); +} + +//CHECK#2 +var z = (function(){return 3;})(); +if(z!==3){ + $ERROR('#3: Create an anonymous function dynamically either by using a FunctionExpression wrapped in a group operator'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_T3.js new file mode 100644 index 000000000..8570ed957 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A1_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: S10.1.1_A1_T3; + * @section: 10.1.1; + * @assertion: Program functions are defined in source text by a FunctionDeclaration or created dynamically either + * by using a FunctionExpression or by using the built-in Function object as a constructor; + * @description: Creating function dynamically by using the built-in Function object as a constructor; +*/ + +//CHECK#1 +var x=new function f1(){return 1;}; +if(typeof(x.constructor)!=="function") + $ERROR('#1: typeof(x.constructor)!=="function"'); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A2_T1.js new file mode 100644 index 000000000..894043f40 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.1_A2_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: S10.1.1_A2_T1; + * @section: 10.1.1; + * @assertion: There are two types of Function objects. Internal functions + * are built-in objects of the language, such as parseInt and Math.exp; + * @description: Checking types of parseInt and Math.exp; +*/ + +//CHECK#1 +if(typeof(Math.exp)!=="function") + $ERROR('#1: typeof(Math.exp(10))!=="function" '+typeof(Math.exp())); + +//CHECK#2 +if(typeof(parseInt)!=="function") + $ERROR('#2: typeof(parseInt())!=="function" '+typeof(parseInt())); + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T1.js new file mode 100644 index 000000000..f15b5715d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_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: S10.1.6_A1_T1; + * @section: 10.1.6; + * @assertion: The activation object is initialised with a property with name arguments and attributes {DontDelete}; + * @description: Checking ifdeleting function parameter is possible; +*/ + +//CHECK#1 +function f1(a){ + delete a; + return a; +} +if (f1(1) !== 1) + $ERROR('#1: Function parameter was deleted'); + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T2.js new file mode 100644 index 000000000..b59480047 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T2.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: S10.1.6_A1_T2; + * @section: 10.1.6; + * @assertion: The activation object is initialised with a property with name arguments and attributes {DontDelete}; + * @description: Checking funtion which returns property "arguments"; +*/ + +var ARG_STRING = "value of the argument property"; + +function f1() { + this.constructor.prototype.arguments = ARG_STRING; + return arguments; +} + +//CHECK#1 +if ((new f1(1,2,3,4,5)).length !== 5) + $ERROR('#1: (new f1(1,2,3,4,5)).length===5, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); + +//CHECK#2 +if ((new f1(1,2,3,4,5))[3] !== 4) + $ERROR('#2: (new f1(1,2,3,4,5))[3]===4, where f1 returns "arguments" that is set to "'+ ARG_STRING + '"'); + +//CHECK#3 +var x = new f1(1,2,3,4,5); +if (delete x[3] !== true) + $ERROR('#3.1: Function parameters have attribute {DontDelete}'); + +if (x[3] === 4) + $ERROR('#3.2: Function parameters have attribute {DontDelete}'); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T3.js new file mode 100644 index 000000000..e6b754c41 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.6_A1_T3.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: S10.1.6_A1_T3; + * @section: 10.1.6; + * @assertion: The activation object is initialised with a property with name arguments and attributes {DontDelete}; + * @description: Checking function which returns "this"; +*/ + +function f1() { + if (delete arguments) { + $ERROR("#1: Function parameters have attribute {DontDelete}" + arguments); + } + return arguments; +} + +f1(); diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.7_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.7_A1_T1.js new file mode 100644 index 000000000..60409325f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.1_Definitions/S10.1.7_A1_T1.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: S10.1.7_A1_T1; + * @section: 10.1.7; + * @assertion: The this value associated with an executioncontext is immutable; + * @description: Checking if deleting "this" fails; +*/ + +//CHECK#1 +if (delete this !== true) + $ERROR('#1: The this value associated with an executioncontext is immutable. Actual: this was deleted'); + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_T1.js new file mode 100644 index 000000000..52198e725 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_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: S10.2.1_A1_T1; + * @section: 10.2.1; + * @assertion: Variable instantiation is performed using the global object as + * the variable object and using property attributes { DontDelete }; + * @description: Checking if deleting variable x, that is defined as var x = 1, fails; +*/ + +var x = 1; + +if (this.x !== 1) { + $ERROR("#1: variable x is a property of global object"); +} + +if(delete this.x !== false){ + $ERROR("#2: variable x has property attribute DontDelete"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_T2.js new file mode 100644 index 000000000..5ec31f18f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.1_Global_Code/S10.2.1_A1_T2.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: S10.2.1_A1_T2; + * @section: 10.2.1; + * @assertion: Variable instantiation is performed using the global object as + * the variable object and using property attributes { DontDelete }; + * @description: Checking if deleting variable x, that is defined as x = 1, fails; +*/ + +x = 1; + +if (this.x !== 1) { + $ERROR("#1: variable x is a property of global object"); +} + +if(delete this.x !== true){ + $ERROR("#2: variable x has property attribute DontDelete"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T1.js new file mode 100644 index 000000000..d174b1b5d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T1.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T1; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +x = 1; +y = 2; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T10.js new file mode 100644 index 000000000..8243b05dd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T10.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: S10.2.2_A1.1_T10; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +var x = 1; +var y = 2; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T11.js new file mode 100644 index 000000000..302fbc3b3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T11.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T11; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +this.x = 1; +this.y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T2.js new file mode 100644 index 000000000..fdb02d921 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T2.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T2; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +var x = 1; +var y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T3.js new file mode 100644 index 000000000..c0be2c2b4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T3.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: S10.2.2_A1.1_T3; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +this.x = 1; +this.y = 2; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T4.js new file mode 100644 index 000000000..eee21fc51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T4.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T4; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +x = 1; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T5.js new file mode 100644 index 000000000..79082fc33 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T5.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T5; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +var x = 1; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +var y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T6.js new file mode 100644 index 000000000..26bd87d7c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T6.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T6; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +this.x = 1; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +this.y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T7.js new file mode 100644 index 000000000..5bb3be36a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T7.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T7; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +x = 1; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +var y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T8.js new file mode 100644 index 000000000..52154c363 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T8.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T8; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; +this.x = 1; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +var y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T9.js new file mode 100644 index 000000000..87ceef7e1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T9.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.1_T9; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +var i; +var j; +str1 = ''; +str2 = ''; + +for(i in this){ + str1+=i; +} + +eval('for(j in this){\nstr2+=j;\n}'); + +if(!(str1 === str2)){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + +x = 1; +y = 2; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T1.js new file mode 100644 index 000000000..33b9e6a77 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.2_T1; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + x = 1; + y = 2; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + return (str1 === str2); +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T10.js new file mode 100644 index 000000000..a0791a786 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T10.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.2_T10; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + var x = 1; + var y = 2; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T11.js new file mode 100644 index 000000000..20254f94a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T11.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: S10.2.2_A1.2_T11; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + this.x = 1; + this.y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T2.js new file mode 100644 index 000000000..06b36402d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T2.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.2_T2; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + var x = 1; + var y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T3.js new file mode 100644 index 000000000..34e1d1291 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T3.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2.2_A1.2_T3; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + this.x = 1; + this.y = 2; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T4.js new file mode 100644 index 000000000..c41fea7f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T4.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: S10.2.2_A1.2_T4; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + x = 1; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T5.js new file mode 100644 index 000000000..153374b82 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T5.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: S10.2.2_A1.2_T5; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + var x = 1; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + var y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T6.js new file mode 100644 index 000000000..c8f34aa97 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T6.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: S10.2.2_A1.2_T6; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + this.x = 1; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + this.y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T7.js new file mode 100644 index 000000000..13c9544f4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T7.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: S10.2.2_A1.2_T7; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + x = 1; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + var y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T8.js new file mode 100644 index 000000000..073d1689c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T8.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: S10.2.2_A1.2_T8; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + this.x = 1; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + var y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T9.js new file mode 100644 index 000000000..568685266 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T9.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: S10.2.2_A1.2_T9; + * @section: 10.2.2; + * @assertion: The scope chain is initialised to contain the same objects, + * in the same order, as the calling context's scope chain; + * @description: eval within global execution context; +*/ + +function f(){ + var i; + var j; + str1 = ''; + str2 = ''; + + for(i in this){ + str1+=i; + } + + eval('for(j in this){\nstr2+=j;\n}'); + + return (str1 === str2); + + x = 1; + y = 2; +} + +if(!f()){ + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T1.js new file mode 100644 index 000000000..cf100d15c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S10.2_A1.1_T1; + * @section: 10.2; + * @assertion: Every function call enters a new execution context; + * @description: Sequence of function calls; +*/ + +var y; + +function f(){ + var x; + + if(x === undefined) { + x = 0; + } else { + x = 1; + } + + return x; +} + +y = f(); +y = f(); + +if(!(y === 0)){ + $ERROR("#1: Sequenced function calls shares execution context"); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T2.js new file mode 100644 index 000000000..46e0380e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/S10.2_A1.1_T2.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: S10.2_A1.1_T2; + * @section: 10.2; + * @assertion: Every function call enters a new execution context; + * @description: Recursive function call; +*/ + +var y; + +function f(a){ + var x; + + if (a === 1) + return x; + else { + if(x === undefined) { + x = 0; + } else { + x = 1; + } + return f(1); + } +} + +y = f(0); + +if(!(y === undefined)){ + $ERROR("#1: Recursive function calls shares execution context"); +} |