1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.2_T4.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * The scope chain is initialised to contain the same objects, 1.9 + * in the same order, as the calling context's scope chain 1.10 + * 1.11 + * @path ch10/10.4/10.4.2/S10.4.2_A1.2_T4.js 1.12 + * @description eval within global execution context 1.13 + */ 1.14 + 1.15 +function f(){ 1.16 + var i; 1.17 + var j; 1.18 + str1 = ''; 1.19 + str2 = ''; 1.20 + x = 1; 1.21 + 1.22 + for(i in this){ 1.23 + str1+=i; 1.24 + } 1.25 + 1.26 + eval('for(j in this){\nstr2+=j;\n}'); 1.27 + 1.28 + return (str1 === str2); 1.29 + 1.30 + y = 2; 1.31 +} 1.32 + 1.33 +if(!f()){ 1.34 + $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); 1.35 +} 1.36 +