style(reflector): formatting

This commit is contained in:
vsavkin 2014-10-07 10:34:07 -04:00
parent 187c4aa33c
commit 7d566adea0
8 changed files with 78 additions and 65 deletions

View File

@ -154,7 +154,6 @@ class _SyncInjectorStrategy {
}
class _AsyncInjectorStrategy {
constructor(injector:Injector) {
this.injector = injector;
@ -229,7 +228,6 @@ class _AsyncInjectorStrategy {
}
function _flattenBindings(bindings:List) {
var res = {};
ListWrapper.forEach(bindings, function (b) {

View File

@ -37,12 +37,16 @@ class Reflector {
if (inject != null) {
return new Dependency(Key.get(inject.token), false, false);
} else if (injectFuture != null) {
return new Dependency(Key.get(injectFuture.token), true, false);
} else if (injectLazy != null) {
return new Dependency(Key.get(injectLazy.token), false, true);
} else if (p.type.qualifiedName != #dynamic) {
return new Dependency(Key.get(p.type.reflectedType), false, false);
} else {
throw new NoAnnotationError(type);
}

View File

@ -2,13 +2,15 @@ import {ddescribe, describe, it, iit, xit, expect, beforeEach} from 'test_lib/te
import {Injector, Inject, InjectFuture, bind, Key} from 'di/di';
import {Future, FutureWrapper} from 'facade/async';
class UserList {}
class UserList {
}
function fetchUsers() {
return FutureWrapper.value(new UserList());
}
class SynchronousUserList {}
class SynchronousUserList {
}
class UserController {
constructor(list:UserList) {
@ -107,7 +109,9 @@ export function main () {
it('should show the full path when error happens in a constructor', function (done) {
var injector = new Injector([
UserController,
bind(UserList).toAsyncFactory([], function(){throw "Broken UserList";})
bind(UserList).toAsyncFactory([], function () {
throw "Broken UserList";
})
]);
var future = injector.asyncGet(UserController);

View File

@ -1,17 +1,24 @@
import {describe, ddescribe, it, iit, expect, beforeEach} from 'test_lib/test_lib';
import {Injector, Inject, InjectLazy, bind} from 'di/di';
class Engine {}
class Engine {
}
class BrokenEngine {
constructor() {
throw "Broken Engine";
}
}
class DashboardSoftware {}
class DashboardSoftware {
}
class Dashboard {
constructor(software: DashboardSoftware) {}
}
class TurboEngine extends Engine{}
class TurboEngine extends Engine {
}
class Car {
constructor(engine:Engine) {