1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_6/extensions/nested-for-each.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +var summary = 'for-each-in should not affect for-in'; 1.11 +var BUGNUMBER = 292020; 1.12 +var actual = ''; 1.13 +var expect = ''; 1.14 + 1.15 +printBugNumber(BUGNUMBER); 1.16 + 1.17 +// test here 1.18 +function foreachbug() 1.19 +{ 1.20 + var arryOuter = ["outervalue0", "outervalue1"]; 1.21 + var arryInner = ["innervalue1","innervalue2"]; 1.22 + 1.23 + for (var j in arryOuter) 1.24 + { 1.25 + var result = (j in arryOuter); 1.26 + if (!result) 1.27 + { 1.28 + return ("enumerated property not in object: (" + 1.29 + j + " in arryOuter) " + result); 1.30 + return result; 1.31 + } 1.32 + 1.33 + 1.34 + for each (k in arryInner) 1.35 + { 1.36 + // this for-each-in should not affect the outer for-in 1.37 + } 1.38 + } 1.39 + return ''; 1.40 +} 1.41 + 1.42 +reportCompare('', foreachbug());