1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/testNestedEscapingLambdas.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +function testNestedEscapingLambdas() 1.5 +{ 1.6 + try { 1.7 + return (function() { 1.8 + var a = [], r = []; 1.9 + function setTimeout(f, t) { 1.10 + a.push(f); 1.11 + } 1.12 + 1.13 + function runTimeouts() { 1.14 + for (var i = 0; i < a.length; i++) 1.15 + a[i](); 1.16 + } 1.17 + 1.18 + var $foo = "#nothiddendiv"; 1.19 + setTimeout(function(){ 1.20 + r.push($foo); 1.21 + setTimeout(function(){ 1.22 + r.push($foo); 1.23 + }, 100); 1.24 + }, 100); 1.25 + 1.26 + runTimeouts(); 1.27 + 1.28 + return r.join(""); 1.29 + })(); 1.30 + } catch (e) { 1.31 + return e; 1.32 + } 1.33 +} 1.34 +assertEq(testNestedEscapingLambdas(), "#nothiddendiv#nothiddendiv");