blob: ef16e43f41db5003d4597f229099bc54879439c3 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var resolved = null;
var rejected = null;
(async function () {
resolved = await Promise.resolve(42);
try {
await Promise.reject(40);
} catch (error) {
rejected = error;
}
})();
drainMicrotasks();
shouldBe(resolved, 42);
shouldBe(rejected, 40);