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 | 5 |
6 #ifdef V8_I18N_SUPPORT | 6 #ifdef V8_I18N_SUPPORT |
7 #include "src/runtime/runtime-utils.h" | 7 #include "src/runtime/runtime-utils.h" |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/api-natives.h" | 10 #include "src/api-natives.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 DCHECK(args.length() == 1); | 253 DCHECK(args.length() == 1); |
254 | 254 |
255 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); | 255 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); |
256 | 256 |
257 if (!input->IsJSObject()) return isolate->heap()->false_value(); | 257 if (!input->IsJSObject()) return isolate->heap()->false_value(); |
258 Handle<JSObject> obj = Handle<JSObject>::cast(input); | 258 Handle<JSObject> obj = Handle<JSObject>::cast(input); |
259 | 259 |
260 Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol(); | 260 Handle<Symbol> marker = isolate->factory()->intl_initialized_marker_symbol(); |
261 Handle<Object> tag = JSReceiver::GetDataProperty(obj, marker); | 261 Handle<Object> tag = JSReceiver::GetDataProperty(obj, marker); |
262 return isolate->heap()->ToBoolean(!tag->IsUndefined()); | 262 return isolate->heap()->ToBoolean(!tag->IsUndefined(isolate)); |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) { | 266 RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) { |
267 HandleScope scope(isolate); | 267 HandleScope scope(isolate); |
268 | 268 |
269 DCHECK(args.length() == 2); | 269 DCHECK(args.length() == 2); |
270 | 270 |
271 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); | 271 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); |
272 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1); | 272 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 if (!input->IsJSObject()) { | 310 if (!input->IsJSObject()) { |
311 THROW_NEW_ERROR_RETURN_FAILURE( | 311 THROW_NEW_ERROR_RETURN_FAILURE( |
312 isolate, NewTypeError(MessageTemplate::kNotIntlObject, input)); | 312 isolate, NewTypeError(MessageTemplate::kNotIntlObject, input)); |
313 } | 313 } |
314 | 314 |
315 Handle<JSObject> obj = Handle<JSObject>::cast(input); | 315 Handle<JSObject> obj = Handle<JSObject>::cast(input); |
316 | 316 |
317 Handle<Symbol> marker = isolate->factory()->intl_impl_object_symbol(); | 317 Handle<Symbol> marker = isolate->factory()->intl_impl_object_symbol(); |
318 | 318 |
319 Handle<Object> impl = JSReceiver::GetDataProperty(obj, marker); | 319 Handle<Object> impl = JSReceiver::GetDataProperty(obj, marker); |
320 if (impl->IsTheHole()) { | 320 if (impl->IsTheHole(isolate)) { |
321 THROW_NEW_ERROR_RETURN_FAILURE( | 321 THROW_NEW_ERROR_RETURN_FAILURE( |
322 isolate, NewTypeError(MessageTemplate::kNotIntlObject, obj)); | 322 isolate, NewTypeError(MessageTemplate::kNotIntlObject, obj)); |
323 } | 323 } |
324 return *impl; | 324 return *impl; |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 RUNTIME_FUNCTION(Runtime_CreateDateTimeFormat) { | 328 RUNTIME_FUNCTION(Runtime_CreateDateTimeFormat) { |
329 HandleScope scope(isolate); | 329 HandleScope scope(isolate); |
330 | 330 |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 Handle<FixedArray> date_cache_version = | 1145 Handle<FixedArray> date_cache_version = |
1146 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( | 1146 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( |
1147 EternalHandles::DATE_CACHE_VERSION)); | 1147 EternalHandles::DATE_CACHE_VERSION)); |
1148 return date_cache_version->get(0); | 1148 return date_cache_version->get(0); |
1149 } | 1149 } |
1150 | 1150 |
1151 } // namespace internal | 1151 } // namespace internal |
1152 } // namespace v8 | 1152 } // namespace v8 |
1153 | 1153 |
1154 #endif // V8_I18N_SUPPORT | 1154 #endif // V8_I18N_SUPPORT |
OLD | NEW |