Changelog: swc v1.2.15


emitDecoratorMetadata for parameters (#948)#

Previously, swc emit wrong metadata information for decorators on parameter if decorator metadata is enabled. As a result, the code below was broken.

class MyController {
@Res() res: express.Response,
@Session() session: express.Express.Session
) {
const token = await this.getToken(code);
const user = await this.getUserInfo(token.access_token);
session.oauth2Token = token;
session.user = user;
return res.redirect(state.returnUrl ?? "/");

Thanks to @Brooooooklyn, this is fixed.

typescript properties (#930)#

Now typescript class properties work in the same way as tsc. Previously class_properties pass follows ecmascript spec, and it had broken some codes.

delete a?.b (#947)#

Previously, swc emitted an wrong error message for the code below while compiling properly.

const obj = { myProp: 6 };
delete obj?.myProp;

in operator in class properties (#944)#

Affected code looks like the code below

class CTest {
myFunc = () => "key" in {};