| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 } | 2912 } |
| 2913 | 2913 |
| 2914 | 2914 |
| 2915 // --- Native functions --- | 2915 // --- Native functions --- |
| 2916 | 2916 |
| 2917 | 2917 |
| 2918 DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, | 2918 DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, |
| 2919 int index) { | 2919 int index) { |
| 2920 DARTSCOPE(Isolate::Current()); | 2920 DARTSCOPE(Isolate::Current()); |
| 2921 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 2921 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 2922 if (index < 0 || index >= arguments->Count()) { |
| 2923 return Api::NewError( |
| 2924 "%s: argument 'index' out of range. Expected 0..%d but saw %d.", |
| 2925 CURRENT_FUNC, arguments->Count() - 1, index); |
| 2926 } |
| 2922 const Object& obj = Object::Handle(arguments->At(index)); | 2927 const Object& obj = Object::Handle(arguments->At(index)); |
| 2923 return Api::NewLocalHandle(obj); | 2928 return Api::NewLocalHandle(obj); |
| 2924 } | 2929 } |
| 2925 | 2930 |
| 2926 | 2931 |
| 2927 DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args) { | 2932 DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args) { |
| 2928 CHECK_ISOLATE(Isolate::Current()); | 2933 CHECK_ISOLATE(Isolate::Current()); |
| 2929 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 2934 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 2930 return arguments->Count(); | 2935 return arguments->Count(); |
| 2931 } | 2936 } |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 *buffer = NULL; | 3263 *buffer = NULL; |
| 3259 } | 3264 } |
| 3260 delete debug_region; | 3265 delete debug_region; |
| 3261 } else { | 3266 } else { |
| 3262 *buffer = NULL; | 3267 *buffer = NULL; |
| 3263 *buffer_size = 0; | 3268 *buffer_size = 0; |
| 3264 } | 3269 } |
| 3265 } | 3270 } |
| 3266 | 3271 |
| 3267 } // namespace dart | 3272 } // namespace dart |
| OLD | NEW |