swc/node-swc/__tests__/transform/swc_node_335.js
강동윤 cb2b0c671f
fix(es/transforms/base): Optimize hygiene (#2193)
swc_ecma_transforms_base:
 - `hygiene`: Don't rename if not required. (#1600)

swc_ecma_minifier:
 - Remove `hygiene_optimizer`.
2021-09-01 13:11:55 +00:00

22 lines
337 B
JavaScript

const swc = require('../../..');
it("should handle es2019", () => {
expect(
swc.transformSync(`
class Foo {
method() {
class Foo {
}
}
}
`, {
jsc: {
keepClassNames: true,
target: 'es2017',
}
})
.code.trim()
).toContain(`let Foo = class Foo {`);
});