Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/promise/tests/mochitest.toml
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
var res, rej;
var p = new Promise(function(resolve, reject) { res = resolve; rej = reject; });
is(res(1), undefined, "Resolve function should return undefined");
is(rej(2), undefined, "Reject function should return undefined");
var thenable = {
then(resolve, reject) {
is(resolve(3), undefined, "Thenable resolve argument should return undefined");
is(reject(4), undefined, "Thenable reject argument should return undefined");
SimpleTest.finish();
},
};
SimpleTest.waitForExplicitFinish();
p = Promise.resolve(thenable);
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1120235">Mozilla Bug 1120235</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>