1 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 7 # 1. Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # 2. Redistributions in binary form must reproduce the above copyright 10 # notice, this list of conditions and the following disclaimer in the 11 # documentation and/or other materials provided with the distribution. 12 # 13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 This tests if the Date setters handle invalid parameters correctly resulting in a NaN date and if a recovery from such a NaN date is only possible by using the date.setTime() and date.set[[UTC]Full]Year() functions. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS date.setTime(arg0) 30 PASS date.setTime() 31 PASS recover from NaN date using date.setTime() 32 PASS date.setTime passed all tests 33 PASS date.setMilliseconds(arg0) 34 PASS date.setMilliseconds() 35 PASS no recovering from NaN date using date.setMilliseconds(arg0) 36 PASS date.setMilliseconds passed all tests 37 PASS date.setUTCMilliseconds(arg0) 38 PASS date.setUTCMilliseconds() 39 PASS no recovering from NaN date using date.setUTCMilliseconds(arg0) 40 PASS date.setUTCMilliseconds passed all tests 41 PASS date.setSeconds(arg0, arg1) 42 PASS no recovering from NaN date using date.setSeconds(arg0, 0) 43 PASS date.setSeconds(arg0) 44 PASS date.setSeconds() 45 PASS no recovering from NaN date using date.setSeconds(arg0) 46 PASS date.setSeconds passed all tests 47 PASS date.setUTCSeconds(arg0, arg1) 48 PASS no recovering from NaN date using date.setUTCSeconds(arg0, 0) 49 PASS date.setUTCSeconds(arg0) 50 PASS date.setUTCSeconds() 51 PASS no recovering from NaN date using date.setUTCSeconds(arg0) 52 PASS date.setUTCSeconds passed all tests 53 PASS date.setMinutes(arg0, arg1, arg2) 54 PASS no recovering from NaN date using date.setMinutes(arg0, 0, 0) 55 PASS date.setMinutes(arg0, arg1) 56 PASS no recovering from NaN date using date.setMinutes(arg0, 0) 57 PASS date.setMinutes(arg0) 58 PASS date.setMinutes() 59 PASS no recovering from NaN date using date.setMinutes(arg0) 60 PASS date.setMinutes passed all tests 61 PASS date.setUTCMinutes(arg0, arg1, arg2) 62 PASS no recovering from NaN date using date.setUTCMinutes(arg0, 0, 0) 63 PASS date.setUTCMinutes(arg0, arg1) 64 PASS no recovering from NaN date using date.setUTCMinutes(arg0, 0) 65 PASS date.setUTCMinutes(arg0) 66 PASS date.setUTCMinutes() 67 PASS no recovering from NaN date using date.setUTCMinutes(arg0) 68 PASS date.setUTCMinutes passed all tests 69 PASS date.setHours(arg0, arg1, arg2, arg3) 70 PASS no recovering from NaN date using date.setHours(arg0, 0, 0, 0) 71 PASS date.setHours(arg0, arg1, arg2) 72 PASS no recovering from NaN date using date.setHours(arg0, 0, 0) 73 PASS date.setHours(arg0, arg1) 74 PASS no recovering from NaN date using date.setHours(arg0, 0) 75 PASS date.setHours(arg0) 76 PASS date.setHours() 77 PASS no recovering from NaN date using date.setHours(arg0) 78 PASS date.setHours passed all tests 79 PASS date.setUTCHours(arg0, arg1, arg2, arg3) 80 PASS no recovering from NaN date using date.setUTCHours(arg0, 0, 0, 0) 81 PASS date.setUTCHours(arg0, arg1, arg2) 82 PASS no recovering from NaN date using date.setUTCHours(arg0, 0, 0) 83 PASS date.setUTCHours(arg0, arg1) 84 PASS no recovering from NaN date using date.setUTCHours(arg0, 0) 85 PASS date.setUTCHours(arg0) 86 PASS date.setUTCHours() 87 PASS no recovering from NaN date using date.setUTCHours(arg0) 88 PASS date.setUTCHours passed all tests 89 PASS date.setDate(arg0) 90 PASS date.setDate() 91 PASS no recovering from NaN date using date.setDate(arg0) 92 PASS date.setDate passed all tests 93 PASS date.setUTCDate(arg0) 94 PASS date.setUTCDate() 95 PASS no recovering from NaN date using date.setUTCDate(arg0) 96 PASS date.setUTCDate passed all tests 97 PASS date.setMonth(arg0, arg1) 98 PASS no recovering from NaN date using date.setMonth(arg0, 0) 99 PASS date.setMonth(arg0) 100 PASS date.setMonth() 101 PASS no recovering from NaN date using date.setMonth(arg0) 102 PASS date.setMonth passed all tests 103 PASS date.setUTCMonth(arg0, arg1) 104 PASS no recovering from NaN date using date.setUTCMonth(arg0, 0) 105 PASS date.setUTCMonth(arg0) 106 PASS date.setUTCMonth() 107 PASS no recovering from NaN date using date.setUTCMonth(arg0) 108 PASS date.setUTCMonth passed all tests 109 PASS date.setFullYear(arg0, arg1, arg2) 110 PASS date.setFullYear(arg0, arg1) 111 PASS date.setFullYear(arg0) 112 PASS date.setFullYear() 113 PASS recover from NaN date using date.setFullYear() 114 PASS date.setFullYear passed all tests 115 PASS date.setUTCFullYear(arg0, arg1, arg2) 116 PASS date.setUTCFullYear(arg0, arg1) 117 PASS date.setUTCFullYear(arg0) 118 PASS date.setUTCFullYear() 119 PASS recover from NaN date using date.setUTCFullYear() 120 PASS date.setUTCFullYear passed all tests 121 PASS date.setYear(arg0) 122 PASS date.setYear() 123 PASS date.getYear() is compatible to JavaScript 1.3 and later 124 PASS recover from NaN date using date.setUTCFullYear() 125 PASS date.setYear passed all tests 126 PASS successfullyParsed is true 127 128 TEST COMPLETE 129 130