From c9088fa6ec47325990430ad0cd4a3ca6eda8df39 Mon Sep 17 00:00:00 2001 From: Malik Ammar Faisal Date: Thu, 15 Jun 2023 15:15:37 +0530 Subject: [PATCH] LibJS: Add tests for `new Obj` with optional chain --- .../LibJS/Tests/syntax/new-with-optional-chaining.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Userland/Libraries/LibJS/Tests/syntax/new-with-optional-chaining.js diff --git a/Userland/Libraries/LibJS/Tests/syntax/new-with-optional-chaining.js b/Userland/Libraries/LibJS/Tests/syntax/new-with-optional-chaining.js new file mode 100644 index 0000000000..3c48c5829f --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/syntax/new-with-optional-chaining.js @@ -0,0 +1,5 @@ +describe("parsing new expressions with optional chaining", () => { + expect("new Object()?.foo").toEval(); + expect("new Object?.foo").not.toEval(); + expect("(new Object)?.foo").toEval(); +});