|
5 | 5 | isPresent, |
6 | 6 | BaseException, |
7 | 7 | normalizeBlank, |
8 | | - stringify |
| 8 | + stringify, |
| 9 | + isArray, |
| 10 | + isPromise |
9 | 11 | } from 'angular2/src/facade/lang'; |
10 | 12 | import {Promise, PromiseWrapper} from 'angular2/src/facade/async'; |
11 | 13 | import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/facade/collection'; |
@@ -103,8 +105,8 @@ export class Compiler { |
103 | 105 | var componentBinding = this._bindDirective(component); |
104 | 106 | Compiler._assertTypeIsComponent(componentBinding); |
105 | 107 | var pvOrPromise = this._compile(componentBinding); |
106 | | - var pvPromise = PromiseWrapper.isPromise(pvOrPromise) ? <Promise<AppProtoView>>pvOrPromise : |
107 | | - PromiseWrapper.resolve(pvOrPromise); |
| 108 | + var pvPromise = isPromise(pvOrPromise) ? <Promise<AppProtoView>>pvOrPromise : |
| 109 | + PromiseWrapper.resolve(pvOrPromise); |
108 | 110 | return pvPromise.then((appProtoView) => { return new ProtoViewRef(appProtoView); }); |
109 | 111 | } |
110 | 112 |
|
@@ -174,7 +176,7 @@ export class Compiler { |
174 | 176 | var elementBinderDone = |
175 | 177 | (nestedPv: AppProtoView) => { elementBinder.nestedProtoView = nestedPv; }; |
176 | 178 | var nestedCall = this._compile(nestedComponent); |
177 | | - if (PromiseWrapper.isPromise(nestedCall)) { |
| 179 | + if (isPromise(nestedCall)) { |
178 | 180 | ListWrapper.push(nestedPVPromises, |
179 | 181 | (<Promise<AppProtoView>>nestedCall).then(elementBinderDone)); |
180 | 182 | } else if (isPresent(nestedCall)) { |
@@ -239,7 +241,7 @@ export class Compiler { |
239 | 241 | private _flattenList(tree: List<any>, out: List<Type | Binding | List<any>>): void { |
240 | 242 | for (var i = 0; i < tree.length; i++) { |
241 | 243 | var item = resolveForwardRef(tree[i]); |
242 | | - if (ListWrapper.isList(item)) { |
| 244 | + if (isArray(item)) { |
243 | 245 | this._flattenList(item, out); |
244 | 246 | } else { |
245 | 247 | ListWrapper.push(out, item); |
|
0 commit comments