Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: src/date-delay.js

Issue 17232: Fix for issue 91 (http://code.google.com/p/v8/issues/detail?id=91) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 950
951 951
952 // ECMA 262 - B.2.5 952 // ECMA 262 - B.2.5
953 function DateSetYear(year) { 953 function DateSetYear(year) {
954 var t = LocalTime(GetTimeFrom(this)); 954 var t = LocalTime(GetTimeFrom(this));
955 if ($isNaN(t)) t = 0; 955 if ($isNaN(t)) t = 0;
956 year = ToNumber(year); 956 year = ToNumber(year);
957 if ($isNaN(year)) return %_SetValueOf(this, $NaN); 957 if ($isNaN(year)) return %_SetValueOf(this, $NaN);
958 year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99) 958 year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
959 ? 1900 + TO_INTEGER(year) : year; 959 ? 1900 + TO_INTEGER(year) : year;
960 var day = MakeDay(year, GetMonthFrom(this), GetDateFrom(this)); 960 var day = MakeDay(year, MonthFromTime(t), DateFromTime(t));
961 return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t))))); 961 return %_SetValueOf(this, TimeClip(UTC(MakeDate(day, TimeWithinDay(t)))));
962 } 962 }
963 963
964 964
965 // ECMA 262 - B.2.6 965 // ECMA 262 - B.2.6
966 // 966 //
967 // Notice that this does not follow ECMA 262 completely. ECMA 262 967 // Notice that this does not follow ECMA 262 completely. ECMA 262
968 // says that toGMTString should be the same Function object as 968 // says that toGMTString should be the same Function object as
969 // toUTCString. JSC does not do this, so for compatibility we do not 969 // toUTCString. JSC does not do this, so for compatibility we do not
970 // do that either. Instead, we create a new function whose name 970 // do that either. Instead, we create a new function whose name
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 "setFullYear", DateSetFullYear, 1031 "setFullYear", DateSetFullYear,
1032 "setUTCFullYear", DateSetUTCFullYear, 1032 "setUTCFullYear", DateSetUTCFullYear,
1033 "toGMTString", DateToGMTString, 1033 "toGMTString", DateToGMTString,
1034 "toUTCString", DateToUTCString, 1034 "toUTCString", DateToUTCString,
1035 "getYear", DateGetYear, 1035 "getYear", DateGetYear,
1036 "setYear", DateSetYear 1036 "setYear", DateSetYear
1037 )); 1037 ));
1038 } 1038 }
1039 1039
1040 SetupDate(); 1040 SetupDate();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698