Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
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 type="application/javascript" 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">
15 </div>
16 <pre id="test">
17 <script type="application/javascript"><!--
19 function runTest() {
20 [{}, {}, {}, {}, {}].reduce(Promise.reject);
21 ok(true, "No leaks with reject?");
23 [{}, {}, {}, {}, {}].reduce(Promise.resolve);
24 ok(true, "No leaks with resolve?");
26 [{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { throw a; }); });
27 ok(true, "No leaks with exception?");
29 [{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { }); });
30 ok(true, "No leaks with empty promise?");
32 SimpleTest.finish();
33 }
35 SimpleTest.waitForExplicitFinish();
36 runTest();
37 // -->
38 </script>
39 </pre>
40 </body>
41 </html>