aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/transpiler.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/transpiler.test.js')
-rw-r--r--test/bun.js/transpiler.test.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/bun.js/transpiler.test.js b/test/bun.js/transpiler.test.js
index bc7102b95..94c3d52d2 100644
--- a/test/bun.js/transpiler.test.js
+++ b/test/bun.js/transpiler.test.js
@@ -915,6 +915,19 @@ export var ComponentThatHasSpreadCausesDeopt = $jsx(Hello, {
it("fold string addition", () => {
expectPrinted_(
+ `
+const a = "[^aeiou]";
+const b = a + "[^aeiouy]*";
+console.log(a);
+ `,
+ `
+const a = "[^aeiou]";
+const b = a + "[^aeiouy]*";
+console.log(a)
+ `.trim(),
+ );
+
+ expectPrinted_(
`export const foo = "a" + "b";`,
`export const foo = "ab"`,
);
@@ -1734,6 +1747,17 @@ class Foo {
`return "foobar";`,
);
+ check(
+ `
+const a = "[^aeiou]";
+const b = a + "[^aeiouy]*";
+console.log(a, b);
+ `,
+ `
+console.log("[^aeiou]", "[^aeiou][^aeiouy]*");
+ `.trim(),
+ );
+
// check that it doesn't inline after "var"
check(
`