The following code
function foob(a) {
return (a || 'one') + 'two';
}
gets translated to
function foob(a) {
return a || "onetwo";
}
I've tested it with esbuild
built from the sources from the master branch.
Oh crap, that's not good. There's a check missing in my constant folding logic. Thanks for the report! Will fix.
Most helpful comment
Oh crap, that's not good. There's a check missing in my constant folding logic. Thanks for the report! Will fix.