2013-06-26 17:44:21 +04:00
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-07-12 00:40:36 +04:00
|
|
|
<title>Promise - bug 883683</title>
|
2019-04-16 06:53:28 +03:00
|
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
2013-06-26 17:44:21 +04:00
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript"><!--
|
|
|
|
|
|
|
|
function runTest() {
|
2015-11-25 23:48:09 +03:00
|
|
|
[{}, {}, {}, {}, {}].reduce(Promise.reject.bind(Promise));
|
2013-06-26 17:44:21 +04:00
|
|
|
ok(true, "No leaks with reject?");
|
|
|
|
|
2015-11-25 23:48:09 +03:00
|
|
|
[{}, {}, {}, {}, {}].reduce(Promise.resolve.bind(Promise));
|
2013-06-26 17:44:21 +04:00
|
|
|
ok(true, "No leaks with resolve?");
|
|
|
|
|
2013-09-11 20:03:04 +04:00
|
|
|
[{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { throw a; }); });
|
2013-06-26 17:44:21 +04:00
|
|
|
ok(true, "No leaks with exception?");
|
|
|
|
|
2013-09-11 20:03:04 +04:00
|
|
|
[{}, {}, {}, {}, {}].reduce(function(a, b, c, d) { return new Promise(function(r1, r2) { }); });
|
2013-07-12 00:40:36 +04:00
|
|
|
ok(true, "No leaks with empty promise?");
|
2013-06-26 17:44:21 +04:00
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2014-01-31 01:14:00 +04:00
|
|
|
runTest();
|
2013-06-26 17:44:21 +04:00
|
|
|
// -->
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|