diff --git a/modules/di/src/reflector.dart b/modules/di/src/reflector.dart index 9b88d9c9a9..0de5ba57b1 100644 --- a/modules/di/src/reflector.dart +++ b/modules/di/src/reflector.dart @@ -6,11 +6,11 @@ import 'key.dart' show Key, Dependency; import 'exceptions.dart' show NoAnnotationError; class Reflector { - factoryFor(Type type) { + Function factoryFor(Type type) { return _generateFactory(type); } - convertToFactory(Function factory) { + Function convertToFactory(Function factory) { return (args) => Function.apply(factory, args); } @@ -22,7 +22,7 @@ class Reflector { return (args) => create(name, args).reflectee; } - dependencies(Type type) { + List dependencies(Type type) { ClassMirror classMirror = reflectType(type); MethodMirror ctor = classMirror.declarations[classMirror.simpleName]; diff --git a/modules/di/test/di/async_spec.js b/modules/di/test/di/async_spec.js index cb7444ba88..2efc8625f3 100644 --- a/modules/di/test/di/async_spec.js +++ b/modules/di/test/di/async_spec.js @@ -34,7 +34,7 @@ export function main () { expect(p).toBeFuture(); }); - it('should return a future when if the binding is sync', function() { + it('should return a future if the binding is sync', function() { var injector = new Injector([ SynchronousUserList ]); @@ -42,10 +42,13 @@ export function main () { expect(p).toBeFuture(); }); - it('should return the injector', function() { + it('should return the injector', function(done) { var injector = new Injector([]); var p = injector.asyncGet(Injector); - expect(p).toBeFuture(); + p.then(function(injector) { + expect(injector).toBe(injector); + done(); + }); }); it('should return a future when instantiating a sync binding ' + diff --git a/modules/facade/src/collection.dart b/modules/facade/src/collection.dart index 151f36d2fa..9b8a179474 100644 --- a/modules/facade/src/collection.dart +++ b/modules/facade/src/collection.dart @@ -30,8 +30,8 @@ class ListWrapper { static last(List list) { return list.last; } - static reversed(List list) { - return list.reversed; + static List reversed(List list) { + return list.reversed.toList(); } static void push(List l, e) { l.add(e); } }