summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/undefined-arguments-throws.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/undefined-arguments-throws.js')
-rw-r--r--js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/undefined-arguments-throws.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/undefined-arguments-throws.js b/js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/undefined-arguments-throws.js
new file mode 100644
index 0000000000..a9fbd4f712
--- /dev/null
+++ b/js/src/tests/test262/intl402/NumberFormat/prototype/formatRange/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.formatRange
+description: >
+ "formatRange" basic tests when arguments are undefined throw a TypeError exception.
+info: |
+ Intl.NumberFormat.prototype.formatRange ( 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.formatRange(undefined, 23) });
+assert.throws(TypeError, () => { nf.formatRange(1,undefined) });
+assert.throws(TypeError, () => { nf.formatRange(undefined, undefined)});
+
+reportCompare(0, 0);