private-field-rhs-unresolvable.js (781B)
1 // Copyright 2021 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: Algorithm interrupted by unresolvable reference 6 info: | 7 1. Let privateIdentifier be the StringValue of PrivateIdentifier. 8 2. Let rref be the result of evaluating ShiftExpression. 9 3. Let rval be ? GetValue(rref). 10 esid: sec-relational-operators-runtime-semantics-evaluation 11 features: [class-fields-private, class-fields-private-in] 12 ---*/ 13 14 let caught = null; 15 16 class C { 17 #field; 18 constructor() { 19 try { 20 #field in test262unresolvable; 21 } catch (error) { 22 caught = error; 23 } 24 } 25 } 26 27 new C(); 28 29 assert.notSameValue(caught, null); 30 assert.sameValue(caught.constructor, ReferenceError); 31 32 reportCompare(0, 0);