diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context')
26 files changed, 760 insertions, 0 deletions
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"); +} |