diff options
author | 2021-12-15 16:58:41 -0800 | |
---|---|---|
committer | 2021-12-15 16:58:41 -0800 | |
commit | feb45edf6d9e33d55e89f5dbca9758bce010b14a (patch) | |
tree | 6d7969cbe034f25d3d10e3feaaaa63cdf301b720 /integration/snippets/template-literal.js | |
parent | 0a916543b3683a2d57cff22afdb6e11665424e79 (diff) | |
download | bun-feb45edf6d9e33d55e89f5dbca9758bce010b14a.tar.gz bun-feb45edf6d9e33d55e89f5dbca9758bce010b14a.tar.zst bun-feb45edf6d9e33d55e89f5dbca9758bce010b14a.zip |
[JS Parser] Add regression test
Diffstat (limited to 'integration/snippets/template-literal.js')
-rw-r--r-- | integration/snippets/template-literal.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/integration/snippets/template-literal.js b/integration/snippets/template-literal.js index b65f1a6b1..ff4e08a4d 100644 --- a/integration/snippets/template-literal.js +++ b/integration/snippets/template-literal.js @@ -24,6 +24,15 @@ const fooUTF16 = css` after `; + +const templateLiteralWhichDefinesAFunction = ((...args) => + args[args.length - 1]().toString())` + before + 🙃 ${() => true} + after + +`; + export function test() { for (let foo of [fooNoBracesUT16, fooNoBracesUTF8, fooUTF16, fooUTF8]) { console.assert( @@ -33,5 +42,10 @@ export function test() { console.assert(foo.includes("after"), `Expected ${foo} to include "after"`); } + console.assert( + templateLiteralWhichDefinesAFunction.includes("true"), + "Expected fooFunction to include 'true'" + ); + return testDone(import.meta.url); } |