| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
esid: sec-date.utc |
| 5 |
es6id: 20.3.3.4 |
| 6 |
description: Infinite values specified to MakeDay produce NaN |
| 7 |
info: | |
| 8 |
[...] |
| 9 |
9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))). |
| 10 |
|
| 11 |
MakeDay (year, month, date) |
| 12 |
|
| 13 |
1. If year is not finite or month is not finite or date is not finite, return |
| 14 |
NaN. |
| 15 |
---*/ |
| 16 |
|
| 17 |
assert.sameValue(Date.UTC(Infinity), NaN, 'year: Infinity - single arg'); |
| 18 |
assert.sameValue(Date.UTC(-Infinity), NaN, 'year: -Infinity - single arg'); |
| 19 |
|
| 20 |
assert.sameValue(Date.UTC(Infinity, 0), NaN, 'year: Infinity'); |
| 21 |
assert.sameValue(Date.UTC(-Infinity, 0), NaN, 'year: -Infinity'); |
| 22 |
|
| 23 |
assert.sameValue(Date.UTC(0, Infinity), NaN, 'month: Infinity'); |
| 24 |
assert.sameValue(Date.UTC(0, -Infinity), NaN, 'month: -Infinity'); |
| 25 |
|
| 26 |
assert.sameValue(Date.UTC(0, 0, Infinity), NaN, 'date: Infinity'); |
| 27 |
assert.sameValue(Date.UTC(0, 0, -Infinity), NaN, 'date: -Infinity'); |
| 28 |
|