summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js')
-rw-r--r--js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js b/js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js
new file mode 100644
index 000000000..72611dc49
--- /dev/null
+++ b/js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_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.
+
+/**
+ * The scope chain is initialised to contain the same objects,
+ * in the same order, as the calling context's scope chain
+ *
+ * @path ch10/10.4/10.4.2/S10.4.2_A1.2_T2.js
+ * @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");
+}
+