OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 16315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16326 Object* JSDate::GetUTCField(FieldIndex index, | 16326 Object* JSDate::GetUTCField(FieldIndex index, |
16327 double value, | 16327 double value, |
16328 DateCache* date_cache) { | 16328 DateCache* date_cache) { |
16329 ASSERT(index >= kFirstUTCField); | 16329 ASSERT(index >= kFirstUTCField); |
16330 | 16330 |
16331 if (std::isnan(value)) return GetIsolate()->heap()->nan_value(); | 16331 if (std::isnan(value)) return GetIsolate()->heap()->nan_value(); |
16332 | 16332 |
16333 int64_t time_ms = static_cast<int64_t>(value); | 16333 int64_t time_ms = static_cast<int64_t>(value); |
16334 | 16334 |
16335 if (index == kTimezoneOffset) { | 16335 if (index == kTimezoneOffset) { |
| 16336 date_cache->CheckTimezone(); |
16336 return Smi::FromInt(date_cache->TimezoneOffset(time_ms)); | 16337 return Smi::FromInt(date_cache->TimezoneOffset(time_ms)); |
16337 } | 16338 } |
16338 | 16339 |
16339 int days = DateCache::DaysFromTime(time_ms); | 16340 int days = DateCache::DaysFromTime(time_ms); |
16340 | 16341 |
16341 if (index == kWeekdayUTC) return Smi::FromInt(date_cache->Weekday(days)); | 16342 if (index == kWeekdayUTC) return Smi::FromInt(date_cache->Weekday(days)); |
16342 | 16343 |
16343 if (index <= kDayUTC) { | 16344 if (index <= kDayUTC) { |
16344 int year, month, day; | 16345 int year, month, day; |
16345 date_cache->YearMonthDayFromDays(days, &year, &month, &day); | 16346 date_cache->YearMonthDayFromDays(days, &year, &month, &day); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16489 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16490 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16490 static const char* error_messages_[] = { | 16491 static const char* error_messages_[] = { |
16491 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16492 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16492 }; | 16493 }; |
16493 #undef ERROR_MESSAGES_TEXTS | 16494 #undef ERROR_MESSAGES_TEXTS |
16494 return error_messages_[reason]; | 16495 return error_messages_[reason]; |
16495 } | 16496 } |
16496 | 16497 |
16497 | 16498 |
16498 } } // namespace v8::internal | 16499 } } // namespace v8::internal |
OLD | NEW |