michael@0: // Binary: cache/js-dbg-64-1fd6c40d3852-linux michael@0: // Flags: --ion-eager michael@0: // michael@0: function TestCase(n, d, e, a) {} michael@0: var msPerDay = 86400000; michael@0: var msPerHour = 3600000; michael@0: var now = new Date(); michael@0: var TIME_NOW = now.valueOf(); michael@0: function DaysInYear( y ) { michael@0: if ( y % 4 != 0 ) { michael@0: return 365; michael@0: } michael@0: return 366; michael@0: } michael@0: function TimeInYear( y ) { michael@0: return ( DaysInYear(y) * msPerDay ); michael@0: } michael@0: function TimeFromYear( y ) { michael@0: return ( msPerDay * DayFromYear(y) ); michael@0: } michael@0: function DayFromYear( y ) { michael@0: return ( 365*(y-1970) + michael@0: Math.floor((y-1601)/400) ); michael@0: } michael@0: function InLeapYear( t ) { michael@0: if ( DaysInYear(YearFromTime(t)) == 365 ) { michael@0: return 0; michael@0: } michael@0: if ( DaysInYear(YearFromTime(t)) == 366 ) { michael@0: } michael@0: } michael@0: function YearFromTime( t ) { michael@0: var sign = ( t < 0 ) ? -1 : 1; michael@0: var year = ( sign < 0 ) ? 1969 : 1970; michael@0: for ( var timeToTimeZero = t; ; ) { michael@0: timeToTimeZero -= sign * TimeInYear(year) michael@0: if ( sign < 0 ) { michael@0: } else { michael@0: if ( sign * timeToTimeZero < 0 ) { michael@0: break; michael@0: } else { michael@0: year += sign; michael@0: } michael@0: } michael@0: } michael@0: return ( year ); michael@0: } michael@0: function WeekDay( t ) {} michael@0: function LocalTZA() {} michael@0: function LocalTime( t ) { michael@0: var dst_start = GetDSTStart(t); michael@0: } michael@0: function GetFirstSundayInMonth( t, m ) { michael@0: var leap = InLeapYear(t); michael@0: } michael@0: function GetDSTStart( t ) { michael@0: return (GetFirstSundayInMonth(t, 2) + 7*msPerDay + 2*msPerHour - LocalTZA()); michael@0: } michael@0: var SECTION = "15.9.5.12"; michael@0: addTestCase( TIME_NOW ); michael@0: function addTestCase( t ) { michael@0: var start = TimeFromYear(YearFromTime(t)); michael@0: var stop = TimeFromYear(YearFromTime(t) + 1); michael@0: for (var d = start; d < stop; d += msPerDay) { michael@0: new TestCase( SECTION, michael@0: WeekDay((LocalTime(d))), michael@0: (__lookupGetter__) ); michael@0: } michael@0: }