Skip to content

Commit b71cd9f

Browse files
committed
refactor(di): use boolean instead of bool
1 parent 92b2559 commit b71cd9f

File tree

8 files changed

+15
-16
lines changed

8 files changed

+15
-16
lines changed

modules/change_detection/test/parser/scanner_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {describe, it, expect} from 'test_lib/test_lib';
22
import {Scanner, Token} from 'change_detection/parser/scanner';
33
import {List, ListWrapper} from "facade/collection";
4-
import {StringWrapper} from "facade/lang";
4+
import {StringWrapper, int} from "facade/lang";
55

66
function lex(text:string):List {
77
var scanner:Scanner = new Scanner(text);

modules/core/src/compiler/element_injector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class ProtoElementInjector {
4949
queryKeyId1:int;
5050
5151
textNodes:List<int>;
52-
hasProperties:bool;
52+
hasProperties:boolean;
5353
events:Map<string, Expression>;
5454
5555
elementInjector:ElementInjector;

modules/core/src/compiler/view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Record} from 'change_detection/record';
55
import {Module} from 'di/di';
66
import {ProtoElementInjector, ElementInjector} from './element_injector';
77
import {SetterFn} from 'change_detection/facade';
8-
import {FIELD, IMPLEMENTS} from 'facade/lang';
8+
import {FIELD, IMPLEMENTS, int} from 'facade/lang';
99
import {List} from 'facade/collection';
1010

1111
/***
@@ -61,7 +61,7 @@ export class ProtoView {
6161
module:Module,
6262
protoElementInjector:List<ProtoElementInjector>,
6363
protoWatchGroup:ProtoWatchGroup,
64-
useRootElement:bool)
64+
useRootElement:boolean)
6565
{
6666
this._template = template;
6767
this._module = module;

modules/core/test/compiler/view_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function main() {
3232
spanPI.hasProperties = true;
3333
var protoElementInjector:List<ProtoElementInjector> = [sectionPI, divPI, spanPI];
3434
var protoWatchGroup:ProtoWatchGroup = null;
35-
var hasSingleRoot:bool = false;
35+
var hasSingleRoot:boolean = false;
3636
var pv = new ProtoView(template, module, protoElementInjector, protoWatchGroup, hasSingleRoot);
3737
var view:View = pv.instantiate();
3838
var section:Element = template.content.firstChild;

modules/di/src/binding.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {FIELD, Type, bool, isBlank} from 'facade/lang';
1+
import {FIELD, Type, isBlank} from 'facade/lang';
22
import {List, MapWrapper, ListWrapper} from 'facade/collection';
33
import {reflector} from './reflector';
44
import {Key} from './key';
@@ -7,15 +7,15 @@ export class Dependency {
77
@FIELD('final key:Key')
88
@FIELD('final asFuture:bool')
99
@FIELD('final lazy:bool')
10-
constructor(key:Key, asFuture:bool, lazy:bool) {
10+
constructor(key:Key, asFuture:boolean, lazy:boolean) {
1111
this.key = key;
1212
this.asFuture = asFuture;
1313
this.lazy = lazy;
1414
}
1515
}
1616

1717
export class Binding {
18-
constructor(key:Key, factory:Function, dependencies:List, providedAsFuture:bool) {
18+
constructor(key:Key, factory:Function, dependencies:List, providedAsFuture:boolean) {
1919
this.key = key;
2020
this.factory = factory;
2121
this.dependencies = dependencies;

modules/di/src/injector.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Map, List, MapWrapper, ListWrapper} from 'facade/collection';
22
import {Binding, BindingBuilder, bind} from './binding';
33
import {ProviderError, NoProviderError, InvalidBindingError,
44
AsyncBindingError, CyclicDependencyError, InstantiationError} from './exceptions';
5-
import {Type, isPresent, isBlank, bool} from 'facade/lang';
5+
import {Type, isPresent, isBlank} from 'facade/lang';
66
import {Future, FutureWrapper} from 'facade/async';
77
import {Key} from './key';
88

@@ -13,7 +13,7 @@ class _Waiting {
1313
this.future = future;
1414
}
1515
}
16-
function _isWaiting(obj):bool {
16+
function _isWaiting(obj):boolean {
1717
return obj instanceof _Waiting;
1818
}
1919

@@ -52,7 +52,7 @@ export class Injector {
5252
return ListWrapper.createFixedSize(Key.numberOfKeys() + 1);
5353
}
5454

55-
_getByKey(key:Key, returnFuture:bool, returnLazy:bool) {
55+
_getByKey(key:Key, returnFuture:boolean, returnLazy:boolean) {
5656
if (returnLazy) {
5757
return () => this._getByKey(key, returnFuture, false);
5858
}
@@ -71,7 +71,7 @@ export class Injector {
7171
throw new NoProviderError(key);
7272
}
7373

74-
_resolveDependencies(key:Key, binding:Binding, forceAsync:bool):List {
74+
_resolveDependencies(key:Key, binding:Binding, forceAsync:boolean):List {
7575
try {
7676
var getDependency = d => this._getByKey(d.key, forceAsync || d.asFuture, d.lazy);
7777
return ListWrapper.map(binding.dependencies, getDependency);

modules/di/src/key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {MapWrapper} from 'facade/collection';
2-
import {FIELD, int, bool} from 'facade/lang';
2+
import {FIELD, int} from 'facade/lang';
33

44
var _allKeys = {};
55
var _id:int = 0;

modules/facade/src/lang.es6

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class ABSTRACT {}
1111
export class IMPLEMENTS {}
1212

1313

14-
export function isPresent(obj):bool{
14+
export function isPresent(obj):boolean {
1515
return obj != undefined && obj != null;
1616
}
1717

18-
export function isBlank(obj):bool{
18+
export function isBlank(obj):boolean {
1919
return obj == undefined || obj == null;
2020
}
2121

@@ -104,7 +104,6 @@ export class NumberWrapper {
104104
}
105105

106106
export function int() {};
107-
export var bool = $traceurRuntime.type.boolean;
108107
int.assert = function(value) {
109108
return value == null || typeof value == 'number' && value === Math.floor(value);
110109
}

0 commit comments

Comments
 (0)