blob: ed609bbb1f14816d05306a7a84dc577a111a2593 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Some surrounding cases which already worked, for good measure
6assertTrue(new Date('275760-10-14') == 'Invalid Date');
7assertTrue(new Date('275760-09-23') == 'Invalid Date');
8assertTrue(new Date('+275760-09-24') == 'Invalid Date');
9assertTrue(new Date('+275760-10-13') == 'Invalid Date');
10
11// The following cases used to throw "illegal access"
12assertTrue(new Date('275760-09-24') == 'Invalid Date');
13assertTrue(new Date('275760-10-13') == 'Invalid Date');
14assertTrue(new Date('+275760-10-13 ') == 'Invalid Date');
15
16// However, dates within the range or valid
17assertTrue(new Date('100000-10-13') != 'Invalid Date');
18assertTrue(new Date('+100000-10-13') != 'Invalid Date');
19assertTrue(new Date('+100000-10-13 ') != 'Invalid Date');