Debian Codegraph @

js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-and.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 ToBoolean returns `false` for [[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. Let lbool be ! ToBoolean(lval).
13 4. If lbool is false, return lval.
14
15 The [[IsHTMLDDA]] Internal Slot / Changes to ToBoolean
16
17 1. If argument has an [[IsHTMLDDA]] internal slot, return false.
18 2. Return true.
19 features: [IsHTMLDDA, logical-assignment-operators]
20 ---*/
21
22 var IsHTMLDDA = $262.IsHTMLDDA;
23 var value = IsHTMLDDA;
24 assert.sameValue(value &&= unresolved, IsHTMLDDA);
25 assert.sameValue(value, IsHTMLDDA);
26
27 reportCompare(0, 0);