Test PlainDate.from with trailing junk in string argument.

This commit is contained in:
Ms2ger 2022-01-19 12:30:02 +01:00 committed by Rick Waldron
parent 66f4071495
commit 6ee33f1c86
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.from
description: RangeError thrown if a string with trailing junk is used as a PlainDate
features: [Temporal, arrow-function]
---*/
assert.throws(RangeError, () => Temporal.PlainDate.from("1976-11-18junk"),
"String with trailing junk should not be valid as a PlainDate");