Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2421)

Unified Diff: runtime/lib/mirrors.cc

Issue 26777002: Test reflecting on an object that implements Function but has no call method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 28ff3522668b67179d8cf639e56f324a8c1f0680..c11ea6142c5a365926b7073528f0543a0b584621 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1425,11 +1425,9 @@ DEFINE_NATIVE_ENTRY(InstanceMirror_computeType, 1) {
}
-DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 3) {
- GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0));
- ASSERT(!closure.IsNull() && closure.IsCallable(NULL, NULL));
- GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(1));
- GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(2));
+DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 2) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(0));
+ GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(1));
const Array& args_descriptor =
Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
@@ -1530,9 +1528,10 @@ DEFINE_NATIVE_ENTRY(ClosureMirror_function, 1) {
Function& function = Function::Handle();
bool callable = closure.IsCallable(&function, NULL);
- ASSERT(callable);
-
- return CreateMethodMirror(function, Instance::null_instance());
+ if (callable) {
+ return CreateMethodMirror(function, Instance::null_instance());
+ }
+ return Instance::null();
}
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698