refactor(Async): Unify TS and Dart PromiseCompleter naming
Also add explicit typing wherever we use PromiseCompleter
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
|
||||
import {List, ListWrapper, Map, MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {IMPLEMENTS, Type, isBlank, stringify, isPresent, isArray} from 'angular2/src/facade/lang';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
|
||||
import {Compiler, CompilerCache} from 'angular2/src/core/compiler/compiler';
|
||||
import {AppProtoView} from 'angular2/src/core/compiler/view';
|
||||
@@ -442,7 +442,8 @@ export function main() {
|
||||
|
||||
it('should re-use components being compiled', inject([AsyncTestCompleter], (async) => {
|
||||
tplResolver.setView(MainComponent, new viewAnn.View({template: '<div></div>'}));
|
||||
var renderProtoViewCompleter = PromiseWrapper.completer();
|
||||
var renderProtoViewCompleter: PromiseCompleter<renderApi.ProtoViewDto> =
|
||||
PromiseWrapper.completer();
|
||||
var expectedProtoView = createProtoView();
|
||||
var compiler = createCompiler([renderProtoViewCompleter.promise],
|
||||
[rootProtoView, rootProtoView, expectedProtoView]);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
isInInnerZone
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {PromiseWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||
import {BaseException} from 'angular2/src/facade/lang';
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
|
||||
@@ -65,7 +65,7 @@ export function main() {
|
||||
it('should produce long stack traces', inject([AsyncTestCompleter], (async) => {
|
||||
macroTask(() => {
|
||||
_zone.overrideOnErrorHandler(logError);
|
||||
var c = PromiseWrapper.completer();
|
||||
var c: PromiseCompleter<any> = PromiseWrapper.completer();
|
||||
|
||||
_zone.run(() => {
|
||||
TimerWrapper.setTimeout(() => {
|
||||
@@ -88,7 +88,7 @@ export function main() {
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
macroTask(() => {
|
||||
_zone.overrideOnErrorHandler(logError);
|
||||
var c = PromiseWrapper.completer();
|
||||
var c: PromiseCompleter<any> = PromiseWrapper.completer();
|
||||
|
||||
_zone.run(() => {
|
||||
microTask(() => {
|
||||
@@ -116,7 +116,7 @@ export function main() {
|
||||
it('should disable long stack traces', inject([AsyncTestCompleter], (async) => {
|
||||
macroTask(() => {
|
||||
_zone.overrideOnErrorHandler(logError);
|
||||
var c = PromiseWrapper.completer();
|
||||
var c: PromiseCompleter<any> = PromiseWrapper.completer();
|
||||
|
||||
_zone.run(() => {
|
||||
TimerWrapper.setTimeout(() => {
|
||||
@@ -304,8 +304,8 @@ function commonTests() {
|
||||
|
||||
it('should call onTurnStart and onTurnDone before and after each turn',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var a;
|
||||
var b;
|
||||
var a: PromiseCompleter<string>;
|
||||
var b: PromiseCompleter<string>;
|
||||
|
||||
macroTask(() => {
|
||||
_zone.run(() => {
|
||||
@@ -345,7 +345,7 @@ function commonTests() {
|
||||
|
||||
it('should call onTurnStart and onTurnDone when an inner microtask is scheduled from outside angular',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var completer;
|
||||
var completer: PromiseCompleter<any>;
|
||||
|
||||
macroTask(
|
||||
() => { _zone.runOutsideAngular(() => { completer = PromiseWrapper.completer(); }); });
|
||||
@@ -495,7 +495,8 @@ function commonTests() {
|
||||
|
||||
it('should call onTurnStart and onTurnDone before and after each turn, respectively',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var completerA, completerB;
|
||||
var completerA: PromiseCompleter<any>;
|
||||
var completerB: PromiseCompleter<any>;
|
||||
|
||||
macroTask(() => {
|
||||
_zone.run(() => {
|
||||
|
||||
@@ -19,7 +19,13 @@ import {Injector, bind} from 'angular2/di';
|
||||
import {Component, View} from 'angular2/src/core/annotations/decorators';
|
||||
import * as annotations from 'angular2/src/core/annotations_impl/view';
|
||||
import {CONST, NumberWrapper, isPresent} from 'angular2/src/facade/lang';
|
||||
import {Promise, PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {
|
||||
Promise,
|
||||
PromiseWrapper,
|
||||
PromiseCompleter,
|
||||
EventEmitter,
|
||||
ObservableWrapper
|
||||
} from 'angular2/src/facade/async';
|
||||
|
||||
import {RootRouter} from 'angular2/src/router/router';
|
||||
import {Pipeline} from 'angular2/src/router/pipeline';
|
||||
@@ -42,7 +48,8 @@ import {CanActivate} from 'angular2/src/router/lifecycle_annotations';
|
||||
import {Instruction} from 'angular2/src/router/instruction';
|
||||
import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver';
|
||||
|
||||
var cmpInstanceCount, log, eventBus, completer;
|
||||
var cmpInstanceCount, log, eventBus;
|
||||
var completer: PromiseCompleter<any>;
|
||||
|
||||
export function main() {
|
||||
describe('Outlet Directive', () => {
|
||||
|
||||
Reference in New Issue
Block a user