diff options
author | 2023-01-12 10:14:35 -0800 | |
---|---|---|
committer | 2023-01-12 10:14:35 -0800 | |
commit | edf9757650f8b498841d1a95269289b74d0b4023 (patch) | |
tree | 114922ab91cc2e25908daec51d5686ba31457510 /test/bun.js | |
parent | e65def0f82482a08521ec608efa6d8c14a700270 (diff) | |
download | bun-edf9757650f8b498841d1a95269289b74d0b4023.tar.gz bun-edf9757650f8b498841d1a95269289b74d0b4023.tar.zst bun-edf9757650f8b498841d1a95269289b74d0b4023.zip |
Fixes #1772
Diffstat (limited to '')
-rw-r--r-- | test/bun.js/transpiler.test.js | 24 |
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( ` |