feat: export a proper promise type.
Promise used to be typed as any, giving incorrect results. This change fixes places that were incorrectly typed and re-exports the actual Promise type from es6-promise. It also fixes a series of compilation errors discovered/triggered by this change.
This commit is contained in:
parent
27aa9187f0
commit
861be30021
|
@ -5,7 +5,7 @@ import {global, isPresent} from 'angular2/src/facade/lang';
|
|||
import {List} from 'angular2/src/facade/collection';
|
||||
import * as Rx from 'rx';
|
||||
|
||||
export var Promise = (<any>global).Promise;
|
||||
export {Promise};
|
||||
|
||||
export interface PromiseCompleter<R> {
|
||||
promise: Promise<R>;
|
||||
|
|
|
@ -77,11 +77,13 @@ export function main() {
|
|||
PromiseWrapper.then(one.promise, (_) => {
|
||||
expect(allCalled).toBe(false);
|
||||
two.resolve('two');
|
||||
return null;
|
||||
});
|
||||
|
||||
PromiseWrapper.then(all, (_) => {
|
||||
allCalled = true;
|
||||
async.done();
|
||||
return null;
|
||||
});
|
||||
|
||||
one.resolve('one');
|
||||
|
|
Loading…
Reference in New Issue