summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js')
-rw-r--r--js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
new file mode 100644
index 0000000000..1e59d7c6d9
--- /dev/null
+++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- Intl.DurationFormat is not supported
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-intl.DurationFormat.prototype.format
+description: basic tests internal slot initialization and call receiver errors
+info: |
+ Intl.DurationFormat.prototype.format ( duration )
+ (...)
+ 2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
+features: [Intl.DurationFormat]
+---*/
+
+const df = new Intl.DurationFormat();
+
+let f = df["format"];
+
+assert.sameValue(typeof f, "function");
+assert.throws(TypeError, () => {
+ f({ hours: 1, minutes: 46, seconds: 40 });
+});
+
+reportCompare(0, 0);