168ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// Copyright 2009 the V8 project authors. All rights reserved.
268ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// Redistribution and use in source and binary forms, with or without
368ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// modification, are permitted provided that the following conditions are
468ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// met:
568ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//
668ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//     * Redistributions of source code must retain the above copyright
768ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       notice, this list of conditions and the following disclaimer.
868ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//     * Redistributions in binary form must reproduce the above
968ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       copyright notice, this list of conditions and the following
1068ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       disclaimer in the documentation and/or other materials provided
1168ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       with the distribution.
1268ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//     * Neither the name of Google Inc. nor the names of its
1368ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       contributors may be used to endorse or promote products derived
1468ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//       from this software without specific prior written permission.
1568ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org//
1668ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1768ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1868ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1968ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2068ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2168ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2268ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2368ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2468ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2568ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2668ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2768ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org
2868ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org// See http://code.google.com/p/v8/issues/detail?id=399
2968ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.org
3068ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.orgvar date = new Date(1.009804e12);
31160a7b0747492f3f735353d9582521f3314bf4dfdanno@chromium.orgvar year = Number(String(date).match(/.*(200\d)/)[1]);
3268ac009f55a85e6891742d58914eaf717f667b26kasperl@chromium.orgassertEquals(year, date.getFullYear());
33