| 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 16324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16335 Object* JSDate::GetUTCField(FieldIndex index, | 16335 Object* JSDate::GetUTCField(FieldIndex index, |
| 16336 double value, | 16336 double value, |
| 16337 DateCache* date_cache) { | 16337 DateCache* date_cache) { |
| 16338 ASSERT(index >= kFirstUTCField); | 16338 ASSERT(index >= kFirstUTCField); |
| 16339 | 16339 |
| 16340 if (std::isnan(value)) return GetIsolate()->heap()->nan_value(); | 16340 if (std::isnan(value)) return GetIsolate()->heap()->nan_value(); |
| 16341 | 16341 |
| 16342 int64_t time_ms = static_cast<int64_t>(value); | 16342 int64_t time_ms = static_cast<int64_t>(value); |
| 16343 | 16343 |
| 16344 if (index == kTimezoneOffset) { | 16344 if (index == kTimezoneOffset) { |
| 16345 date_cache->CheckTimezone(); | |
| 16346 return Smi::FromInt(date_cache->TimezoneOffset(time_ms)); | 16345 return Smi::FromInt(date_cache->TimezoneOffset(time_ms)); |
| 16347 } | 16346 } |
| 16348 | 16347 |
| 16349 int days = DateCache::DaysFromTime(time_ms); | 16348 int days = DateCache::DaysFromTime(time_ms); |
| 16350 | 16349 |
| 16351 if (index == kWeekdayUTC) return Smi::FromInt(date_cache->Weekday(days)); | 16350 if (index == kWeekdayUTC) return Smi::FromInt(date_cache->Weekday(days)); |
| 16352 | 16351 |
| 16353 if (index <= kDayUTC) { | 16352 if (index <= kDayUTC) { |
| 16354 int year, month, day; | 16353 int year, month, day; |
| 16355 date_cache->YearMonthDayFromDays(days, &year, &month, &day); | 16354 date_cache->YearMonthDayFromDays(days, &year, &month, &day); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16499 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16498 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16500 static const char* error_messages_[] = { | 16499 static const char* error_messages_[] = { |
| 16501 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16500 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16502 }; | 16501 }; |
| 16503 #undef ERROR_MESSAGES_TEXTS | 16502 #undef ERROR_MESSAGES_TEXTS |
| 16504 return error_messages_[reason]; | 16503 return error_messages_[reason]; |
| 16505 } | 16504 } |
| 16506 | 16505 |
| 16507 | 16506 |
| 16508 } } // namespace v8::internal | 16507 } } // namespace v8::internal |
| OLD | NEW |