lgcl-nullish-assignment-operator-unresolved-rhs-put.js (613B)
1 // Copyright (c) 2020 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-assignment-operators-runtime-semantics-evaluation 6 description: > 7 ReferenceError is thrown if the AssignmentExpression of a Logical 8 Assignment operator(??=) evaluates to an unresolvable reference and the 9 AssignmentExpression is evaluated. 10 features: [logical-assignment-operators] 11 12 ---*/ 13 14 var value = undefined; 15 16 assert.throws(ReferenceError, function() { 17 value ??= unresolved; 18 }); 19 assert.sameValue(value, undefined, "value"); 20 21 reportCompare(0, 0);