aboutsummaryrefslogtreecommitdiff
path: root/test/snippets/optional-chain-with-function.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/snippets/optional-chain-with-function.js')
-rw-r--r--test/snippets/optional-chain-with-function.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/snippets/optional-chain-with-function.js b/test/snippets/optional-chain-with-function.js
new file mode 100644
index 000000000..82ad51d46
--- /dev/null
+++ b/test/snippets/optional-chain-with-function.js
@@ -0,0 +1,15 @@
+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);
+}