Chromium Code Reviews| Index: runtime/lib/mirrors.cc |
| =================================================================== |
| --- runtime/lib/mirrors.cc (revision 10017) |
| +++ runtime/lib/mirrors.cc (working copy) |
| @@ -906,6 +906,36 @@ |
| } |
| +void NATIVE_ENTRY_FUNCTION(LocalInterfaceMirrorImpl_invokeConstructor)( |
| + Dart_NativeArguments args) { |
| + Dart_Handle mirror = Dart_GetNativeArgument(args, 0); |
| + Dart_Handle constructor_name = Dart_GetNativeArgument(args, 1); |
| + Dart_Handle raw_invoke_args = Dart_GetNativeArgument(args, 2); |
|
Ivan Posva
2012/07/30 17:03:28
I know that you are following the precedent set in
rmacnak
2012/07/30 17:48:22
For now I switched to 'wrapped_args' to agree with
|
| + |
| + Dart_Handle reflectee = UnwrapMirror(mirror); |
| + GrowableArray<Dart_Handle> invoke_args; |
| + Dart_Handle result = UnwrapArgList(raw_invoke_args, &invoke_args); |
| + if (Dart_IsError(result)) { |
| + Dart_PropagateError(result); |
| + } |
| + result = Dart_New(reflectee, |
| + constructor_name, |
| + invoke_args.length(), |
| + invoke_args.data()); |
| + if (Dart_IsError(result)) { |
| + // Instead of propagating the error from an invoke directly, we |
| + // provide reflective access to the error. |
| + Dart_PropagateError(CreateMirroredError(result)); |
| + } |
| + |
| + Dart_Handle wrapped_result = CreateInstanceMirror(result); |
| + if (Dart_IsError(wrapped_result)) { |
| + Dart_PropagateError(wrapped_result); |
| + } |
| + Dart_SetReturnValue(args, wrapped_result); |
| +} |
| + |
| + |
| void HandleMirrorsMessage(Isolate* isolate, |
| Dart_Port reply_port, |
| const Instance& message) { |