- Rollup Version: rollup v2.50.5
- Operating System (or Browser): n/a
- Node Version (if applicable): node v16.1.0
Async arrows were not covered in #4115.
Repro
$ cat async-then.js
// async function
(async function () {
return {
get then() {
return () => effect(11);
}
};
})();
// async arrow with block
(async () => {
return {
get then() {
return () => effect(12);
}
};
})();
// async arrow without block
(async () => ({
get then() {
return () => effect(13);
}
}))();
const effects = [], effect = x => effects.push(x);
Promise.resolve({
then(resolve) {
resolve({
then(resolve) {
console.log(effects.join(" "));
}
});
}
});
Expected Behavior
$ cat async-then.js | node
11 12 13
Actual Behavior
$ cat async-then.js | rollup --silent | node
11
$ cat async-then.js | rollup --silent
// async function
(async function () {
return {
get then() {
return () => effect(11);
}
};
})();
const effects = [], effect = x => effects.push(x);
Promise.resolve({
then(resolve) {
resolve({
then(resolve) {
console.log(effects.join(" "));
}
});
}
});
Async arrows were not covered in #4115.
Repro
Expected Behavior
Actual Behavior