Changelog: swc v1.2.51


Column position in source maps (#1470)#

Thanks to @devongovett, swc now emits correct source map regarding column offsets.

keepClassName (#1453)#

The option keepClasName was introduced in swc v1.2.50. But there was a bug at configuration merging, and it didn't work. It's now fixed.

Codegen of arrow functions (#1452)#

Arrow functions without parenthesis in arguments like async foo => 0; is now handled properly.

bundler: Stack overflow on windows (#1464)#

This was reported via deno, by #9752. Previously bunlding already-bundled file might cause stack overflow on windows, but it's now fixed.

Assignments in await argument (#1475)#

Previsouly, swc break the code like await (bar = Promise.resolve(2)); by removing parens. This is now fixed and it works properly.

Parens in nullish coalescing (#1496)#

Previously swc miscompiled

console.log(("a" ?? "b") || "");


console.log("a" ?? ("b" || ""));

which is wrong. swc now emits

console.log(("a" ?? "b") || "");

Jsx entities in jsx attribute values (#1501)#

swc now compiles

<div id="abc&gt;" />


React.createElement("div", {
id: "abc>",

regardless of target version.