michael@0: function testNestedEscapingLambdas() michael@0: { michael@0: try { michael@0: return (function() { michael@0: var a = [], r = []; michael@0: function setTimeout(f, t) { michael@0: a.push(f); michael@0: } michael@0: michael@0: function runTimeouts() { michael@0: for (var i = 0; i < a.length; i++) michael@0: a[i](); michael@0: } michael@0: michael@0: var $foo = "#nothiddendiv"; michael@0: setTimeout(function(){ michael@0: r.push($foo); michael@0: setTimeout(function(){ michael@0: r.push($foo); michael@0: }, 100); michael@0: }, 100); michael@0: michael@0: runTimeouts(); michael@0: michael@0: return r.join(""); michael@0: })(); michael@0: } catch (e) { michael@0: return e; michael@0: } michael@0: } michael@0: assertEq(testNestedEscapingLambdas(), "#nothiddendiv#nothiddendiv");