diff --git a/test/built-ins/Date/prototype/toDateString/invalid-date.js b/test/built-ins/Date/prototype/toDateString/invalid-date.js new file mode 100644 index 0000000000..30a01cda0c --- /dev/null +++ b/test/built-ins/Date/prototype/toDateString/invalid-date.js @@ -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"); + + diff --git a/test/built-ins/Date/prototype/toTimeString/invalid-date.js b/test/built-ins/Date/prototype/toTimeString/invalid-date.js new file mode 100644 index 0000000000..426dd9cb9d --- /dev/null +++ b/test/built-ins/Date/prototype/toTimeString/invalid-date.js @@ -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"); + + diff --git a/test/built-ins/Date/prototype/toUTCString/invalid-date.js b/test/built-ins/Date/prototype/toUTCString/invalid-date.js new file mode 100644 index 0000000000..774fd69d72 --- /dev/null +++ b/test/built-ins/Date/prototype/toUTCString/invalid-date.js @@ -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"); +