constructor-options-numberingSystem-valid.js (927B)
1 // Copyright 2022 Igalia, S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-Intl.DurationFormat 6 description: > 7 Checks error cases for the options argument to the DurationFormat constructor. 8 info: | 9 Intl.DurationFormat ( [ locales [ , options ] ] ) 10 (...) 11 6. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined). 12 7. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. 13 features: [Intl.DurationFormat] 14 ---*/ 15 16 const numberingSystems = Intl.supportedValuesOf("numberingSystem"); 17 18 for (const numberingSystem of numberingSystems) { 19 const obj = new Intl.DurationFormat("en", {numberingSystem}); 20 assert.sameValue(obj.resolvedOptions().numberingSystem, numberingSystem, `${numberingSystem} is supported by DurationFormat`); 21 } 22 23 reportCompare(0, 0);