OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "dateparser.h" | 30 #include "dateparser.h" |
31 | 31 |
32 namespace v8 { | 32 namespace v8 { |
33 namespace internal { | 33 namespace internal { |
34 | 34 |
35 bool DateParser::DayComposer::Write(FixedArray* output) { | 35 bool DateParser::DayComposer::Write(FixedArray* output) { |
36 if (index_ < 1) return false; | 36 if (index_ < 1) return false; |
37 // Day and month defaults to 1. | 37 // Day and month defaults to 1. |
38 while (index_ < kSize) { | 38 while (index_ < kSize) { |
39 comp_[index_++] = 1; | 39 comp_[index_++] = 1; |
40 } | 40 } |
41 | 41 |
42 int year = 0; // Default year is 0 (=> 2000) for KJS compatibility. | 42 int year = 0; // Default year is 0 (=> 2000) for KJS compatibility. |
43 int month = kNone; | 43 int month = kNone; |
44 int day = kNone; | 44 int day = kNone; |
45 | 45 |
46 if (named_month_ == kNone) { | 46 if (named_month_ == kNone) { |
47 if (index_ == 3 && !IsDay(comp_[0])) { | 47 if (index_ == 3 && !IsDay(comp_[0])) { |
48 // YMD | 48 // YMD |
49 year = comp_[0]; | 49 year = comp_[0]; |
50 month = comp_[1]; | 50 month = comp_[1]; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (j == kPrefixLength && | 169 if (j == kPrefixLength && |
170 (len <= kPrefixLength || array[i][kTypeOffset] == MONTH_NAME)) { | 170 (len <= kPrefixLength || array[i][kTypeOffset] == MONTH_NAME)) { |
171 return i; | 171 return i; |
172 } | 172 } |
173 } | 173 } |
174 return i; | 174 return i; |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 } } // namespace v8::internal | 178 } } // namespace v8::internal |
OLD | NEW |