-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
async <T,>() => {}
(1);Configuration file name
No response
Configuration
see repl
Current and expected behavior
Current behavior: transformed to IIFE and changes semantics
(async () => {})(1);Expected behavior: it shouldn't change semantics. for example, tsc's output https://www.typescriptlang.org/play/?module=1#code/IYZwngdgxgBAPAFQDQD4AUBKGBeFMDeAvgFBoCMGA3EA
"use strict";
async () => { };
(1);Environment
(repl)
babel: 7.28.2
Possible solution
No response
Additional context
Originally reported in vitejs/vite-plugin-react#690, which had slightly more complex code:
const funA = async <T,>(arg1: T) => {
console.log(arg1)
}
(a as A).register(funA);Metadata
Metadata
Assignees
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser