From 861be3002199ced154b0a7ac4064111159aeef02 Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Tue, 23 Jun 2015 22:02:20 -0700 Subject: [PATCH] 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. --- modules/angular2/src/facade/async.ts | 2 +- modules/angular2/test/facade/async_spec.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/angular2/src/facade/async.ts b/modules/angular2/src/facade/async.ts index f6ff6ff863..613bff2497 100644 --- a/modules/angular2/src/facade/async.ts +++ b/modules/angular2/src/facade/async.ts @@ -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 = (global).Promise; +export {Promise}; export interface PromiseCompleter { promise: Promise; diff --git a/modules/angular2/test/facade/async_spec.ts b/modules/angular2/test/facade/async_spec.ts index 253384619e..79ac9294c7 100644 --- a/modules/angular2/test/facade/async_spec.ts +++ b/modules/angular2/test/facade/async_spec.ts @@ -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');