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

Unified Diff: pkg/analyzer/test/reflective_tests.dart

Issue 1607103003: Tweak reflective_tests _invokeSymbolIfExists to not swallow exceptions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/reflective_tests.dart
diff --git a/pkg/analyzer/test/reflective_tests.dart b/pkg/analyzer/test/reflective_tests.dart
index 24c36cb4fbd419dd8fc03faff9452b419c0ab28a..970743db783445e30337dedb20d0db4b9908955f 100644
--- a/pkg/analyzer/test/reflective_tests.dart
+++ b/pkg/analyzer/test/reflective_tests.dart
@@ -73,14 +73,15 @@ void runReflectiveTests(Type type) {
Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
var invocationResult = null;
+ InstanceMirror closure;
try {
- invocationResult = instanceMirror.invoke(symbol, []).reflectee;
+ closure = instanceMirror.getField(symbol);
Jennifer Messerly 2016/01/19 23:53:54 Basically, we get the tearoff: https://api.dartlan
} on NoSuchMethodError {}
- if (invocationResult is Future) {
- return invocationResult;
- } else {
- return new Future.value(invocationResult);
+
+ if (closure is ClosureMirror) {
+ invocationResult = closure.apply([]).reflectee;
}
+ return new Future.value(invocationResult);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698