Tests for "Invalid Date" in more cases

Following the proposed specification in
https://github.com/tc39/ecma262/pull/848
This commit is contained in:
Daniel Ehrenberg 2017-03-21 18:26:36 +01:00
parent 975e54de17
commit bd685e552c
3 changed files with 50 additions and 0 deletions

View 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");

View 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");

View 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");