| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/date.h" | 8 #include "src/date.h" |
| 9 #include "src/dateparser-inl.h" | 9 #include "src/dateparser-inl.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 CONVERT_SMI_ARG_CHECKED(index, 1); | 179 CONVERT_SMI_ARG_CHECKED(index, 1); |
| 180 if (!obj->IsJSDate()) { | 180 if (!obj->IsJSDate()) { |
| 181 HandleScope scope(isolate); | 181 HandleScope scope(isolate); |
| 182 THROW_NEW_ERROR_RETURN_FAILURE( | 182 THROW_NEW_ERROR_RETURN_FAILURE( |
| 183 isolate, NewTypeError(MessageTemplate::kNotDateObject)); | 183 isolate, NewTypeError(MessageTemplate::kNotDateObject)); |
| 184 } | 184 } |
| 185 JSDate* date = JSDate::cast(obj); | 185 JSDate* date = JSDate::cast(obj); |
| 186 if (index == 0) return date->value(); | 186 if (index == 0) return date->value(); |
| 187 return JSDate::GetField(date, Smi::FromInt(index)); | 187 return JSDate::GetField(date, Smi::FromInt(index)); |
| 188 } | 188 } |
| 189 } | 189 } // namespace internal |
| 190 } // namespace v8::internal | 190 } // namespace v8 |
| OLD | NEW |