-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
microsoft/tslib
#70Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
TypeScript Version: 3.3, 3.5.0-dev.20190523
Search Terms: async await Promise order scheduling microtask
Code
async function a(msg) {
await Promise.resolve();
console.log(msg);
}
function b(msg) {
Promise.resolve().then(() => {
console.log(msg);
});
}
a('1');
b('2');
Expected behavior: Log 1 then 2. Chrome and Node.js get this right. Babel's transpiled JS also gets it right.
Actual behavior: Logs 2 then 1.
Related Issues: Didn't find any.
trotyl and thorn0
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.