Debian Codegraph @

js/src/tests/test262/intl402/DurationFormat/constructor-options-invalid.js

raw
1 // |reftest| skip-if(!Intl.hasOwnProperty('DurationFormat')) -- Intl.DurationFormat is not enabled unconditionally
2 // Copyright 2022 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-Intl.DurationFormat
7 description: Checks handling of a null options argument to the DurationFormat constructor.
8 info: |
9 Intl.DurationFormat ( [ locales [ , options ] ] )
10 (...)
11 4. Let options be GetOptionsObject(options).
12 features: [Intl.DurationFormat]
13 ---*/
14
15 assert.sameValue(typeof Intl.DurationFormat, "function");
16
17 assert.throws(TypeError, function() { new Intl.DurationFormat([], null) })
18
19 reportCompare(0, 0);