Closed
Description
Describe the bug
Compress Option does wrong transform undefined
which is overrided and return void 0
anyway.
I just reported it because i have seen that - Probably not important
Edit: uncomment console.log to check that everything back to normal
Input code
const templatePath = () => {
const undefined = "lol1"
return undefined
};
const templatePath2 = (() => {
const undefined = "lol"
return undefined
})();
console.log(templatePath())
console.log(templatePath2)
// console.log(undefined)
Config
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es5",
"loose": true,
"minify": {
"compress": {
"arguments": false,
"arrows": true,
"booleans": true,
"booleans_as_integers": false,
"collapse_vars": true,
"comparisons": true,
"computed_props": true,
"conditionals": true,
"dead_code": true,
"directives": true,
"drop_console": false,
"drop_debugger": true,
"evaluate": true,
"expression": false,
"hoist_funs": false,
"hoist_props": true,
"hoist_vars": false,
"if_return": true,
"join_vars": true,
"keep_classnames": false,
"keep_fargs": true,
"keep_fnames": false,
"keep_infinity": false,
"loops": true,
"negate_iife": true,
"properties": true,
"reduce_funcs": false,
"reduce_vars": false,
"side_effects": true,
"switches": true,
"typeofs": true,
"unsafe": false,
"unsafe_arrows": false,
"unsafe_comps": false,
"unsafe_Function": false,
"unsafe_math": false,
"unsafe_symbols": false,
"unsafe_methods": false,
"unsafe_proto": false,
"unsafe_regexp": false,
"unsafe_undefined": false,
"unused": true,
"const_to_let": true,
"pristine_globals": true
},
"mangle": {
"toplevel": false,
"keep_classnames": false,
"keep_fnames": false,
"keep_private_props": false,
"ie8": false,
"safari10": false
}
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}
Playground link (or link to the minimal reproduction)
SWC Info output
I did it Only on website in Playground .
Expected behavior
Should Return console.log("lol1"), console.log("lol2");
Actual behavior
Current return: console.log(void 0), console.log(void 0);
Version
1.3.107
Additional context
Not needed - Just found in random testing.