From 4312dfa6a66da2161f89e03a8fd257c3ec7131a7 Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Mon, 10 Aug 2020 12:23:59 +0300 Subject: [PATCH] Add coalesce expression test --- .../coalesce/emulates-undefined.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/annexB/language/expressions/coalesce/emulates-undefined.js diff --git a/test/annexB/language/expressions/coalesce/emulates-undefined.js b/test/annexB/language/expressions/coalesce/emulates-undefined.js new file mode 100644 index 0000000000..8101948dad --- /dev/null +++ b/test/annexB/language/expressions/coalesce/emulates-undefined.js @@ -0,0 +1,20 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-binary-bitwise-operators-runtime-semantics-evaluation +description: > + ?? doesn't special-case [[IsHTMLDDA]] object; rval is not evaluated. +info: | + CoalesceExpression : CoalesceExpressionHead ?? BitwiseORExpression + + 1. Let lref be the result of evaluating CoalesceExpressionHead. + 2. Let lval be ? GetValue(lref). + 3. If lval is undefined or null, then + [...] + 4. Otherwise, return lval. +features: [IsHTMLDDA, coalesce-expression] +---*/ + +var IsHTMLDDA = $262.IsHTMLDDA; + +assert.sameValue(IsHTMLDDA ?? unresolved, IsHTMLDDA);