From 241525947c033de9a8a46abfb8f064cc95a5c0b0 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 8 Nov 2021 15:37:31 -0800 Subject: [JS Printer] Fix bug with optional chain --- integration/snapshots/optional-chain-with-function.debug.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 integration/snapshots/optional-chain-with-function.debug.js (limited to 'integration/snapshots/optional-chain-with-function.debug.js') diff --git a/integration/snapshots/optional-chain-with-function.debug.js b/integration/snapshots/optional-chain-with-function.debug.js new file mode 100644 index 000000000..bf007b0a8 --- /dev/null +++ b/integration/snapshots/optional-chain-with-function.debug.js @@ -0,0 +1,13 @@ +export function test() { + try { + const multipleSecondaryValues = undefined; + const ratings = ["123"]; + var bar = multipleSecondaryValues?.map((value) => false); + bar = (bar?.multipleSecondaryValues)?.map((value) => false); + bar = (bar?.bar?.multipleSecondaryValues)?.map((value) => false); + bar = ({}?.bar?.multipleSecondaryValues)?.map((value) => false); + } catch (e) { + throw e; + } + return testDone(import.meta.url); +} -- cgit v1.2.3