summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js')
-rw-r--r--js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js
new file mode 100644
index 0000000000..83b1617f29
--- /dev/null
+++ b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/value-symbol.js
@@ -0,0 +1,22 @@
+// Copyright 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-Intl.RelativeTimeFormat.prototype.format
+description: Checks the handling of invalid value arguments to Intl.RelativeTimeFormat.prototype.format().
+info: |
+ Intl.RelativeTimeFormat.prototype.format( value, unit )
+
+ 3. Let value be ? ToNumber(value).
+
+features: [Intl.RelativeTimeFormat]
+---*/
+
+const rtf = new Intl.RelativeTimeFormat("en-US");
+
+assert.sameValue(typeof rtf.format, "function", "format should be supported");
+
+const symbol = Symbol();
+assert.throws(TypeError, () => rtf.format(symbol, "second"));
+
+reportCompare(0, 0);