| 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 MakeTime produce NaN |
| 7 |
info: | |
| 8 |
[...] |
| 9 |
9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))). |
| 10 |
|
| 11 |
MakeTime (hour, min, sec, ms) |
| 12 |
|
| 13 |
1. If hour is not finite or min is not finite or sec is not finite or ms is |
| 14 |
not finite, return NaN. |
| 15 |
---*/ |
| 16 |
|
| 17 |
assert.sameValue(Date.UTC(0, 0, 1, Infinity), NaN, 'hour: Infinity'); |
| 18 |
assert.sameValue(Date.UTC(0, 0, 1, -Infinity), NaN, 'hour: -Infinity'); |
| 19 |
|
| 20 |
assert.sameValue(Date.UTC(0, 0, 1, 0, Infinity), NaN, 'minute: Infinity'); |
| 21 |
assert.sameValue(Date.UTC(0, 0, 1, 0, -Infinity), NaN, 'minute: -Infinity'); |
| 22 |
|
| 23 |
assert.sameValue(Date.UTC(0, 0, 1, 0, 0, Infinity), NaN, 'second: Infinity'); |
| 24 |
assert.sameValue(Date.UTC(0, 0, 1, 0, 0, -Infinity), NaN, 'second: -Infinity'); |
| 25 |
|
| 26 |
assert.sameValue(Date.UTC(0, 0, 1, 0, 0, 0, Infinity), NaN, 'ms: Infinity'); |
| 27 |
assert.sameValue(Date.UTC(0, 0, 1, 0, 0, 0, -Infinity), NaN, 'ms: -Infinity'); |