mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
30 lines
714 B
TypeScript
30 lines
714 B
TypeScript
import { expect, test } from "bun:test";
|
||
|
||
// Previously, this would crash due to the invalid property name
|
||
test("#12039 ZWJ", async () => {
|
||
const code = /*js*/ `
|
||
export default class {
|
||
W;
|
||
}
|
||
`;
|
||
expect(() => new Bun.Transpiler().transformSync(code)).not.toThrow();
|
||
});
|
||
|
||
test("#12039 ZWNJ", async () => {
|
||
const code = /*js*/ `
|
||
export default class {
|
||
W${String.fromCodePoint(0x200d)};
|
||
}
|
||
`;
|
||
expect(() => new Bun.Transpiler().transformSync(code)).not.toThrow();
|
||
});
|
||
|
||
test("#12039 invalid property name for identifier", async () => {
|
||
const code = /*js*/ `
|
||
export default class {
|
||
W${String.fromCodePoint(129)};
|
||
}
|
||
`;
|
||
expect(() => new Bun.Transpiler().transformSync(code)).toThrow(`Unexpected "W`);
|
||
});
|