summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js')
-rw-r--r--js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js
new file mode 100644
index 0000000000..7cd1abbf1a
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/with/options-invalid.js
@@ -0,0 +1,16 @@
+// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
+// Copyright (C) 2021 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-temporal.plaintime.prototype.with
+description: TypeError thrown when a primitive is passed as the options argument
+features: [Temporal]
+---*/
+
+const plainTime = new Temporal.PlainTime(12);
+for (const badOptions of [null, true, "hello", Symbol("foo"), 1, 1n]) {
+ assert.throws(TypeError, () => plainTime.with({ hour: 3 }, badOptions));
+}
+
+reportCompare(0, 0);