Skip to content

Commit

Permalink
refactor(reflector): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Oct 7, 2014
1 parent 7d566ad commit 5162b3c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
18 changes: 9 additions & 9 deletions modules/di/test/di/async_spec.js
Expand Up @@ -36,14 +36,22 @@ export function main() {
expect(p).toBeFuture();
});

it('should return a future if the binding is sync', function () {
it('should return a future when the binding is sync', function () {
var injector = new Injector([
SynchronousUserList
]);
var p = injector.asyncGet(SynchronousUserList);
expect(p).toBeFuture();
});

it("should return a future when the binding is sync (from cache)", function () {
var injector = new Injector([
UserList
]);
expect(injector.get(UserList)).toBeAnInstanceOf(UserList);
expect(injector.asyncGet(UserList)).toBeFuture();
});

it('should return the injector', function (done) {
var injector = new Injector([]);
var p = injector.asyncGet(Injector);
Expand All @@ -67,14 +75,6 @@ export function main() {
});
});

it("should return a future when the binding is sync from cache", function () {
var injector = new Injector([
UserList
]);
expect(injector.get(UserList)).toBeAnInstanceOf(UserList);
expect(injector.asyncGet(UserList)).toBeFuture();
});

it("should create only one instance (async + async)", function (done) {
var injector = new Injector([
bind(UserList).toAsyncFactory([], fetchUsers)
Expand Down
12 changes: 3 additions & 9 deletions modules/facade/src/collection.dart
Expand Up @@ -24,15 +24,9 @@ class ListWrapper {
static forEach(list, fn) {
list.forEach(fn);
}
static first(List list) {
return list.first;
}
static last(List list) {
return list.last;
}
static List reversed(List list) {
return list.reversed.toList();
}
static first(List list) => list.first;
static last(List list) => list.last;
static List reversed(List list) => list.reversed.toList();
static void push(List l, e) { l.add(e); }
}

Expand Down
2 changes: 1 addition & 1 deletion modules/facade/src/lang.es6
Expand Up @@ -19,7 +19,7 @@ export function isBlank(obj):bool{
return obj == undefined || obj == null;
}

export function stringify(token) {
export function stringify(token):string {
if (typeof token === 'string') {
return token;
}
Expand Down

0 comments on commit 5162b3c

Please sign in to comment.