From feb45edf6d9e33d55e89f5dbca9758bce010b14a Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 15 Dec 2021 16:58:41 -0800 Subject: [JS Parser] Add regression test --- integration/snippets/template-literal.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'integration/snippets/template-literal.js') 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); } -- cgit v1.2.3