2021-07-16 15:45:02 +02:00
|
|
|
// Copyright 2021 the V8 project authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
esid: sec-initializedatetimeformat
|
"Normalize" some YAML
In each case, it's the scalar value associated with the "description" key.
Normally in test262, this is written in either:
- block notation (indicated by '>' or '|'), or
- flow notation, single-line, on the same line as the key.
In the cases addressed by this PR, the value is instead written in:
- (1x) flow notation, *multi*-line, or
- (2x) flow notation, single-line, on the line *after* the key.
These are valid YAML, but they're styles that test262 doesn't otherwise use,
so could conceivably confuse people or harnesses.
This PR changes them to block notation.
2021-07-21 22:22:34 +02:00
|
|
|
description: >
|
2021-07-16 15:45:02 +02:00
|
|
|
Invalid values for the `timeZoneName` option of the DateTimeFormat constructor
|
|
|
|
features: [Intl.DateTimeFormat-extend-timezonename]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
assert.throws(RangeError, function () {
|
|
|
|
new Intl.DateTimeFormat('en', { timeZoneName: '' });
|
|
|
|
}, 'empty string');
|
|
|
|
|
|
|
|
assert.throws(RangeError, function () {
|
|
|
|
new Intl.DateTimeFormat('en', { timeZoneName: 'short ' });
|
|
|
|
}, '"short "');
|
|
|
|
|
|
|
|
assert.throws(RangeError, function () {
|
|
|
|
new Intl.DateTimeFormat('en', { timeZoneName: ' long' });
|
|
|
|
}, '" long"');
|
|
|
|
|
|
|
|
assert.throws(RangeError, function () {
|
|
|
|
new Intl.DateTimeFormat('en', { timeZoneName: 'offset' });
|
|
|
|
}, '"offset"');
|
|
|
|
|
|
|
|
assert.throws(RangeError, function () {
|
|
|
|
new Intl.DateTimeFormat('en', { timeZoneName: 'generic' });
|
|
|
|
}, '"generic"');
|