js/src/tests/test262/ch10/10.4/10.4.2/S10.4.2_A1.1_T4.js

changeset 0
6474c204b198
     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.1_T4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,29 @@
     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.1_T4.js
    1.12 + * @description eval within global execution context
    1.13 + */
    1.14 +
    1.15 +var i;
    1.16 +var j;
    1.17 +str1 = '';
    1.18 +str2 = '';
    1.19 +x = 1;
    1.20 +
    1.21 +for(i in this){
    1.22 +  str1+=i;
    1.23 +}
    1.24 +
    1.25 +eval('for(j in this){\nstr2+=j;\n}');
    1.26 +
    1.27 +if(!(str1 === str2)){
    1.28 +  $ERROR("#1: scope chain must contain same objects in the same order as the calling context");
    1.29 +}
    1.30 +
    1.31 +y = 2;
    1.32 +

mercurial