aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/transpiler.test.js
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-01-12 19:10:41 -0800
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-01-12 19:10:41 -0800
commit766f8ceebc76dd749ba5c104f802c7ebda289db9 (patch)
treef84ee560938188261f7f5604a65b83aae354a646 /test/bun.js/transpiler.test.js
parentc03f7c998dd22689412658177e3a5736ce6b9034 (diff)
parent32f8cb31be6fb5b0b9aea1c6d4e95d118e8ef816 (diff)
downloadbun-766f8ceebc76dd749ba5c104f802c7ebda289db9.tar.gz
bun-766f8ceebc76dd749ba5c104f802c7ebda289db9.tar.zst
bun-766f8ceebc76dd749ba5c104f802c7ebda289db9.zip
Merge branch 'main' into dylan/github-dependencies
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(
`