Debian Codegraph @

js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-coalesce.js

raw
1 // Copyright (C) 2020 Alexey Shvayka. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-assignment-operators-runtime-semantics-evaluation
5 description: >
6 ??= doesn't special-case [[IsHTMLDDA]] object; rval is not evaluated.
7 info: |
8 AssignmentExpression : LeftHandSideExpression ??= AssignmentExpression
9
10 1. Let lref be the result of evaluating LeftHandSideExpression.
11 2. Let lval be ? GetValue(lref).
12 3. If lval is neither undefined nor null, return lval.
13 features: [IsHTMLDDA, logical-assignment-operators]
14 ---*/
15
16 var IsHTMLDDA = $262.IsHTMLDDA;
17 var value = IsHTMLDDA;
18 assert.sameValue(value ??= unresolved, IsHTMLDDA);
19 assert.sameValue(value, IsHTMLDDA);
20
21 reportCompare(0, 0);