Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Binary: cache/js-dbg-64-1fd6c40d3852-linux |
michael@0 | 2 | // Flags: --ion-eager |
michael@0 | 3 | // |
michael@0 | 4 | function TestCase(n, d, e, a) {} |
michael@0 | 5 | var msPerDay = 86400000; |
michael@0 | 6 | var msPerHour = 3600000; |
michael@0 | 7 | var now = new Date(); |
michael@0 | 8 | var TIME_NOW = now.valueOf(); |
michael@0 | 9 | function DaysInYear( y ) { |
michael@0 | 10 | if ( y % 4 != 0 ) { |
michael@0 | 11 | return 365; |
michael@0 | 12 | } |
michael@0 | 13 | return 366; |
michael@0 | 14 | } |
michael@0 | 15 | function TimeInYear( y ) { |
michael@0 | 16 | return ( DaysInYear(y) * msPerDay ); |
michael@0 | 17 | } |
michael@0 | 18 | function TimeFromYear( y ) { |
michael@0 | 19 | return ( msPerDay * DayFromYear(y) ); |
michael@0 | 20 | } |
michael@0 | 21 | function DayFromYear( y ) { |
michael@0 | 22 | return ( 365*(y-1970) + |
michael@0 | 23 | Math.floor((y-1601)/400) ); |
michael@0 | 24 | } |
michael@0 | 25 | function InLeapYear( t ) { |
michael@0 | 26 | if ( DaysInYear(YearFromTime(t)) == 365 ) { |
michael@0 | 27 | return 0; |
michael@0 | 28 | } |
michael@0 | 29 | if ( DaysInYear(YearFromTime(t)) == 366 ) { |
michael@0 | 30 | } |
michael@0 | 31 | } |
michael@0 | 32 | function YearFromTime( t ) { |
michael@0 | 33 | var sign = ( t < 0 ) ? -1 : 1; |
michael@0 | 34 | var year = ( sign < 0 ) ? 1969 : 1970; |
michael@0 | 35 | for ( var timeToTimeZero = t; ; ) { |
michael@0 | 36 | timeToTimeZero -= sign * TimeInYear(year) |
michael@0 | 37 | if ( sign < 0 ) { |
michael@0 | 38 | } else { |
michael@0 | 39 | if ( sign * timeToTimeZero < 0 ) { |
michael@0 | 40 | break; |
michael@0 | 41 | } else { |
michael@0 | 42 | year += sign; |
michael@0 | 43 | } |
michael@0 | 44 | } |
michael@0 | 45 | } |
michael@0 | 46 | return ( year ); |
michael@0 | 47 | } |
michael@0 | 48 | function WeekDay( t ) {} |
michael@0 | 49 | function LocalTZA() {} |
michael@0 | 50 | function LocalTime( t ) { |
michael@0 | 51 | var dst_start = GetDSTStart(t); |
michael@0 | 52 | } |
michael@0 | 53 | function GetFirstSundayInMonth( t, m ) { |
michael@0 | 54 | var leap = InLeapYear(t); |
michael@0 | 55 | } |
michael@0 | 56 | function GetDSTStart( t ) { |
michael@0 | 57 | return (GetFirstSundayInMonth(t, 2) + 7*msPerDay + 2*msPerHour - LocalTZA()); |
michael@0 | 58 | } |
michael@0 | 59 | var SECTION = "15.9.5.12"; |
michael@0 | 60 | addTestCase( TIME_NOW ); |
michael@0 | 61 | function addTestCase( t ) { |
michael@0 | 62 | var start = TimeFromYear(YearFromTime(t)); |
michael@0 | 63 | var stop = TimeFromYear(YearFromTime(t) + 1); |
michael@0 | 64 | for (var d = start; d < stop; d += msPerDay) { |
michael@0 | 65 | new TestCase( SECTION, |
michael@0 | 66 | WeekDay((LocalTime(d))), |
michael@0 | 67 | (__lookupGetter__) ); |
michael@0 | 68 | } |
michael@0 | 69 | } |