mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Tests for "Invalid Date" in more cases
Following the proposed specification in https://github.com/tc39/ecma262/pull/848
This commit is contained in:
parent
975e54de17
commit
bd685e552c
17
test/built-ins/Date/prototype/toDateString/invalid-date.js
vendored
Normal file
17
test/built-ins/Date/prototype/toDateString/invalid-date.js
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-date.prototype.todatestring
|
||||||
|
description: Invalid Dates are rendered as "Invalid Date"
|
||||||
|
info: >
|
||||||
|
Date.prototype.toDateString ( )
|
||||||
|
|
||||||
|
...
|
||||||
|
3. If tv is NaN, return "Invalid Date".
|
||||||
|
...
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(new Date(NaN).toDateString(), "Invalid Date");
|
||||||
|
|
||||||
|
|
17
test/built-ins/Date/prototype/toTimeString/invalid-date.js
vendored
Normal file
17
test/built-ins/Date/prototype/toTimeString/invalid-date.js
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-date.prototype.totimestring
|
||||||
|
description: Invalid Dates are rendered as "Invalid Date"
|
||||||
|
info: >
|
||||||
|
Date.prototype.toTimeString ( )
|
||||||
|
|
||||||
|
...
|
||||||
|
3. If tv is NaN, return "Invalid Date".
|
||||||
|
...
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(new Date(NaN).toTimeString(), "Invalid Date");
|
||||||
|
|
||||||
|
|
16
test/built-ins/Date/prototype/toUTCString/invalid-date.js
vendored
Normal file
16
test/built-ins/Date/prototype/toUTCString/invalid-date.js
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-date.prototype.toutcstring
|
||||||
|
description: Invalid Dates are rendered as "Invalid Date"
|
||||||
|
info: >
|
||||||
|
Date.prototype.toUTCString ( )
|
||||||
|
|
||||||
|
...
|
||||||
|
3. If tv is NaN, return "Invalid Date".
|
||||||
|
...
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(new Date(NaN).toUTCString(), "Invalid Date");
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user