mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 17:04:31 +02:00
Verify that Duration#with() doesn't accept duration strings
Also fix the description and put the string tests together.
This commit is contained in:
parent
749a6f9509
commit
68a817d713
@ -3,7 +3,7 @@
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.duration.prototype.with
|
||||
description: Passing a primitive other than string to with() throws
|
||||
description: Passing a primitive to with() throws
|
||||
features: [Symbol, Temporal]
|
||||
---*/
|
||||
|
||||
@ -12,7 +12,8 @@ assert.throws(TypeError, () => instance.with(undefined), "undefined");
|
||||
assert.throws(TypeError, () => instance.with(null), "null");
|
||||
assert.throws(TypeError, () => instance.with(true), "boolean");
|
||||
assert.throws(TypeError, () => instance.with(""), "empty string");
|
||||
assert.throws(TypeError, () => instance.with("P1D"), "duration string");
|
||||
assert.throws(TypeError, () => instance.with("string"), "string");
|
||||
assert.throws(TypeError, () => instance.with(Symbol()), "Symbol");
|
||||
assert.throws(TypeError, () => instance.with(7), "number");
|
||||
assert.throws(TypeError, () => instance.with(7n), "bigint");
|
||||
assert.throws(TypeError, () => instance.with("string"), "string");
|
||||
|
Loading…
x
Reference in New Issue
Block a user