refactor(di): use boolean instead of bool

This commit is contained in:
vsavkin
2014-10-10 14:07:59 -04:00
parent 92b2559109
commit b71cd9f380
8 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
import {FIELD, Type, bool, isBlank} from 'facade/lang';
import {FIELD, Type, isBlank} from 'facade/lang';
import {List, MapWrapper, ListWrapper} from 'facade/collection';
import {reflector} from './reflector';
import {Key} from './key';
@ -7,7 +7,7 @@ export class Dependency {
@FIELD('final key:Key')
@FIELD('final asFuture:bool')
@FIELD('final lazy:bool')
constructor(key:Key, asFuture:bool, lazy:bool) {
constructor(key:Key, asFuture:boolean, lazy:boolean) {
this.key = key;
this.asFuture = asFuture;
this.lazy = lazy;
@ -15,7 +15,7 @@ export class Dependency {
}
export class Binding {
constructor(key:Key, factory:Function, dependencies:List, providedAsFuture:bool) {
constructor(key:Key, factory:Function, dependencies:List, providedAsFuture:boolean) {
this.key = key;
this.factory = factory;
this.dependencies = dependencies;

View File

@ -2,7 +2,7 @@ import {Map, List, MapWrapper, ListWrapper} from 'facade/collection';
import {Binding, BindingBuilder, bind} from './binding';
import {ProviderError, NoProviderError, InvalidBindingError,
AsyncBindingError, CyclicDependencyError, InstantiationError} from './exceptions';
import {Type, isPresent, isBlank, bool} from 'facade/lang';
import {Type, isPresent, isBlank} from 'facade/lang';
import {Future, FutureWrapper} from 'facade/async';
import {Key} from './key';
@ -13,7 +13,7 @@ class _Waiting {
this.future = future;
}
}
function _isWaiting(obj):bool {
function _isWaiting(obj):boolean {
return obj instanceof _Waiting;
}
@ -52,7 +52,7 @@ export class Injector {
return ListWrapper.createFixedSize(Key.numberOfKeys() + 1);
}
_getByKey(key:Key, returnFuture:bool, returnLazy:bool) {
_getByKey(key:Key, returnFuture:boolean, returnLazy:boolean) {
if (returnLazy) {
return () => this._getByKey(key, returnFuture, false);
}
@ -71,7 +71,7 @@ export class Injector {
throw new NoProviderError(key);
}
_resolveDependencies(key:Key, binding:Binding, forceAsync:bool):List {
_resolveDependencies(key:Key, binding:Binding, forceAsync:boolean):List {
try {
var getDependency = d => this._getByKey(d.key, forceAsync || d.asFuture, d.lazy);
return ListWrapper.map(binding.dependencies, getDependency);

View File

@ -1,5 +1,5 @@
import {MapWrapper} from 'facade/collection';
import {FIELD, int, bool} from 'facade/lang';
import {FIELD, int} from 'facade/lang';
var _allKeys = {};
var _id:int = 0;