From f0870791f60a594202f1c1ec66b635dafd75eb01 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Fri, 10 Oct 2014 10:00:23 -0400 Subject: [PATCH] refactor(di): cleanup to make dartanalyzer happy --- modules/di/src/reflector.dart | 3 ++- modules/di/test/di/injector_spec.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/di/src/reflector.dart b/modules/di/src/reflector.dart index db18c99c7c..bde40d2ff8 100644 --- a/modules/di/src/reflector.dart +++ b/modules/di/src/reflector.dart @@ -56,7 +56,8 @@ class Reflector { } List _functionParameters(Function func) { - return reflect(func).function.parameters; + var closureMirror = reflect(func); + return closureMirror.function.parameters; } List _constructorParameters(Type type) { diff --git a/modules/di/test/di/injector_spec.js b/modules/di/test/di/injector_spec.js index 0aec6acf57..097952a4af 100644 --- a/modules/di/test/di/injector_spec.js +++ b/modules/di/test/di/injector_spec.js @@ -208,7 +208,7 @@ export function main() { bind(Engine).toFactory(() => isBroken ? new BrokenEngine() : new Engine()) ]); - expect(() => injector.get(Car)).toThrow(); + expect(() => injector.get(Car)).toThrowError(new RegExp("Error")); isBroken = false;