Debian Codegraph @

js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-or.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 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 [...]
14 7. Perform ? PutValue(lref, rval).
15 8. Return rval.
16
17 The [[IsHTMLDDA]] Internal Slot / Changes to ToBoolean
18
19 1. If argument has an [[IsHTMLDDA]] internal slot, return false.
20 2. Return true.
21 features: [IsHTMLDDA, logical-assignment-operators]
22 ---*/
23
24 var value = $262.IsHTMLDDA;
25 assert.sameValue(value ||= 2, 2);
26 assert.sameValue(value, 2);
27
28 reportCompare(0, 0);