mirror of https://github.com/tc39/test262.git
Sync to PR701 (#3609)
In 2022-07-20 TC39 we decide to take https://github.com/tc39/ecma402/pull/701 and not check the order of the x and y see https://docs.google.com/presentation/d/1UUvbf3FFu9PGtrPAKPdMad9DZuVFLIvkAsAxyJZyvxM/ for details
This commit is contained in:
parent
7b2a9bb441
commit
ab29fd3225
|
@ -1,9 +1,9 @@
|
||||||
// Copyright 2019 Google, Inc. All rights reserved.
|
// Copyright 2022 Google, Inc. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
description: >
|
||||||
Throws a RangeError if date x is greater than y.
|
Return a string if date x is greater than y.
|
||||||
info: |
|
info: |
|
||||||
Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate )
|
Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate )
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ info: |
|
||||||
2. If x is NaN, throw a RangeError exception.
|
2. If x is NaN, throw a RangeError exception.
|
||||||
3. Let y be TimeClip(y).
|
3. Let y be TimeClip(y).
|
||||||
4. If y is NaN, throw a RangeError exception.
|
4. If y is NaN, throw a RangeError exception.
|
||||||
5. If x is greater than y, throw a RangeError exception.
|
|
||||||
|
|
||||||
features: [Intl.DateTimeFormat-formatRange]
|
features: [Intl.DateTimeFormat-formatRange]
|
||||||
---*/
|
---*/
|
||||||
|
@ -28,10 +27,7 @@ var x = new Date();
|
||||||
var y = new Date();
|
var y = new Date();
|
||||||
x.setDate(y.getDate() + 1);
|
x.setDate(y.getDate() + 1);
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.sameValue("string", typeof dtf.formatRange(x, y));
|
||||||
dtf.formatRange(x, y);
|
|
||||||
}, "x > y");
|
|
||||||
|
|
||||||
assert.sameValue("string", typeof dtf.formatRange(x, x));
|
assert.sameValue("string", typeof dtf.formatRange(x, x));
|
||||||
assert.sameValue("string", typeof dtf.formatRange(y, y));
|
assert.sameValue("string", typeof dtf.formatRange(y, y));
|
||||||
assert.sameValue("string", typeof dtf.formatRange(y, x));
|
assert.sameValue("string", typeof dtf.formatRange(y, x));
|
|
@ -1,9 +1,9 @@
|
||||||
// Copyright 2019 Google, Inc. All rights reserved.
|
// Copyright 2022 Google, Inc. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
description: >
|
description: >
|
||||||
Throws a RangeError if date x is greater than y.
|
Return an object if date x is greater than y.
|
||||||
info: |
|
info: |
|
||||||
Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate )
|
Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate )
|
||||||
|
|
||||||
|
@ -12,13 +12,10 @@ info: |
|
||||||
6. Return ? FormatDateTimeRangeToParts(dtf, x, y).
|
6. Return ? FormatDateTimeRangeToParts(dtf, x, y).
|
||||||
|
|
||||||
PartitionDateTimeRangePattern ( dateTimeFormat, x, y )
|
PartitionDateTimeRangePattern ( dateTimeFormat, x, y )
|
||||||
|
|
||||||
1. Let x be TimeClip(x).
|
1. Let x be TimeClip(x).
|
||||||
2. If x is NaN, throw a RangeError exception.
|
2. If x is NaN, throw a RangeError exception.
|
||||||
3. Let y be TimeClip(y).
|
3. Let y be TimeClip(y).
|
||||||
4. If y is NaN, throw a RangeError exception.
|
4. If y is NaN, throw a RangeError exception.
|
||||||
5. If x is greater than y, throw a RangeError exception.
|
|
||||||
|
|
||||||
features: [Intl.DateTimeFormat-formatRange]
|
features: [Intl.DateTimeFormat-formatRange]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -28,9 +25,7 @@ var x = new Date();
|
||||||
var y = new Date();
|
var y = new Date();
|
||||||
x.setDate(y.getDate() + 1);
|
x.setDate(y.getDate() + 1);
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.sameValue("object", typeof dtf.formatRangeToParts(x, y));
|
||||||
dtf.formatRangeToParts(x, y);
|
|
||||||
}, "x > y");
|
|
||||||
assert.sameValue("object", typeof dtf.formatRangeToParts(x, x));
|
assert.sameValue("object", typeof dtf.formatRangeToParts(x, x));
|
||||||
assert.sameValue("object", typeof dtf.formatRangeToParts(y, y));
|
assert.sameValue("object", typeof dtf.formatRangeToParts(y, y));
|
||||||
assert.sameValue("object", typeof dtf.formatRangeToParts(y, x));
|
assert.sameValue("object", typeof dtf.formatRangeToParts(y, x));
|
Loading…
Reference in New Issue