summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.2_Eval_Code/S10.2.2_A1.2_T8.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.2_Eval_Code/S10.2.2_A1.2_T8.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.2_Eval_Code/S10.2.2_A1.2_T8.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.2_Eval_Code/S10.2.2_A1.2_T8.js b/external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.2_Eval_Code/S10.2.2_A1.2_T8.js
new file mode 100644
index 000000000..f367657d4
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.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");
+}
+