From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../optional-chaining/optional-expression.js | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 js/src/tests/test262/language/expressions/optional-chaining/optional-expression.js (limited to 'js/src/tests/test262/language/expressions/optional-chaining/optional-expression.js') diff --git a/js/src/tests/test262/language/expressions/optional-chaining/optional-expression.js b/js/src/tests/test262/language/expressions/optional-chaining/optional-expression.js new file mode 100644 index 0000000000..38cba72d21 --- /dev/null +++ b/js/src/tests/test262/language/expressions/optional-chaining/optional-expression.js @@ -0,0 +1,29 @@ +// Copyright 2019 Google, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: prod-OptionalExpression +description: > + optional chain on recursive optional expression +info: | + Left-Hand-Side Expressions + OptionalExpression: + OptionalExpression OptionalChain +features: [optional-chaining] +---*/ + +const obj = { + a: { + b: 22 + } +}; + +function fn () { + return {}; +} + +// OptionalExpression (MemberExpression OptionalChain) OptionalChain +assert.sameValue(22, obj?.a?.b); +// OptionalExpression (CallExpression OptionalChain) OptionalChain +assert.sameValue(undefined, fn()?.a?.b); + +reportCompare(0, 0); -- cgit v1.2.3