mirror of https://github.com/tc39/test262.git
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
|
@ -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");
|
||||
|
||||
|
|
@ -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");
|
||||
|
||||
|
|
@ -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…
Reference in New Issue