test_bug883683.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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">
  14. </div>
  15. <pre id="test">
  16. <script type="application/javascript"><!--
  17. function runTest() {
  18. [{}, {}, {}, {}, {}].reduce(Promise.reject.bind(Promise));
  19. ok(true, "No leaks with reject?");
  20. [{}, {}, {}, {}, {}].reduce(Promise.resolve.bind(Promise));
  21. ok(true, "No leaks with resolve?");
  22. [{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { throw a; }); });
  23. ok(true, "No leaks with exception?");
  24. [{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { }); });
  25. ok(true, "No leaks with empty promise?");
  26. SimpleTest.finish();
  27. }
  28. SimpleTest.waitForExplicitFinish();
  29. runTest();
  30. // -->
  31. </script>
  32. </pre>
  33. </body>
  34. </html>