From edf9757650f8b498841d1a95269289b74d0b4023 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:14:35 -0800 Subject: Fixes #1772 --- test/bun.js/transpiler.test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/bun.js/transpiler.test.js') 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 @@ -914,6 +914,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( ` -- cgit v1.2.3