intl-legacy-constructed-symbol-on-unwrap.js (1030B)
1 // Copyright 2020 Apple Inc. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-unwrapdatetimeformat 6 description: > 7 Tests that [[FallbackSymbol]]'s [[Description]] is "IntlLegacyConstructedSymbol" if normative optional is implemented. 8 author: Yusuke Suzuki 9 features: [intl-normative-optional] 10 ---*/ 11 12 let object = new Intl.DateTimeFormat(); 13 let newObject = Intl.DateTimeFormat.call(object); 14 let symbol = null; 15 let error = null; 16 try { 17 let proxy = new Proxy(newObject, { 18 get(target, property) { 19 symbol = property; 20 return target[property]; 21 } 22 }); 23 Intl.DateTimeFormat.prototype.resolvedOptions.call(proxy); 24 } catch (e) { 25 // If normative optional is not implemented, an error will be thrown. 26 error = e; 27 assert(error instanceof TypeError); 28 } 29 if (error === null) { 30 assert.sameValue(typeof symbol, "symbol"); 31 assert.sameValue(symbol.description, "IntlLegacyConstructedSymbol"); 32 } 33 34 reportCompare(0, 0);