-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Describe the bug
In the compiled output, instead of calling the function, the function body is returned.
In the screenshot:
Upper left: source code
Bottom left: swc cli compiler output
Upper right: running source directly in browser, output is correct
Bottom right: running compiled code directly in browser, output is wrong
Input code
const myVar = {
target: {
value: "ABC"
}
}
console.log(myVar.target.value.toLowerCase?.());Config
No config. Running CLI from command line without any flags.
npx swc example.tsExpected behavior
The console log should output abc
Version
The version of @swc/core: "1.2.76"
Additional context
Thank you for maintaining this project. The speed is insane.