test_bug883683.html (1040B)
1 <!-- 2 Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ 4 --> 5 <html> 6 <head> 7 <title>Promise - bug 883683</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body> 12 <p id="display"></p> 13 <div id="content" style="display: none"> 14 15 </div> 16 <pre id="test"> 17 <script type="application/javascript"><!-- 18 19 function runTest() { 20 [{}, {}, {}, {}, {}].reduce(Promise.reject.bind(Promise)); 21 ok(true, "No leaks with reject?"); 22 23 [{}, {}, {}, {}, {}].reduce(Promise.resolve.bind(Promise)); 24 ok(true, "No leaks with resolve?"); 25 26 [{}, {}, {}, {}, {}].reduce(function(a) { return new Promise(function() { throw a; }); }); 27 ok(true, "No leaks with exception?"); 28 29 [{}, {}, {}, {}, {}].reduce(function() { return new Promise(function() { }); }); 30 ok(true, "No leaks with empty promise?"); 31 32 SimpleTest.finish(); 33 } 34 35 SimpleTest.waitForExplicitFinish(); 36 runTest(); 37 // --> 38 </script> 39 </pre> 40 </body> 41 </html>