diff options
Diffstat (limited to 'js/src/tests/test262/intl402/NumberFormat/prototype/formatRangeToParts/undefined-arguments-throws.js')
-rw-r--r-- | js/src/tests/test262/intl402/NumberFormat/prototype/formatRangeToParts/undefined-arguments-throws.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/NumberFormat/prototype/formatRangeToParts/undefined-arguments-throws.js b/js/src/tests/test262/intl402/NumberFormat/prototype/formatRangeToParts/undefined-arguments-throws.js new file mode 100644 index 0000000000..3906806b5f --- /dev/null +++ b/js/src/tests/test262/intl402/NumberFormat/prototype/formatRangeToParts/undefined-arguments-throws.js @@ -0,0 +1,22 @@ +// Copyright (C) 2021 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.NumberFormat.prototype.formatRangeToParts +description: > + "formatRangeToParts" basic tests when arguments are undefined throw a TypeError exception. +info: | + Intl.NumberFormat.prototype.formatRangeToParts ( start, end ) + (...) + 3. If start is undefined or end is undefined, throw a TypeError exception. +features: [Intl.NumberFormat-v3] +---*/ + +const nf = new Intl.NumberFormat(); + +// If arguments are undefined throw a TypeError exception. +assert.throws(TypeError, () => { nf.formatRangeToParts(undefined, 23) }); +assert.throws(TypeError, () => { nf.formatRangeToParts(1,undefined) }); +assert.throws(TypeError, () => { nf.formatRangeToParts(undefined, undefined)}); + +reportCompare(0, 0); |