| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 3950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3961 CHECK_CALLBACK_STATE(isolate); | 3961 CHECK_CALLBACK_STATE(isolate); |
| 3962 const Instance& closure_obj = Api::UnwrapInstanceHandle(isolate, closure); | 3962 const Instance& closure_obj = Api::UnwrapInstanceHandle(isolate, closure); |
| 3963 if (closure_obj.IsNull() || !closure_obj.IsCallable(NULL, NULL)) { | 3963 if (closure_obj.IsNull() || !closure_obj.IsCallable(NULL, NULL)) { |
| 3964 RETURN_TYPE_ERROR(isolate, closure, Instance); | 3964 RETURN_TYPE_ERROR(isolate, closure, Instance); |
| 3965 } | 3965 } |
| 3966 if (number_of_arguments < 0) { | 3966 if (number_of_arguments < 0) { |
| 3967 return Api::NewError( | 3967 return Api::NewError( |
| 3968 "%s expects argument 'number_of_arguments' to be non-negative.", | 3968 "%s expects argument 'number_of_arguments' to be non-negative.", |
| 3969 CURRENT_FUNC); | 3969 CURRENT_FUNC); |
| 3970 } | 3970 } |
| 3971 ASSERT(ClassFinalizer::AllClassesFinalized()); | |
| 3972 | 3971 |
| 3973 // Set up arguments to include the closure as the first argument. | 3972 // Set up arguments to include the closure as the first argument. |
| 3974 const Array& args = Array::Handle(isolate, | 3973 const Array& args = Array::Handle(isolate, |
| 3975 Array::New(number_of_arguments + 1)); | 3974 Array::New(number_of_arguments + 1)); |
| 3976 Object& obj = Object::Handle(isolate); | 3975 Object& obj = Object::Handle(isolate); |
| 3977 args.SetAt(0, closure_obj); | 3976 args.SetAt(0, closure_obj); |
| 3978 for (int i = 0; i < number_of_arguments; i++) { | 3977 for (int i = 0; i < number_of_arguments; i++) { |
| 3979 obj = Api::UnwrapHandle(arguments[i]); | 3978 obj = Api::UnwrapHandle(arguments[i]); |
| 3980 if (!obj.IsNull() && !obj.IsInstance()) { | 3979 if (!obj.IsNull() && !obj.IsInstance()) { |
| 3981 RETURN_TYPE_ERROR(isolate, arguments[i], Instance); | 3980 RETURN_TYPE_ERROR(isolate, arguments[i], Instance); |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5387 | 5386 |
| 5388 | 5387 |
| 5389 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5388 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5390 const char* name, | 5389 const char* name, |
| 5391 Dart_ServiceRequestCallback callback, | 5390 Dart_ServiceRequestCallback callback, |
| 5392 void* user_data) { | 5391 void* user_data) { |
| 5393 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5392 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5394 } | 5393 } |
| 5395 | 5394 |
| 5396 } // namespace dart | 5395 } // namespace dart |
| OLD | NEW |