test262/test/intl402/DateTimeFormat/offset-timezone-no-unicode-...

18 lines
508 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-createdatetimeformat
description: >
A valid offset time zone identifier may not include U+2212 MINUS SIGN
---*/
// Note: the first character of each of these strings is U+2122 MINUS SIGN
const invalidIDs = [
'0900',
'10:00',
'05',
];
invalidIDs.forEach((id) => {
assert.throws(RangeError, () => new Intl.DateTimeFormat("en", { timeZone: id }));
});