Description
Describe the bug
Input code
async function* g() {}
var errormessage = "Promise rejected."
var result = g().throw(new Test262Error(errormessage))
assert(result instanceof Promise, "Expected result to be an instanceof Promise")
result.then(
function () {
throw new Test262Error("Expected result to be rejected promise.");
},
function (e) {
if (!(e.message = errormessage)) {
throw new Test262Error("Expected thrown custom error, got " + e);
}
}
).then($DONE, $DONE)
Config
{
"jsc": {
"parser": {
"syntax": "ecmascript"
},
"target": "es5",
"loose": false,
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true,
}
Link to the code that reproduces this issue
SWC Info output
No response
Expected behavior
Test262:AsyncTestComplete
Actual behavior
Test262:AsyncTestFailure:Test262Error: Test262Error: Expected result to be rejected promise.
Version
Additional context
No response