refactor(TypeScript): Add noImplicitAny

We automatically insert explicit 'any's where needed. These need to be
addressed as in #9100.

Fixes #4924
This commit is contained in:
ScottSWu 2016-06-08 15:45:15 -07:00
parent 87d824e1b4
commit 86fbd50c3d
305 changed files with 2338 additions and 2337 deletions

View File

@ -144,7 +144,7 @@ export class NgFor implements DoCheck {
viewRef.context.count = ilen;
}
changes.forEachIdentityChange((record) => {
changes.forEachIdentityChange((record: any /** TODO #9100 */) => {
var viewRef = <EmbeddedViewRef<NgForRow>>this._viewContainer.get(record.currentIndex);
viewRef.context.$implicit = record.item;
});

View File

@ -25,7 +25,7 @@ export function main() {
describe('binding to CSS class list', () => {
it('should clean up when the directive is destroyed',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div *ngFor="let item of items" [ngClass]="item"></div>';
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
@ -44,7 +44,7 @@ export function main() {
describe('expressions evaluating to objects', () => {
it('should add classes specified in an object literal',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="{foo: true, bar: false}"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -57,7 +57,7 @@ export function main() {
it('should add classes specified in an object literal without change in class names',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="{'foo-bar': true, 'fooBar': true}"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -69,7 +69,7 @@ export function main() {
}));
it('should add and remove classes based on changes in object literal values',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="{foo: condition, bar: !condition}"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -85,7 +85,7 @@ export function main() {
}));
it('should add and remove classes based on changes to the expression object',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -107,7 +107,7 @@ export function main() {
}));
it('should add and remove classes based on reference changes to the expression object',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -126,7 +126,7 @@ export function main() {
}));
it('should remove active classes when expression evaluates to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -146,7 +146,7 @@ export function main() {
it('should allow multiple classes per expression',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -171,7 +171,7 @@ export function main() {
}));
it('should split by one or more spaces between classes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -190,7 +190,7 @@ export function main() {
describe('expressions evaluating to lists', () => {
it('should add classes specified in a list literal',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="['foo', 'bar', 'foo-bar', 'fooBar']"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -202,7 +202,7 @@ export function main() {
}));
it('should add and remove classes based on changes to the expression',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -225,7 +225,7 @@ export function main() {
}));
it('should add and remove classes when a reference changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -241,7 +241,7 @@ export function main() {
}));
it('should take initial classes into account when a reference changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div class="foo" [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -257,7 +257,7 @@ export function main() {
}));
it('should ignore empty or blank class names',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div class="foo" [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -272,7 +272,7 @@ export function main() {
}));
it('should trim blanks from class names',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div class="foo" [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -288,7 +288,7 @@ export function main() {
it('should allow multiple classes per item in arrays',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="arrExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -310,7 +310,7 @@ export function main() {
describe('expressions evaluating to sets', () => {
it('should add and remove classes if the set instance changed',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="setExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -333,7 +333,7 @@ export function main() {
describe('expressions evaluating to string', () => {
it('should add classes specified in a string literal',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="'foo bar foo-bar fooBar'"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -345,7 +345,7 @@ export function main() {
}));
it('should add and remove classes based on changes to the expression',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="strExpr"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -365,7 +365,7 @@ export function main() {
}));
it('should remove active classes when switching from string to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="strExpr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -381,7 +381,7 @@ export function main() {
}));
it('should take initial classes into account when switching from string to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div class="foo" [ngClass]="strExpr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -397,7 +397,7 @@ export function main() {
}));
it('should ignore empty and blank strings',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div class="foo" [ngClass]="strExpr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -415,7 +415,7 @@ export function main() {
describe('cooperation with other class-changing constructs', () => {
it('should co-operate with the class attribute',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div [ngClass]="objExpr" class="init foo"></div>';
tcb.overrideTemplate(TestComponent, template)
@ -435,7 +435,7 @@ export function main() {
}));
it('should co-operate with the interpolated class attribute',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="objExpr" class="{{'init foo'}}"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -455,7 +455,7 @@ export function main() {
}));
it('should co-operate with the class attribute and binding to it',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngClass]="objExpr" class="init" [class]="'foo'"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -475,7 +475,7 @@ export function main() {
}));
it('should co-operate with the class attribute and class.name binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div class="init foo" [ngClass]="objExpr" [class.baz]="condition"></div>';
@ -498,7 +498,7 @@ export function main() {
}));
it('should co-operate with initial class and class attribute binding when binding changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div class="init" [ngClass]="objExpr" [class]="strExpr"></div>';
tcb.overrideTemplate(TestComponent, template)

View File

@ -25,7 +25,7 @@ export function main() {
'<div><copy-me template="ngFor let item of items">{{item.toString()}};</copy-me></div>';
it('should reflect initial elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -36,7 +36,7 @@ export function main() {
}));
it('should reflect added elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -51,7 +51,7 @@ export function main() {
}));
it('should reflect removed elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -66,7 +66,7 @@ export function main() {
}));
it('should reflect moved elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -82,7 +82,7 @@ export function main() {
}));
it('should reflect a mix of all changes (additions/removals/moves)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -98,7 +98,7 @@ export function main() {
}));
it('should iterate over an array of objects',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<ul><li template="ngFor let item of items">{{item["name"]}};</li></ul>';
tcb.overrideTemplate(TestComponent, template)
@ -128,7 +128,7 @@ export function main() {
}));
it('should gracefully handle nulls',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<ul><li template="ngFor let item of null">{{item}};</li></ul>';
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
@ -140,7 +140,7 @@ export function main() {
}));
it('should gracefully handle ref changing to null and back',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -160,7 +160,7 @@ export function main() {
if (!IS_DART) {
it('should throw on non-iterable ref and suggest using an array',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -177,7 +177,7 @@ export function main() {
}
it('should throw on ref changing to string',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -191,7 +191,7 @@ export function main() {
}));
it('should works with duplicates',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, TEMPLATE)
.createAsync(TestComponent)
.then((fixture) => {
@ -204,7 +204,7 @@ export function main() {
}));
it('should repeat over nested arrays',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<div template="ngFor let item of items">' +
'<div template="ngFor let subitem of item">' +
@ -231,7 +231,7 @@ export function main() {
}));
it('should repeat over nested arrays with no intermediate element',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div><template ngFor let-item [ngForOf]="items">' +
'<div template="ngFor let subitem of item">' +
'{{subitem}}-{{item.length}};' +
@ -252,7 +252,7 @@ export function main() {
}));
it('should repeat over nested ngIf that are the last node in the ngFor temlate',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<div><template ngFor let-item [ngForOf]="items" let-i="index"><div>{{i}}|</div>` +
`<div *ngIf="i % 2 == 0">even|</div></template></div>`;
@ -279,7 +279,7 @@ export function main() {
}));
it('should display indices correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div><copy-me template="ngFor: let item of items; let i=index">{{i.toString()}}</copy-me></div>';
@ -298,7 +298,7 @@ export function main() {
}));
it('should display first item correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div><copy-me template="ngFor: let item of items; let isFirst=first">{{isFirst.toString()}}</copy-me></div>';
@ -317,7 +317,7 @@ export function main() {
}));
it('should display last item correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div><copy-me template="ngFor: let item of items; let isLast=last">{{isLast.toString()}}</copy-me></div>';
@ -336,7 +336,7 @@ export function main() {
}));
it('should display even items correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div><copy-me template="ngFor: let item of items; let isEven=even">{{isEven.toString()}}</copy-me></div>';
@ -355,7 +355,7 @@ export function main() {
}));
it('should display odd items correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div><copy-me template="ngFor: let item of items; let isOdd=odd">{{isOdd.toString()}}</copy-me></div>';
@ -374,7 +374,7 @@ export function main() {
}));
it('should allow to use a custom template',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(
TestComponent,
'<ul><template ngFor [ngForOf]="items" [ngForTemplate]="contentTpl"></template></ul>')
@ -393,7 +393,7 @@ export function main() {
}));
it('should use a default template if a custom one is null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, `<ul><template ngFor let-item [ngForOf]="items"
[ngForTemplate]="contentTpl" let-i="index">{{i}}: {{item}};</template></ul>`)
.overrideTemplate(ComponentUsingTestComponent, '<test-cmp></test-cmp>')
@ -409,7 +409,7 @@ export function main() {
}));
it('should use a custom template when both default and a custom one are present',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(TestComponent, `<ul><template ngFor let-item [ngForOf]="items"
[ngForTemplate]="contentTpl" let-i="index">{{i}}=> {{item}};</template></ul>`)
.overrideTemplate(
@ -428,7 +428,7 @@ export function main() {
describe('track by', function() {
it('should not replace tracked items',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<template ngFor let-item [ngForOf]="items" [ngForTrackBy]="trackById" let-i="index">
<p>{{items[i]}}</p>
@ -450,7 +450,7 @@ export function main() {
});
}));
it('should update implicit local variable on view',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<div><template ngFor let-item [ngForOf]="items" [ngForTrackBy]="trackById">{{item['color']}}</template></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -466,7 +466,7 @@ export function main() {
});
}));
it('should move items around and keep them updated ',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<div><template ngFor let-item [ngForOf]="items" [ngForTrackBy]="trackById">{{item['color']}}</template></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -485,7 +485,7 @@ export function main() {
}));
it('should handle added and removed items properly when tracking by index',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<div><template ngFor let-item [ngForOf]="items" [ngForTrackBy]="trackByIndex">{{item}}</template></div>`;
tcb.overrideTemplate(TestComponent, template)

View File

@ -21,7 +21,7 @@ import {IS_DART} from '../../src/facade/lang';
export function main() {
describe('ngIf directive', () => {
it('should work in a template attribute',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html = '<div><copy-me template="ngIf booleanCondition">hello</copy-me></div>';
tcb.overrideTemplate(TestComponent, html)
@ -37,7 +37,7 @@ export function main() {
}));
it('should work in a template element',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html =
'<div><template [ngIf]="booleanCondition"><copy-me>hello2</copy-me></template></div>';
@ -54,7 +54,7 @@ export function main() {
}));
it('should toggle node when condition changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html = '<div><copy-me template="ngIf booleanCondition">hello</copy-me></div>';
tcb.overrideTemplate(TestComponent, html)
@ -86,7 +86,7 @@ export function main() {
}));
it('should handle nested if correctly',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html =
'<div><template [ngIf]="booleanCondition"><copy-me *ngIf="nestedBooleanCondition">hello</copy-me></template></div>';
@ -133,7 +133,7 @@ export function main() {
}));
it('should update several nodes with if',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html =
'<div>' +
'<copy-me template="ngIf numberCondition + 1 >= 2">helloNumber</copy-me>' +
@ -172,7 +172,7 @@ export function main() {
if (!IS_DART) {
it('should not add the element twice if the condition goes from true to true (JS)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html = '<div><copy-me template="ngIf numberCondition">hello</copy-me></div>';
tcb.overrideTemplate(TestComponent, html)
@ -198,7 +198,7 @@ export function main() {
}));
it('should not recreate the element if the condition goes from true to true (JS)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html = '<div><copy-me template="ngIf numberCondition">hello</copy-me></div>';
tcb.overrideTemplate(TestComponent, html)
@ -222,7 +222,7 @@ export function main() {
if (IS_DART) {
it('should not create the element if the condition is not a boolean (DART)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var html = '<div><copy-me template="ngIf numberCondition">hello</copy-me></div>';
tcb.overrideTemplate(TestComponent, html)
@ -254,6 +254,6 @@ class TestComponent {
this.nestedBooleanCondition = true;
this.numberCondition = 1;
this.stringCondition = "foo";
this.functionCondition = function(s, n) { return s == "foo" && n == 1; };
this.functionCondition = function(s: any /** TODO #9100 */, n: any /** TODO #9100 */) { return s == "foo" && n == 1; };
}
}

View File

@ -20,7 +20,7 @@ export function main() {
beforeEachProviders(() => [{provide: NgLocalization, useClass: TestLocalizationMap}]);
it('should display the template according to the exact value',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<ul [ngPlural]="switchValue">' +
'<template ngPluralCase="=0"><li>you have no messages.</li></template>' +
@ -43,7 +43,7 @@ export function main() {
}));
it('should display the template according to the category',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div>' +
'<ul [ngPlural]="switchValue">' +
@ -67,7 +67,7 @@ export function main() {
}));
it('should default to other when no matches are found',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div>' +
'<ul [ngPlural]="switchValue">' +
@ -87,7 +87,7 @@ export function main() {
}));
it('should prioritize value matches over category matches',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div>' +
'<ul [ngPlural]="switchValue">' +

View File

@ -24,7 +24,7 @@ export function main() {
describe('binding to CSS styles', () => {
it('should add styles specified in an object literal',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngStyle]="{'max-width': '40px'}"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -40,7 +40,7 @@ export function main() {
}));
it('should add and change styles specified in an object expression',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngStyle]="expr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -55,7 +55,7 @@ export function main() {
.toEqual('40px');
expr = fixture.debugElement.componentInstance.expr;
expr['max-width'] = '30%';
(expr as any /** TODO #9100 */)['max-width'] = '30%';
fixture.detectChanges();
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
@ -66,7 +66,7 @@ export function main() {
}));
it('should remove styles when deleting a key in an object expression',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [ngStyle]="expr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -89,7 +89,7 @@ export function main() {
}));
it('should co-operate with the style attribute',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div style="font-size: 12px" [ngStyle]="expr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -118,7 +118,7 @@ export function main() {
}));
it('should co-operate with the style.[styleName]="expr" special-case in the compiler',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<div [style.font-size.px]="12" [ngStyle]="expr"></div>`;
tcb.overrideTemplate(TestComponent, template)
@ -151,5 +151,5 @@ export function main() {
@Component({selector: 'test-cmp', directives: [NgStyle], template: ''})
class TestComponent {
expr;
expr: any /** TODO #9100 */;
}

View File

@ -18,7 +18,7 @@ export function main() {
describe('switch', () => {
describe('switch value changes', () => {
it('should switch amongst when values',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<ul [ngSwitch]="switchValue">' +
'<template ngSwitchWhen="a"><li>when a</li></template>' +
@ -44,7 +44,7 @@ export function main() {
}));
it('should switch amongst when values with fallback to default',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<ul [ngSwitch]="switchValue">' +
'<li template="ngSwitchWhen \'a\'">when a</li>' +
@ -70,7 +70,7 @@ export function main() {
}));
it('should support multiple whens with the same value',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<ul [ngSwitch]="switchValue">' +
'<template ngSwitchWhen="a"><li>when a1;</li></template>' +
@ -103,7 +103,7 @@ export function main() {
describe('when values changes', () => {
it('should switch amongst when values',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>' +
'<ul [ngSwitch]="switchValue">' +
'<template [ngSwitchWhen]="when1"><li>when 1;</li></template>' +

View File

@ -16,7 +16,7 @@ import {NgTemplateOutlet} from '@angular/common';
export function main() {
describe('insert', () => {
it('should do nothing if templateRef is null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<template [ngTemplateOutlet]="null"></template>`;
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
@ -30,7 +30,7 @@ export function main() {
}));
it('should insert content specified by TemplateRef',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<tpl-refs #refs="tplRefs"><template>foo</template></tpl-refs><template [ngTemplateOutlet]="currentTplRef"></template>`;
tcb.overrideTemplate(TestComponent, template)
@ -51,7 +51,7 @@ export function main() {
}));
it('should clear content if TemplateRef becomes null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
`<tpl-refs #refs="tplRefs"><template>foo</template></tpl-refs><template [ngTemplateOutlet]="currentTplRef"></template>`;
tcb.overrideTemplate(TestComponent, template)
@ -74,7 +74,7 @@ export function main() {
}));
it('should swap content if TemplateRef changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = `<tpl-refs #refs="tplRefs"><template>foo</template><template>bar</template></tpl-refs><template [ngTemplateOutlet]="currentTplRef"></template>`;
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)

View File

@ -17,7 +17,7 @@ import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
export function main() {
describe('non-bindable', () => {
it('should not interpolate children',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div>{{text}}<span ngNonBindable>{{text}}</span></div>';
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
@ -29,7 +29,7 @@ export function main() {
}));
it('should ignore directives on child nodes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div ngNonBindable><span id=child test-dec>{{text}}</span></div>';
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
@ -45,7 +45,7 @@ export function main() {
}));
it('should trigger directives on the same node',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div><span id=child ngNonBindable test-dec>{{text}}</span></div>';
tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)

View File

@ -44,10 +44,10 @@ import {PromiseWrapper} from '../../src/facade/promise';
import {SimpleChange} from '@angular/core/src/change_detection';
class DummyControlValueAccessor implements ControlValueAccessor {
writtenValue;
writtenValue: any /** TODO #9100 */;
registerOnChange(fn) {}
registerOnTouched(fn) {}
registerOnChange(fn: any /** TODO #9100 */) {}
registerOnTouched(fn: any /** TODO #9100 */) {}
writeValue(obj: any): void { this.writtenValue = obj; }
}
@ -56,8 +56,8 @@ class CustomValidatorDirective implements Validator {
validate(c: Control): {[key: string]: any} { return {"custom": true}; }
}
function asyncValidator(expected, timeout = 0) {
return (c) => {
function asyncValidator(expected: any /** TODO #9100 */, timeout = 0) {
return (c: any /** TODO #9100 */) => {
var completer = PromiseWrapper.completer();
var res = c.value != expected ? {"async": true} : null;
if (timeout == 0) {
@ -120,14 +120,14 @@ export function main() {
describe("composeValidators", () => {
it("should compose functions", () => {
var dummy1 = (_) => ({"dummy1": true});
var dummy2 = (_) => ({"dummy2": true});
var dummy1 = (_: any /** TODO #9100 */) => ({"dummy1": true});
var dummy2 = (_: any /** TODO #9100 */) => ({"dummy2": true});
var v = composeValidators([dummy1, dummy2]);
expect(v(new Control(""))).toEqual({"dummy1": true, "dummy2": true});
});
it("should compose validator directives", () => {
var dummy1 = (_) => ({"dummy1": true});
var dummy1 = (_: any /** TODO #9100 */) => ({"dummy1": true});
var v = composeValidators([dummy1, new CustomValidatorDirective()]);
expect(v(new Control(""))).toEqual({"dummy1": true, "custom": true});
});
@ -135,9 +135,9 @@ export function main() {
});
describe("NgFormModel", () => {
var form;
var form: any /** TODO #9100 */;
var formModel: ControlGroup;
var loginControlDir;
var loginControlDir: any /** TODO #9100 */;
beforeEach(() => {
form = new NgFormModel([], []);
@ -215,7 +215,7 @@ export function main() {
});
describe("addControlGroup", () => {
var matchingPasswordsValidator = (g) => {
var matchingPasswordsValidator = (g: any /** TODO #9100 */) => {
if (g.controls["password"].value != g.controls["passwordConfirm"].value) {
return {"differentPasswords": true};
} else {
@ -268,7 +268,7 @@ export function main() {
});
it("should set up a sync validator", () => {
var formValidator = (c) => ({"custom": true});
var formValidator = (c: any /** TODO #9100 */) => ({"custom": true});
var f = new NgFormModel([formValidator], []);
f.form = formModel;
f.ngOnChanges({"form": new SimpleChange(null, null)});
@ -289,10 +289,10 @@ export function main() {
});
describe("NgForm", () => {
var form;
var form: any /** TODO #9100 */;
var formModel: ControlGroup;
var loginControlDir;
var personControlGroupDir;
var loginControlDir: any /** TODO #9100 */;
var personControlGroupDir: any /** TODO #9100 */;
beforeEach(() => {
form = new NgForm([], []);
@ -348,7 +348,7 @@ export function main() {
});
it("should set up sync validator", fakeAsync(() => {
var formValidator = (c) => ({"custom": true});
var formValidator = (c: any /** TODO #9100 */) => ({"custom": true});
var f = new NgForm([formValidator], []);
tick();
@ -366,8 +366,8 @@ export function main() {
});
describe("NgControlGroup", () => {
var formModel;
var controlGroupDir;
var formModel: any /** TODO #9100 */;
var controlGroupDir: any /** TODO #9100 */;
beforeEach(() => {
formModel = new ControlGroup({"login": new Control(null)});
@ -391,9 +391,9 @@ export function main() {
});
describe("NgFormControl", () => {
var controlDir;
var control;
var checkProperties = function(control) {
var controlDir: any /** TODO #9100 */;
var control: any /** TODO #9100 */;
var checkProperties = function(control: any /** TODO #9100 */) {
expect(controlDir.control).toBe(control);
expect(controlDir.value).toBe(control.value);
expect(controlDir.valid).toBe(control.valid);
@ -433,7 +433,7 @@ export function main() {
});
describe("NgModel", () => {
var ngModel;
var ngModel: any /** TODO #9100 */;
beforeEach(() => {
ngModel =
@ -468,8 +468,8 @@ export function main() {
});
describe("NgControlName", () => {
var formModel;
var controlNameDir;
var formModel: any /** TODO #9100 */;
var controlNameDir: any /** TODO #9100 */;
beforeEach(() => {
formModel = new Control("name");

View File

@ -12,11 +12,11 @@ import {Control, FormBuilder} from '@angular/common';
import {PromiseWrapper} from '../../src/facade/promise';
export function main() {
function syncValidator(_) { return null; }
function asyncValidator(_) { return PromiseWrapper.resolve(null); }
function syncValidator(_: any /** TODO #9100 */): any /** TODO #9100 */ { return null; }
function asyncValidator(_: any /** TODO #9100 */) { return PromiseWrapper.resolve(null); }
describe("Form Builder", () => {
var b;
var b: any /** TODO #9100 */;
beforeEach(() => { b = new FormBuilder(); });

View File

@ -41,7 +41,7 @@ export function main() {
describe("integration tests", () => {
it("should initialize DOM elements with the given form object",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
@ -60,7 +60,7 @@ export function main() {
}));
it("should throw if a form isn't passed into ngFormModel",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
@ -75,7 +75,7 @@ export function main() {
}));
it("should update the control group values on DOM change",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup({"login": new Control("oldValue")});
var t = `<div [ngFormModel]="form">
@ -98,7 +98,7 @@ export function main() {
}));
it("should ignore the change event for <input type=text>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup({"login": new Control("oldValue")});
var t = `<div [ngFormModel]="form">
@ -194,7 +194,7 @@ export function main() {
})));
it("should work with single controls",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var control = new Control("loginValue");
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
@ -217,7 +217,7 @@ export function main() {
}));
it("should update DOM elements when rebinding the control group",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="login">
</div>`;
@ -240,7 +240,7 @@ export function main() {
}));
it("should update DOM elements when updating the value of a control",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var login = new Control("oldValue");
var form = new ControlGroup({"login": login});
@ -265,7 +265,7 @@ export function main() {
}));
it("should mark controls as touched after interacting with the DOM control",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var login = new Control("oldValue");
var form = new ControlGroup({"login": login});
@ -292,7 +292,7 @@ export function main() {
describe("different control types", () => {
it("should support <input type=text>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="text">
</div>`;
@ -316,7 +316,7 @@ export function main() {
}));
it("should support <input> without type",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input ngControl="text">
</div>`;
@ -339,7 +339,7 @@ export function main() {
}));
it("should support <textarea>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<textarea ngControl="text"></textarea>
</div>`;
@ -363,7 +363,7 @@ export function main() {
}));
it("should support <type=checkbox>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="checkbox" ngControl="checkbox">
</div>`;
@ -388,7 +388,7 @@ export function main() {
}));
it("should support <type=number>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="number" ngControl="num">
</div>`;
@ -412,7 +412,7 @@ export function main() {
}));
it("should support <type=number> when value is cleared in the UI",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="number" ngControl="num" required>
</div>`;
@ -442,7 +442,7 @@ export function main() {
it("should support <type=number> when value is cleared programmatically",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup({"num": new Control(10)});
var t = `<div [ngFormModel]="form">
<input type="number" ngControl="num" [(ngModel)]="data">
@ -463,7 +463,7 @@ export function main() {
}));
it("should support <type=radio>",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<form [ngFormModel]="form">
<input type="radio" ngControl="foodChicken" name="food">
<input type="radio" ngControl="foodFish" name="food">
@ -494,7 +494,7 @@ export function main() {
describe("should support <select>", () => {
it("with basic selection",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<select>
<option value="SF"></option>
<option value="NYC"></option>
@ -516,7 +516,7 @@ export function main() {
it("with basic selection and value bindings",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<select>
<option *ngFor="let city of list" [value]="city['id']">
{{ city['name'] }}
@ -542,7 +542,7 @@ export function main() {
it("with ngControl",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<select ngControl="city">
<option value="SF"></option>
@ -582,7 +582,7 @@ export function main() {
</select>
</div>`;
var fixture;
var fixture: any /** TODO #9100 */;
tcb.overrideTemplate(MyComp8, t)
.createAsync(MyComp8)
.then((compFixture) => fixture = compFixture);
@ -601,7 +601,7 @@ export function main() {
it("with option values that are objects",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c['name']}}</option>
@ -635,7 +635,7 @@ export function main() {
it("when new options are added (selection through the model)",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c['name']}}</option>
@ -665,7 +665,7 @@ export function main() {
it("when new options are added (selection through the UI)",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c['name']}}</option>
@ -698,7 +698,7 @@ export function main() {
it("when options are removed",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c}}</option>
@ -726,7 +726,7 @@ export function main() {
it("when option values change identity while tracking by index",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list; trackBy:customTrackBy" [ngValue]="c">{{c}}</option>
@ -758,7 +758,7 @@ export function main() {
it("with duplicate option values",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c}}</option>
@ -789,7 +789,7 @@ export function main() {
it("when option values have same content, but different identities",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div>
<select [(ngModel)]="selectedCity">
<option *ngFor="let c of list" [ngValue]="c">{{c['name']}}</option>
@ -819,7 +819,7 @@ export function main() {
});
it("should support custom value accessors",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<input type="text" ngControl="name" wrapped-value>
</div>`;
@ -842,7 +842,7 @@ export function main() {
}));
it("should support custom value accessors on non builtin input elements that fire a change event without a 'target' property",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div [ngFormModel]="form">
<my-input ngControl="name"></my-input>
</div>`;
@ -870,7 +870,7 @@ export function main() {
describe("validations", () => {
it("should use sync validators defined in html",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup(
{"login": new Control(""), "min": new Control(""), "max": new Control("")});
@ -924,7 +924,7 @@ export function main() {
<input type="text" ngControl="login" uniq-login-validator="expected">
</div>`;
var rootTC;
var rootTC: any /** TODO #9100 */;
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((root) => rootTC = root);
tick();
@ -946,7 +946,7 @@ export function main() {
})));
it("should use sync validators defined in the model",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup({"login": new Control("aa", Validators.required)});
var t = `<div [ngFormModel]="form">
@ -979,7 +979,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
var fixture;
var fixture: any /** TODO #9100 */;
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((root) => fixture = root);
tick();
@ -1007,7 +1007,7 @@ export function main() {
describe("nested forms", () => {
it("should init DOM with the given form object",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form =
new ControlGroup({"nested": new ControlGroup({"login": new Control("value")})});
@ -1030,7 +1030,7 @@ export function main() {
}));
it("should update the control group values on DOM change",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form =
new ControlGroup({"nested": new ControlGroup({"login": new Control("value")})});
@ -1141,7 +1141,7 @@ export function main() {
})));
it("should not create a template-driven form when ngNoForm is used",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<form ngNoForm>
</form>`;
@ -1322,7 +1322,7 @@ export function main() {
describe("setting status classes", () => {
it("should work with single fields",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new Control("", Validators.required);
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
@ -1353,7 +1353,7 @@ export function main() {
}));
it("should work with complex model-driven forms",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var form = new ControlGroup({"name": new Control("", Validators.required)});
var t = `<form [ngFormModel]="form"><input type="text" ngControl="name"></form>`;
@ -1384,7 +1384,7 @@ export function main() {
}));
it("should work with ngModel",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var t = `<div><input [(ngModel)]="name" required></div>`;
tcb.overrideTemplate(MyComp8, t)
@ -1486,17 +1486,17 @@ export function main() {
host: {'(input)': 'handleOnInput($event.target.value)', '[value]': 'value'}
})
class WrappedValue implements ControlValueAccessor {
value;
value: any /** TODO #9100 */;
onChange: Function;
constructor(cd: NgControl) { cd.valueAccessor = this; }
writeValue(value) { this.value = `!${value}!`; }
writeValue(value: any /** TODO #9100 */) { this.value = `!${value}!`; }
registerOnChange(fn) { this.onChange = fn; }
registerOnTouched(fn) {}
registerOnChange(fn: any /** TODO #9100 */) { this.onChange = fn; }
registerOnTouched(fn: any /** TODO #9100 */) {}
handleOnInput(value) { this.onChange(value.substring(1, value.length - 1)); }
handleOnInput(value: any /** TODO #9100 */) { this.onChange(value.substring(1, value.length - 1)); }
}
@Component({selector: "my-input", template: ''})
@ -1506,11 +1506,11 @@ class MyInput implements ControlValueAccessor {
constructor(cd: NgControl) { cd.valueAccessor = this; }
writeValue(value) { this.value = `!${value}!`; }
writeValue(value: any /** TODO #9100 */) { this.value = `!${value}!`; }
registerOnChange(fn) { ObservableWrapper.subscribe(this.onInput, fn); }
registerOnChange(fn: any /** TODO #9100 */) { ObservableWrapper.subscribe(this.onInput, fn); }
registerOnTouched(fn) {}
registerOnTouched(fn: any /** TODO #9100 */) {}
dispatchChangeEvent() {
ObservableWrapper.callEmit(this.onInput, this.value.substring(1, this.value.length - 1));
@ -1518,7 +1518,7 @@ class MyInput implements ControlValueAccessor {
}
function uniqLoginAsyncValidator(expectedValue: string) {
return (c) => {
return (c: any /** TODO #9100 */) => {
var completer = PromiseWrapper.completer();
var res = (c.value == expectedValue) ? null : {"uniqLogin": true};
completer.resolve(res);
@ -1550,9 +1550,9 @@ class LoginIsEmptyValidator {
]
})
class UniqLoginValidator implements Validator {
@Input('uniq-login-validator') expected;
@Input('uniq-login-validator') expected: any /** TODO #9100 */;
validate(c) { return uniqLoginAsyncValidator(this.expected)(c); }
validate(c: any /** TODO #9100 */) { return uniqLoginAsyncValidator(this.expected)(c); }
}
@Component({
@ -1577,7 +1577,7 @@ class MyComp8 {
customTrackBy(index: number, obj: any): number { return index; };
}
function sortedClassList(el) {
function sortedClassList(el: any /** TODO #9100 */) {
var l = getDOM().classList(el);
ListWrapper.sort(l);
return l;

View File

@ -17,10 +17,10 @@ import {PromiseWrapper} from '../../src/facade/promise';
import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async';
export function main() {
function asyncValidator(expected, timeouts = /*@ts2dart_const*/ {}) {
return (c) => {
function asyncValidator(expected: any /** TODO #9100 */, timeouts = /*@ts2dart_const*/ {}) {
return (c: any /** TODO #9100 */) => {
var completer = PromiseWrapper.completer();
var t = isPresent(timeouts[c.value]) ? timeouts[c.value] : 0;
var t = isPresent((timeouts as any /** TODO #9100 */)[c.value]) ? (timeouts as any /** TODO #9100 */)[c.value] : 0;
var res = c.value != expected ? {"async": true} : null;
if (t == 0) {
@ -33,7 +33,7 @@ export function main() {
};
}
function asyncValidatorReturningObservable(c) {
function asyncValidatorReturningObservable(c: any /** TODO #9100 */) {
var e = new EventEmitter();
PromiseWrapper.scheduleMicrotask(() => ObservableWrapper.callEmit(e, {"async": true}));
return e;
@ -140,7 +140,7 @@ export function main() {
});
describe("updateValue", () => {
var g, c;
var g: any /** TODO #9100 */, c: any /** TODO #9100 */;
beforeEach(() => {
c = new Control("oldValue");
g = new ControlGroup({"one": c});
@ -152,8 +152,8 @@ export function main() {
});
it("should invoke ngOnChanges if it is present", () => {
var ngOnChanges;
c.registerOnChange((v) => ngOnChanges = ["invoked", v]);
var ngOnChanges: any /** TODO #9100 */;
c.registerOnChange((v: any /** TODO #9100 */) => ngOnChanges = ["invoked", v]);
c.updateValue("newValue");
@ -161,8 +161,8 @@ export function main() {
});
it("should not invoke on change when explicitly specified", () => {
var onChange = null;
c.registerOnChange((v) => onChange = ["invoked", v]);
var onChange: any /** TODO #9100 */ = null;
c.registerOnChange((v: any /** TODO #9100 */) => onChange = ["invoked", v]);
c.updateValue("newValue", {emitModelToViewChange: false});
@ -197,12 +197,12 @@ export function main() {
});
describe("valueChanges & statusChanges", () => {
var c;
var c: any /** TODO #9100 */;
beforeEach(() => { c = new Control("old", Validators.required); });
it("should fire an event after the value has been updated",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
ObservableWrapper.subscribe(c.valueChanges, (value) => {
expect(c.value).toEqual('new');
expect(value).toEqual('new');
@ -224,7 +224,7 @@ export function main() {
it("should fire an event after the status has been updated to pending", fakeAsync(() => {
var c = new Control("old", Validators.required, asyncValidator("expected"));
var log = [];
var log: any[] /** TODO #9100 */ = [];
ObservableWrapper.subscribe(c.valueChanges, (value) => log.push(`value: '${value}'`));
ObservableWrapper.subscribe(c.statusChanges,
(status) => log.push(`status: '${status}'`));
@ -253,8 +253,8 @@ export function main() {
// TODO: remove the if statement after making observable delivery sync
if (!IS_DART) {
it("should update set errors and status before emitting an event",
inject([AsyncTestCompleter], (async) => {
c.valueChanges.subscribe(value => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
c.valueChanges.subscribe((value: any /** TODO #9100 */) => {
expect(c.valid).toEqual(false);
expect(c.errors).toEqual({"required": true});
async.done();
@ -263,7 +263,7 @@ export function main() {
}));
}
it("should return a cold observable", inject([AsyncTestCompleter], (async) => {
it("should return a cold observable", inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
c.updateValue("will be ignored");
ObservableWrapper.subscribe(c.valueChanges, (value) => {
expect(value).toEqual('new');
@ -380,7 +380,7 @@ export function main() {
describe("errors", () => {
it("should run the validator when the value changes", () => {
var simpleValidator = (c) =>
var simpleValidator = (c: any /** TODO #9100 */) =>
c.controls["one"].value != "correct" ? {"broken": true} : null;
var c = new Control(null);
@ -399,7 +399,7 @@ export function main() {
});
describe("dirty", () => {
var c, g;
var c: any /** TODO #9100 */, g: any /** TODO #9100 */;
beforeEach(() => {
c = new Control('value');
@ -417,7 +417,7 @@ export function main() {
describe("optional components", () => {
describe("contains", () => {
var group;
var group: any /** TODO #9100 */;
beforeEach(() => {
group = new ControlGroup(
@ -473,7 +473,7 @@ export function main() {
});
describe("valueChanges", () => {
var g, c1, c2;
var g: any /** TODO #9100 */, c1: any /** TODO #9100 */, c2: any /** TODO #9100 */;
beforeEach(() => {
c1 = new Control("old1");
@ -482,7 +482,7 @@ export function main() {
});
it("should fire an event after the value has been updated",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
ObservableWrapper.subscribe(g.valueChanges, (value) => {
expect(g.value).toEqual({'one': 'new1', 'two': 'old2'});
expect(value).toEqual({'one': 'new1', 'two': 'old2'});
@ -492,7 +492,7 @@ export function main() {
}));
it("should fire an event after the control's observable fired an event",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var controlCallbackIsCalled = false;
ObservableWrapper.subscribe(c1.valueChanges,
@ -507,7 +507,7 @@ export function main() {
}));
it("should fire an event when a control is excluded",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
ObservableWrapper.subscribe(g.valueChanges, (value) => {
expect(value).toEqual({'one': 'old1'});
async.done();
@ -517,7 +517,7 @@ export function main() {
}));
it("should fire an event when a control is included",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
g.exclude("two");
ObservableWrapper.subscribe(g.valueChanges, (value) => {
@ -529,8 +529,8 @@ export function main() {
}));
it("should fire an event every time a control is updated",
inject([AsyncTestCompleter], (async) => {
var loggedValues = [];
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var loggedValues: any[] /** TODO #9100 */ = [];
ObservableWrapper.subscribe(g.valueChanges, (value) => {
loggedValues.push(value);
@ -547,7 +547,7 @@ export function main() {
}));
xit("should not fire an event when an excluded control is updated",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
// hard to test without hacking zones
}));
});
@ -609,7 +609,7 @@ export function main() {
describe("ControlArray", () => {
describe("adding/removing", () => {
var a: ControlArray;
var c1, c2, c3;
var c1: any /** TODO #9100 */, c2: any /** TODO #9100 */, c3: any /** TODO #9100 */;
beforeEach(() => {
a = new ControlArray([]);
@ -658,7 +658,7 @@ export function main() {
describe("errors", () => {
it("should run the validator when the value changes", () => {
var simpleValidator = (c) => c.controls[0].value != "correct" ? {"broken": true} : null;
var simpleValidator = (c: any /** TODO #9100 */) => c.controls[0].value != "correct" ? {"broken": true} : null;
var c = new Control(null);
var g = new ControlArray([c], simpleValidator);
@ -725,7 +725,7 @@ export function main() {
describe("valueChanges", () => {
var a: ControlArray;
var c1, c2;
var c1: any /** TODO #9100 */, c2: any /** TODO #9100 */;
beforeEach(() => {
c1 = new Control("old1");
@ -734,7 +734,7 @@ export function main() {
});
it("should fire an event after the value has been updated",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
ObservableWrapper.subscribe(a.valueChanges, (value) => {
expect(a.value).toEqual(['new1', 'old2']);
expect(value).toEqual(['new1', 'old2']);
@ -744,7 +744,7 @@ export function main() {
}));
it("should fire an event after the control's observable fired an event",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var controlCallbackIsCalled = false;
ObservableWrapper.subscribe(c1.valueChanges,
@ -759,7 +759,7 @@ export function main() {
}));
it("should fire an event when a control is removed",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
ObservableWrapper.subscribe(a.valueChanges, (value) => {
expect(value).toEqual(['old1']);
async.done();
@ -768,7 +768,7 @@ export function main() {
a.removeAt(1);
}));
it("should fire an event when a control is added", inject([AsyncTestCompleter], (async) => {
it("should fire an event when a control is added", inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
a.removeAt(1);
ObservableWrapper.subscribe(a.valueChanges, (value) => {

View File

@ -17,7 +17,7 @@ export function main() {
function validator(key: string, error: any) {
return function(c: AbstractControl) {
var r = {};
r[key] = error;
(r as any /** TODO #9100 */)[key] = error;
return r;
}
}
@ -111,8 +111,8 @@ export function main() {
});
describe("composeAsync", () => {
function asyncValidator(expected, response) {
return (c) => {
function asyncValidator(expected: any /** TODO #9100 */, response: any /** TODO #9100 */) {
return (c: any /** TODO #9100 */) => {
var emitter = new EventEmitter();
var res = c.value != expected ? response : null;
@ -136,7 +136,7 @@ export function main() {
asyncValidator("expected", {"two": true})
]);
var value = null;
var value: any /** TODO #9100 */ = null;
(<Promise<any>>c(new Control("invalid"))).then(v => value = v);
tick(1);
@ -147,7 +147,7 @@ export function main() {
it("should return null when no errors", fakeAsync(() => {
var c = Validators.composeAsync([asyncValidator("expected", {"one": true})]);
var value = null;
var value: any /** TODO #9100 */ = null;
(<Promise<any>>c(new Control("expected"))).then(v => value = v);
tick(1);
@ -158,7 +158,7 @@ export function main() {
it("should ignore nulls", fakeAsync(() => {
var c = Validators.composeAsync([asyncValidator("expected", {"one": true}), null]);
var value = null;
var value: any /** TODO #9100 */ = null;
(<Promise<any>>c(new Control("invalid"))).then(v => value = v);
tick(1);

View File

@ -28,9 +28,9 @@ export function main() {
describe("AsyncPipe", () => {
describe('Observable', () => {
var emitter;
var pipe;
var ref;
var emitter: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
var ref: any /** TODO #9100 */;
var message = new Object();
beforeEach(() => {
@ -44,7 +44,7 @@ export function main() {
() => { expect(pipe.transform(emitter)).toBe(null); });
it("should return the latest available value wrapped",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(emitter);
ObservableWrapper.callEmit(emitter, message);
@ -57,7 +57,7 @@ export function main() {
it("should return same value when nothing has changed since the last call",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(emitter);
ObservableWrapper.callEmit(emitter, message);
@ -69,7 +69,7 @@ export function main() {
}));
it("should dispose of the existing subscription when subscribing to a new observable",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(emitter);
var newEmitter = new EventEmitter();
@ -85,7 +85,7 @@ export function main() {
}));
it("should request a change detection check upon receiving a new value",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(emitter);
ObservableWrapper.callEmit(emitter, message);
@ -100,7 +100,7 @@ export function main() {
it("should do nothing when no subscription",
() => { expect(() => pipe.ngOnDestroy()).not.toThrow(); });
it("should dispose of the existing subscription", inject([AsyncTestCompleter], (async) => {
it("should dispose of the existing subscription", inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(emitter);
pipe.ngOnDestroy();
@ -132,7 +132,7 @@ export function main() {
it("should return null when subscribing to a promise",
() => { expect(pipe.transform(completer.promise)).toBe(null); });
it("should return the latest available value", inject([AsyncTestCompleter], (async) => {
it("should return the latest available value", inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(completer.promise);
completer.resolve(message);
@ -144,7 +144,7 @@ export function main() {
}));
it("should return unwrapped value when nothing has changed since the last call",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(completer.promise);
completer.resolve(message);
@ -156,7 +156,7 @@ export function main() {
}));
it("should dispose of the existing subscription when subscribing to a new promise",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(completer.promise);
var newCompleter = PromiseWrapper.completer();
@ -172,7 +172,7 @@ export function main() {
}));
it("should request a change detection check upon receiving a new value",
inject([AsyncTestCompleter], (async) => {
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var markForCheck = ref.spy('markForCheck');
pipe.transform(completer.promise);
completer.resolve(message);
@ -187,7 +187,7 @@ export function main() {
it("should do nothing when no source",
() => { expect(() => pipe.ngOnDestroy()).not.toThrow(); });
it("should dispose of the existing source", inject([AsyncTestCompleter], (async) => {
it("should dispose of the existing source", inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
pipe.transform(completer.promise);
expect(pipe.transform(completer.promise)).toBe(null);
completer.resolve(message)

View File

@ -16,8 +16,8 @@ import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("DatePipe", () => {
var date;
var pipe;
var date: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
beforeEach(() => {
date = DateWrapper.create(2015, 6, 15, 21, 43, 11);

View File

@ -14,7 +14,7 @@ import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("I18nPluralPipe", () => {
var pipe;
var pipe: any /** TODO #9100 */;
var mapping = {'=0': 'No messages.', '=1': 'One message.', 'other': 'There are some messages.'};
var interpolatedMapping =
{'=0': 'No messages.', '=1': 'One message.', 'other': 'There are # messages, that is #.'};
@ -46,7 +46,7 @@ export function main() {
});
it("should use 'other' if value is undefined", () => {
var messageLength;
var messageLength: any /** TODO #9100 */;
var val = pipe.transform(messageLength, interpolatedMapping);
expect(val).toEqual('There are messages, that is .');
});

View File

@ -14,7 +14,7 @@ import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("I18nSelectPipe", () => {
var pipe;
var pipe: any /** TODO #9100 */;
var mapping = {'male': 'Invite him.', 'female': 'Invite her.', 'other': 'Invite them.'};
beforeEach(() => { pipe = new I18nSelectPipe(); });
@ -39,7 +39,7 @@ export function main() {
});
it("should use 'other' if value is undefined", () => {
var gender;
var gender: any /** TODO #9100 */;
var val = pipe.transform(gender, mapping);
expect(val).toEqual('Invite them.');
});

View File

@ -19,9 +19,9 @@ import {JsonPipe} from '@angular/common';
export function main() {
describe("JsonPipe", () => {
var regNewLine = '\n';
var inceptionObj;
var inceptionObjString;
var pipe;
var inceptionObj: any /** TODO #9100 */;
var inceptionObjString: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
function normalize(obj: string): string { return StringWrapper.replace(obj, regNewLine, ''); }
@ -53,7 +53,7 @@ export function main() {
describe('integration', () => {
it('should work with mutable objects',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(TestComp).then((fixture) => {
let mutable: number[] = [1];
fixture.debugElement.componentInstance.data = mutable;

View File

@ -13,9 +13,9 @@ import {LowerCasePipe} from '@angular/common';
export function main() {
describe("LowerCasePipe", () => {
var upper;
var lower;
var pipe;
var upper: any /** TODO #9100 */;
var lower: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
beforeEach(() => {
lower = 'something';

View File

@ -18,7 +18,7 @@ export function main() {
// https://github.com/angular/angular/issues/3333
if (browserDetection.supportsIntlApi) {
describe("DecimalPipe", () => {
var pipe;
var pipe: any /** TODO #9100 */;
beforeEach(() => { pipe = new DecimalPipe(); });
@ -39,7 +39,7 @@ export function main() {
});
describe("PercentPipe", () => {
var pipe;
var pipe: any /** TODO #9100 */;
beforeEach(() => { pipe = new PercentPipe(); });
@ -55,7 +55,7 @@ export function main() {
});
describe("CurrencyPipe", () => {
var pipe;
var pipe: any /** TODO #9100 */;
beforeEach(() => { pipe = new CurrencyPipe(); });

View File

@ -17,8 +17,8 @@ import {RegExpWrapper, StringJoiner} from '../../src/facade/lang';
export function main() {
describe("ReplacePipe", () => {
var someNumber: number;
var str;
var pipe;
var str: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
beforeEach(() => {
someNumber = 42;
@ -52,7 +52,7 @@ export function main() {
var result3 = pipe.transform(str, RegExpWrapper.create("a", "i"), "_");
var f = (x => { return "Adams!"; });
var f = ((x: any /** TODO #9100 */) => { return "Adams!"; });
var result4 = pipe.transform(str, "Adams", f);

View File

@ -20,8 +20,8 @@ import {SlicePipe} from '@angular/common';
export function main() {
describe("SlicePipe", () => {
var list: number[];
var str;
var pipe;
var str: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
beforeEach(() => {
list = [1, 2, 3, 4, 5];
@ -95,7 +95,7 @@ export function main() {
describe('integration', () => {
it('should work with mutable arrays',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(TestComp).then((fixture) => {
let mutable: number[] = [1, 2];
fixture.debugElement.componentInstance.data = mutable;

View File

@ -12,9 +12,9 @@ import {UpperCasePipe} from '@angular/common';
export function main() {
describe("UpperCasePipe", () => {
var upper;
var lower;
var pipe;
var upper: any /** TODO #9100 */;
var lower: any /** TODO #9100 */;
var pipe: any /** TODO #9100 */;
beforeEach(() => {
lower = 'something';

View File

@ -88,7 +88,7 @@ class _AnimationBuilder implements AnimationAstVisitor {
visitAnimationStyles(ast: AnimationStylesAst,
context: _AnimationBuilderContext): o.Expression {
var stylesArr = [];
var stylesArr: any[] /** TODO #9100 */ = [];
if (context.isExpectingFirstStyleStep) {
stylesArr.push(_ANIMATION_START_STATE_STYLES_VAR);
context.isExpectingFirstStyleStep = false;
@ -139,7 +139,7 @@ class _AnimationBuilder implements AnimationAstVisitor {
}
/** @internal */
_callAnimateMethod(ast: AnimationStepAst, startingStylesExpr, keyframesExpr) {
_callAnimateMethod(ast: AnimationStepAst, startingStylesExpr: any /** TODO #9100 */, keyframesExpr: any /** TODO #9100 */) {
return _ANIMATION_FACTORY_RENDERER_VAR.callMethod('animate', [
_ANIMATION_FACTORY_ELEMENT_VAR,
startingStylesExpr,
@ -165,8 +165,8 @@ class _AnimationBuilder implements AnimationAstVisitor {
visitAnimationStateDeclaration(ast: AnimationStateDeclarationAst, context: _AnimationBuilderContext): void {
var flatStyles: {[key: string]: string|number} = {};
_getStylesArray(ast).forEach(entry => {
StringMapWrapper.forEach(entry, (value, key) => {
_getStylesArray(ast).forEach((entry: any /** TODO #9100 */) => {
StringMapWrapper.forEach(entry, (value: any /** TODO #9100 */, key: any /** TODO #9100 */) => {
flatStyles[key] = value;
});
});
@ -182,7 +182,7 @@ class _AnimationBuilder implements AnimationAstVisitor {
context.isExpectingFirstStyleStep = true;
var stateChangePreconditions = [];
var stateChangePreconditions: any[] /** TODO #9100 */ = [];
ast.stateChanges.forEach(stateChange => {
stateChangePreconditions.push(
@ -216,7 +216,7 @@ class _AnimationBuilder implements AnimationAstVisitor {
//this should always be defined even if the user overrides it
context.stateMap.registerState(DEFAULT_STATE, {});
var statements = [];
var statements: any[] /** TODO #9100 */ = [];
statements.push(
_ANIMATION_FACTORY_VIEW_VAR.callMethod('cancelActiveAnimation', [
_ANIMATION_FACTORY_ELEMENT_VAR,
@ -313,12 +313,12 @@ class _AnimationBuilder implements AnimationAstVisitor {
var fnStatement = ast.visit(this, context).toDeclStmt(this._fnVarName);
var fnVariable = o.variable(this._fnVarName);
var lookupMap = [];
StringMapWrapper.forEach(context.stateMap.states, (value, stateName) => {
var lookupMap: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(context.stateMap.states, (value: any /** TODO #9100 */, stateName: any /** TODO #9100 */) => {
var variableValue = EMPTY_MAP;
if (isPresent(value)) {
let styleMap = [];
StringMapWrapper.forEach(value, (value, key) => {
let styleMap: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(value, (value: any /** TODO #9100 */, key: any /** TODO #9100 */) => {
styleMap.push([key, o.literal(value)]);
});
variableValue = o.literalMap(styleMap);

View File

@ -46,7 +46,7 @@ const _TERMINAL_KEYFRAME = 1;
const _ONE_SECOND = 1000;
export class AnimationParseError extends ParseError {
constructor(message) { super(null, message); }
constructor(message: any /** TODO #9100 */) { super(null, message); }
toString(): string { return `${this.msg}`; }
}
@ -59,7 +59,7 @@ export function parseAnimationEntry(entry: CompileAnimationEntryMetadata): Parse
var stateStyles: {[key: string]: AnimationStylesAst} = {};
var transitions: CompileAnimationStateTransitionMetadata[] = [];
var stateDeclarationAsts = [];
var stateDeclarationAsts: any[] /** TODO #9100 */ = [];
entry.definitions.forEach(def => {
if (def instanceof CompileAnimationStateDeclarationMetadata) {
_parseAnimationDeclarationStates(def, errors).forEach(ast => {
@ -98,7 +98,7 @@ function _parseAnimationStateTransition(transitionStateMetadata: CompileAnimatio
stateStyles: {[key: string]: AnimationStylesAst},
errors: AnimationParseError[]): AnimationStateTransitionAst {
var styles = new StylesCollection();
var transitionExprs = [];
var transitionExprs: any[] /** TODO #9100 */ = [];
var transitionStates = transitionStateMetadata.stateChangeExpr.split(/\s*,\s*/);
transitionStates.forEach(expr => {
_parseAnimationTransitionExpr(expr, errors).forEach(transExpr => {
@ -120,7 +120,7 @@ function _parseAnimationStateTransition(transitionStateMetadata: CompileAnimatio
}
function _parseAnimationTransitionExpr(eventStr: string, errors: AnimationParseError[]): AnimationStateTransitionExpression[] {
var expressions = [];
var expressions: any[] /** TODO #9100 */ = [];
var match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
if (!isPresent(match) || match.length < 4) {
errors.push(new AnimationParseError(`the provided ${eventStr} is not of a supported format`));
@ -161,7 +161,7 @@ function _normalizeAnimationEntry(entry: CompileAnimationMetadata | CompileAnima
function _normalizeStyleMetadata(entry: CompileAnimationStyleMetadata,
stateStyles: {[key: string]: AnimationStylesAst},
errors: AnimationParseError[]): Array<{[key: string]: string|number}> {
var normalizedStyles = [];
var normalizedStyles: any[] /** TODO #9100 */ = [];
entry.styles.forEach(styleEntry => {
if (isString(styleEntry)) {
ListWrapper.addAll(normalizedStyles, _resolveStylesFromState(<string>styleEntry, stateStyles, errors));
@ -299,7 +299,7 @@ function _parseAnimationKeyframes(keyframeSequence: CompileAnimationKeyframesSeq
var limit = totalEntries - 1;
var margin = totalOffsets == 0 ? (1 / limit) : 0;
var rawKeyframes = [];
var rawKeyframes: any[] /** TODO #9100 */ = [];
var index = 0;
var doSortKeyframes = false;
var lastOffset = 0;
@ -307,7 +307,7 @@ function _parseAnimationKeyframes(keyframeSequence: CompileAnimationKeyframesSeq
var offset = styleMetadata.offset;
var keyframeStyles: {[key: string]: string|number} = {};
styleMetadata.styles.forEach(entry => {
StringMapWrapper.forEach(<{[key: string]: string|number}>entry, (value, prop) => {
StringMapWrapper.forEach(<{[key: string]: string|number}>entry, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (prop != 'offset') {
keyframeStyles[prop] = value;
}
@ -329,7 +329,7 @@ function _parseAnimationKeyframes(keyframeSequence: CompileAnimationKeyframesSeq
ListWrapper.sort(rawKeyframes, (a,b) => a[0] <= b[0] ? -1 : 1);
}
var i;
var i: any /** TODO #9100 */;
var firstKeyframe = rawKeyframes[0];
if (firstKeyframe[0] != _INITIAL_KEYFRAME) {
ListWrapper.insert(rawKeyframes, 0, firstKeyframe = [_INITIAL_KEYFRAME, {}]);
@ -348,7 +348,7 @@ function _parseAnimationKeyframes(keyframeSequence: CompileAnimationKeyframesSeq
let entry = rawKeyframes[i];
let styles = entry[1];
StringMapWrapper.forEach(styles, (value, prop) => {
StringMapWrapper.forEach(styles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (!isPresent(firstKeyframeStyles[prop])) {
firstKeyframeStyles[prop] = FILL_STYLE_FLAG;
}
@ -359,7 +359,7 @@ function _parseAnimationKeyframes(keyframeSequence: CompileAnimationKeyframesSeq
let entry = rawKeyframes[i];
let styles = entry[1];
StringMapWrapper.forEach(styles, (value, prop) => {
StringMapWrapper.forEach(styles, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (!isPresent(lastKeyframeStyles[prop])) {
lastKeyframeStyles[prop] = value;
}
@ -374,14 +374,14 @@ function _parseTransitionAnimation(entry: CompileAnimationMetadata,
collectedStyles: StylesCollection,
stateStyles: {[key: string]: AnimationStylesAst},
errors: AnimationParseError[]): AnimationAst {
var ast;
var ast: any /** TODO #9100 */;
var playTime = 0;
var startingTime = currentTime;
if (entry instanceof CompileAnimationWithStepsMetadata) {
var maxDuration = 0;
var steps = [];
var steps: any[] /** TODO #9100 */ = [];
var isGroup = entry instanceof CompileAnimationGroupMetadata;
var previousStyles;
var previousStyles: any /** TODO #9100 */;
entry.steps.forEach(entry => {
// these will get picked up by the next step...
var time = isGroup ? startingTime : currentTime;
@ -389,7 +389,7 @@ function _parseTransitionAnimation(entry: CompileAnimationMetadata,
entry.styles.forEach(stylesEntry => {
// by this point we know that we only have stringmap values
var map = <{[key: string]: string|number}>stylesEntry;
StringMapWrapper.forEach(map, (value, prop) => {
StringMapWrapper.forEach(map, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
collectedStyles.insertAtTime(prop, time, value);
});
});
@ -430,7 +430,7 @@ function _parseTransitionAnimation(entry: CompileAnimationMetadata,
var timings = _parseTimeExpression(entry.timings, errors);
var styles = entry.styles;
var keyframes;
var keyframes: any /** TODO #9100 */;
if (styles instanceof CompileAnimationKeyframesSequenceMetadata) {
keyframes = _parseAnimationKeyframes(styles, currentTime, collectedStyles, stateStyles, errors);
} else {
@ -445,9 +445,9 @@ function _parseTransitionAnimation(entry: CompileAnimationMetadata,
playTime = timings.duration + timings.delay;
currentTime += playTime;
keyframes.forEach(keyframe =>
keyframe.styles.styles.forEach(entry =>
StringMapWrapper.forEach(entry, (value, prop) =>
keyframes.forEach((keyframe: any /** TODO #9100 */) =>
keyframe.styles.styles.forEach((entry: any /** TODO #9100 */) =>
StringMapWrapper.forEach(entry, (value: any /** TODO #9100 */, prop: any /** TODO #9100 */) =>
collectedStyles.insertAtTime(prop, currentTime, value))
)
);
@ -526,11 +526,11 @@ function _createStartKeyframeFromEndKeyframe(endKeyframe: AnimationKeyframeAst,
var values: {[key: string]: string | number} = {};
var endTime = startTime + duration;
endKeyframe.styles.styles.forEach((styleData: {[key: string]: string|number}) => {
StringMapWrapper.forEach(styleData, (val, prop) => {
StringMapWrapper.forEach(styleData, (val: any /** TODO #9100 */, prop: any /** TODO #9100 */) => {
if (prop == 'offset') return;
var resultIndex = collectedStyles.indexOfAtOrBeforeTime(prop, startTime);
var resultEntry, nextEntry, value;
var resultEntry: any /** TODO #9100 */, nextEntry: any /** TODO #9100 */, value: any /** TODO #9100 */;
if (isPresent(resultIndex)) {
resultEntry = collectedStyles.getByIndex(prop, resultIndex);
value = resultEntry.value;

View File

@ -46,7 +46,7 @@ export abstract class CompileMetadataWithType extends CompileMetadataWithIdentif
}
export function metadataFromJson(data: {[key: string]: any}): any {
return _COMPILE_METADATA_FROM_JSON[data['class']](data);
return (_COMPILE_METADATA_FROM_JSON as any /** TODO #9100 */)[data['class']](data);
}
export class CompileAnimationEntryMetadata {
@ -523,7 +523,7 @@ export class CompileTokenMap<VALUE> {
get(token: CompileTokenMetadata): VALUE {
var rk = token.runtimeCacheKey;
var ak = token.assetCacheKey;
var result;
var result: any /** TODO #9100 */;
if (isPresent(rk)) {
result = this._valueMap.get(rk);
}

View File

@ -38,9 +38,9 @@ export abstract class RenderTypes {
export class DefaultRenderTypes implements RenderTypes {
renderer = Identifiers.Renderer;
renderText = null;
renderElement = null;
renderComment = null;
renderNode = null;
renderEvent = null;
renderText: any /** TODO #9100 */ = null;
renderElement: any /** TODO #9100 */ = null;
renderComment: any /** TODO #9100 */ = null;
renderNode: any /** TODO #9100 */ = null;
renderEvent: any /** TODO #9100 */ = null;
}

View File

@ -137,7 +137,7 @@ export class CssScannerError extends BaseException {
public rawMessage: string;
public message: string;
constructor(public token: CssToken, message) {
constructor(public token: CssToken, message: any /** TODO #9100 */) {
super('Css Parse Error: ' + message);
this.rawMessage = message;
}
@ -251,7 +251,7 @@ export class CssScanner {
next = new CssToken(0, 0, 0, CssTokenType.EOF, "end of file");
}
var isMatchingType;
var isMatchingType: any /** TODO #9100 */;
if (type == CssTokenType.IdentifierOrNumber) {
// TODO (matsko): implement array traversal for lookup here
isMatchingType = next.type == CssTokenType.Number || next.type == CssTokenType.Identifier;
@ -263,7 +263,7 @@ export class CssScanner {
// mode so that the parser can recover...
this.setMode(mode);
var error = null;
var error: any /** TODO #9100 */ = null;
if (!isMatchingType || (isPresent(value) && value != next.strValue)) {
var errorMessage = resolveEnumToken(CssTokenType, next.type) + " does not match expected " +
resolveEnumToken(CssTokenType, type) + " value";
@ -740,7 +740,7 @@ function isValidCssCharacter(code: number, mode: CssLexerMode): boolean {
}
}
function charCode(input, index): number {
function charCode(input: any /** TODO #9100 */, index: any /** TODO #9100 */): number {
return index >= input.length ? $EOF : StringWrapper.charCodeAt(input, index);
}
@ -748,7 +748,7 @@ function charStr(code: number): string {
return StringWrapper.fromCharCode(code);
}
export function isNewline(code): boolean {
export function isNewline(code: any /** TODO #9100 */): boolean {
switch (code) {
case $FF:
case $CR:

View File

@ -181,8 +181,8 @@ export class CssParser {
}
/** @internal */
_parseStyleSheet(delimiters): CssStyleSheetAST {
var results = [];
_parseStyleSheet(delimiters: any /** TODO #9100 */): CssStyleSheetAST {
var results: any[] /** TODO #9100 */ = [];
this._scanner.consumeEmptyStatements();
while (this._scanner.peek != $EOF) {
this._scanner.setMode(CssLexerMode.BLOCK);
@ -208,7 +208,7 @@ export class CssParser {
this._assertCondition(token.type == CssTokenType.AtKeyword,
`The CSS Rule ${token.strValue} is not a valid [@] rule.`, token);
var block, type = this._resolveBlockType(token);
var block: any /** TODO #9100 */, type = this._resolveBlockType(token);
switch (type) {
case BlockType.Charset:
case BlockType.Namespace:
@ -243,7 +243,7 @@ export class CssParser {
// if a custom @rule { ... } is used it should still tokenize the insides
default:
var listOfTokens = [];
var listOfTokens: any[] /** TODO #9100 */ = [];
this._scanner.setMode(CssLexerMode.ALL);
this._error(generateErrorMessage(
this._scanner.input,
@ -276,7 +276,7 @@ export class CssParser {
_parseSelectors(delimiters: number): CssSelectorAST[] {
delimiters = bitWiseOr([delimiters, LBRACE_DELIM]);
var selectors = [];
var selectors: any[] /** TODO #9100 */ = [];
var isParsingSelectors = true;
while (isParsingSelectors) {
selectors.push(this._parseSelector(delimiters));
@ -321,7 +321,7 @@ export class CssParser {
this._consume(CssTokenType.Character, '{');
var definitions = [];
var definitions: any[] /** TODO #9100 */ = [];
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
definitions.push(this._parseKeyframeDefinition(delimiters));
}
@ -333,7 +333,7 @@ export class CssParser {
/** @internal */
_parseKeyframeDefinition(delimiters: number): CssKeyframeDefinitionAST {
var stepTokens = [];
var stepTokens: any[] /** TODO #9100 */ = [];
delimiters = bitWiseOr([delimiters, LBRACE_DELIM]);
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
stepTokens.push(this._parseKeyframeLabel(bitWiseOr([delimiters, COMMA_DELIM])));
@ -357,11 +357,11 @@ export class CssParser {
delimiters = bitWiseOr([delimiters, COMMA_DELIM, LBRACE_DELIM]);
this._scanner.setMode(CssLexerMode.SELECTOR);
var selectorCssTokens = [];
var selectorCssTokens: any[] /** TODO #9100 */ = [];
var isComplex = false;
var wsCssToken;
var wsCssToken: any /** TODO #9100 */;
var previousToken;
var previousToken: any /** TODO #9100 */;
var parenCount = 0;
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
var code = this._scanner.peek;
@ -454,10 +454,10 @@ export class CssParser {
this._scanner.setMode(CssLexerMode.STYLE_VALUE);
var strValue = "";
var tokens = [];
var tokens: any[] /** TODO #9100 */ = [];
var previous: CssToken;
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
var token;
var token: any /** TODO #9100 */;
if (isPresent(previous) && previous.type == CssTokenType.Identifier &&
this._scanner.peek == $LPAREN) {
token = this._consume(CssTokenType.Character, '(');
@ -504,7 +504,7 @@ export class CssParser {
/** @internal */
_collectUntilDelim(delimiters: number, assertType: CssTokenType = null): CssToken[] {
var tokens = [];
var tokens: any[] /** TODO #9100 */ = [];
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
var val = isPresent(assertType) ? this._consume(assertType) : this._scan();
tokens.push(val);
@ -521,7 +521,7 @@ export class CssParser {
this._consume(CssTokenType.Character, '{');
this._scanner.consumeEmptyStatements();
var results = [];
var results: any[] /** TODO #9100 */ = [];
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
results.push(this._parseRule(delimiters));
}
@ -543,7 +543,7 @@ export class CssParser {
this._consume(CssTokenType.Character, '{');
this._scanner.consumeEmptyStatements();
var definitions = [];
var definitions: any[] /** TODO #9100 */ = [];
while (!characterContainsDelimiter(this._scanner.peek, delimiters)) {
definitions.push(this._parseDefinition(delimiters));
this._scanner.consumeEmptyStatements();
@ -562,7 +562,7 @@ export class CssParser {
this._scanner.setMode(CssLexerMode.STYLE_BLOCK);
var prop = this._consume(CssTokenType.Identifier);
var parseValue, value = null;
var parseValue: any /** TODO #9100 */, value: any /** TODO #9100 */ = null;
// the colon value separates the prop from the style.
// there are a few cases as to what could happen if it
@ -655,7 +655,7 @@ export class CssKeyframeRuleAST extends CssBlockRuleAST {
}
export class CssKeyframeDefinitionAST extends CssBlockRuleAST {
public steps;
public steps: any /** TODO #9100 */;
constructor(_steps: CssToken[], block: CssBlockAST) {
super(BlockType.Keyframes, block, mergeTokens(_steps, ","));
this.steps = _steps;
@ -704,7 +704,7 @@ export class CssDefinitionAST extends CssAST {
}
export class CssSelectorAST extends CssAST {
public strValue;
public strValue: any /** TODO #9100 */;
constructor(public tokens: CssToken[], public isComplex: boolean = false) {
super();
this.strValue = tokens.map(token => token.strValue).join("");
@ -735,6 +735,6 @@ export class CssParseError extends ParseError {
}
export class CssUnknownTokenListAST extends CssRuleAST {
constructor(public name, public tokens: CssToken[]) { super(); }
constructor(public name: any /** TODO #9100 */, public tokens: CssToken[]) { super(); }
visit(visitor: CssASTVisitor, context?: any) { visitor.visitUnkownRule(this, context); }
}

View File

@ -35,7 +35,7 @@ const LIFECYCLE_PROPS: Map<any, string> = MapWrapper.createFromPairs([
[LifecycleHooks.AfterViewChecked, 'ngAfterViewChecked'],
]);
export function hasLifecycleHook(hook: LifecycleHooks, token): boolean {
export function hasLifecycleHook(hook: LifecycleHooks, token: any /** TODO #9100 */): boolean {
var lcInterface = LIFECYCLE_INTERFACES.get(hook);
var lcProp = LIFECYCLE_PROPS.get(hook);
return reflector.hasLifecycleHook(token, lcInterface, lcProp);

View File

@ -61,8 +61,8 @@ export class DirectiveResolver {
private _mergeWithPropertyMetadata(dm: DirectiveMetadata,
propertyMetadata: {[key: string]: any[]},
directiveType: Type): DirectiveMetadata {
var inputs = [];
var outputs = [];
var inputs: any[] /** TODO #9100 */ = [];
var outputs: any[] /** TODO #9100 */ = [];
var host: {[key: string]: string} = {};
var queries: {[key: string]: any} = {};
@ -122,7 +122,7 @@ export class DirectiveResolver {
directiveType: Type): DirectiveMetadata {
var mergedInputs = isPresent(dm.inputs) ? ListWrapper.concat(dm.inputs, inputs) : inputs;
var mergedOutputs;
var mergedOutputs: any /** TODO #9100 */;
if (isPresent(dm.outputs)) {
dm.outputs.forEach((propName: string) => {
if (ListWrapper.contains(outputs, propName)) {

View File

@ -94,7 +94,7 @@ export class BindingPipe extends AST {
}
export class LiteralPrimitive extends AST {
constructor(public value) { super(); }
constructor(public value: any /** TODO #9100 */) { super(); }
visit(visitor: AstVisitor, context: any = null): any {
return visitor.visitLiteralPrimitive(this, context);
}

View File

@ -16,7 +16,7 @@ export enum TokenType {
export class Lexer {
tokenize(text: string): any[] {
var scanner = new _Scanner(text);
var tokens = [];
var tokens: any[] /** TODO #9100 */ = [];
var token = scanner.scanToken();
while (token != null) {
tokens.push(token);
@ -160,7 +160,7 @@ export const $RBRACE = /*@ts2dart_const*/ 125;
const $NBSP = /*@ts2dart_const*/ 160;
export class ScannerError extends BaseException {
constructor(public message) { super(); }
constructor(public message: any /** TODO #9100 */) { super(); }
toString(): string { return this.message; }
}

View File

@ -125,7 +125,7 @@ export class Parser {
let split = this.splitInterpolation(input, location);
if (split == null) return null;
let expressions = [];
let expressions: any[] /** TODO #9100 */ = [];
for (let i = 0; i < split.expressions.length; ++i) {
var tokens = this._lexer.tokenize(this._stripComments(split.expressions[i]));
@ -141,8 +141,8 @@ export class Parser {
if (parts.length <= 1) {
return null;
}
var strings = [];
var expressions = [];
var strings: any[] /** TODO #9100 */ = [];
var expressions: any[] /** TODO #9100 */ = [];
for (var i = 0; i < parts.length; i++) {
var part: string = parts[i];
@ -170,7 +170,7 @@ export class Parser {
}
private _commentStart(input: string): number {
var outerQuote = null;
var outerQuote: any /** TODO #9100 */ = null;
for (var i = 0; i < input.length - 1; i++) {
let char = StringWrapper.charCodeAt(input, i);
let nextChar = StringWrapper.charCodeAt(input, i + 1);
@ -277,7 +277,7 @@ export class _ParseAST {
}
parseChain(): AST {
var exprs = [];
var exprs: any[] /** TODO #9100 */ = [];
while (this.index < this.tokens.length) {
var expr = this.parsePipe();
exprs.push(expr);
@ -306,7 +306,7 @@ export class _ParseAST {
do {
var name = this.expectIdentifierOrKeyword();
var args = [];
var args: any[] /** TODO #9100 */ = [];
while (this.optionalCharacter($COLON)) {
args.push(this.parseExpression());
}
@ -512,7 +512,7 @@ export class _ParseAST {
}
parseExpressionList(terminator: number): any[] {
var result = [];
var result: any[] /** TODO #9100 */ = [];
if (!this.next.isCharacter(terminator)) {
do {
result.push(this.parsePipe());
@ -522,8 +522,8 @@ export class _ParseAST {
}
parseLiteralMap(): LiteralMap {
var keys = [];
var values = [];
var keys: any[] /** TODO #9100 */ = [];
var values: any[] /** TODO #9100 */ = [];
this.expectCharacter($LBRACE);
if (!this.optionalCharacter($RBRACE)) {
do {
@ -571,7 +571,7 @@ export class _ParseAST {
parseCallArguments(): BindingPipe[] {
if (this.next.isCharacter($RPAREN)) return [];
var positionals = [];
var positionals: any[] /** TODO #9100 */ = [];
do {
positionals.push(this.parsePipe());
} while (this.optionalCharacter($COMMA));
@ -582,7 +582,7 @@ export class _ParseAST {
if (!this.parseAction) {
this.error("Binding expression cannot contain chained expression");
}
var exprs = [];
var exprs: any[] /** TODO #9100 */ = [];
while (this.index < this.tokens.length && !this.next.isCharacter($RBRACE)) {
var expr = this.parseExpression();
exprs.push(expr);
@ -618,7 +618,7 @@ export class _ParseAST {
parseTemplateBindings(): TemplateBindingParseResult {
var bindings: TemplateBinding[] = [];
var prefix = null;
var prefix: any /** TODO #9100 */ = null;
var warnings: string[] = [];
while (this.index < this.tokens.length) {
var keyIsVar: boolean = this.peekKeywordLet();
@ -642,8 +642,8 @@ export class _ParseAST {
}
}
this.optionalCharacter($COLON);
var name = null;
var expression = null;
var name: any /** TODO #9100 */ = null;
var expression: any /** TODO #9100 */ = null;
if (keyIsVar) {
if (this.optionalOperator("=")) {
name = this.expectTemplateBindingKey();

View File

@ -57,7 +57,7 @@ export interface HtmlAstVisitor {
}
export function htmlVisitAll(visitor: HtmlAstVisitor, asts: HtmlAst[], context: any = null): any[] {
var result = [];
var result: any[] /** TODO #9100 */ = [];
asts.forEach(ast => {
var astResult = ast.visit(visitor, context);
if (isPresent(astResult)) {

View File

@ -118,7 +118,7 @@ class _HtmlTokenizer {
private currentTokenStart: ParseLocation;
private currentTokenType: HtmlTokenType;
private expansionCaseStack = [];
private expansionCaseStack: any[] /** TODO #9100 */ = [];
tokens: HtmlToken[] = [];
errors: HtmlTokenError[] = [];
@ -357,7 +357,7 @@ class _HtmlTokenizer {
}
this._advance();
let name = this.input.substring(start.offset + 1, this.index - 1);
let char = NAMED_ENTITIES[name];
let char = (NAMED_ENTITIES as any /** TODO #9100 */)[name];
if (isBlank(char)) {
throw this._createError(unknownEntityErrorMsg(name), this._getSpan(start));
}
@ -367,11 +367,11 @@ class _HtmlTokenizer {
private _consumeRawText(decodeEntities: boolean, firstCharOfEnd: number,
attemptEndRest: Function): HtmlToken {
var tagCloseStart;
var tagCloseStart: any /** TODO #9100 */;
var textStart = this._getLocation();
this._beginToken(decodeEntities ? HtmlTokenType.ESCAPABLE_RAW_TEXT : HtmlTokenType.RAW_TEXT,
textStart);
var parts = [];
var parts: any[] /** TODO #9100 */ = [];
while (true) {
tagCloseStart = this._getLocation();
if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) {
@ -414,11 +414,11 @@ class _HtmlTokenizer {
private _consumePrefixAndName(): string[] {
var nameOrPrefixStart = this.index;
var prefix = null;
var prefix: any /** TODO #9100 */ = null;
while (this.peek !== $COLON && !isPrefixEnd(this.peek)) {
this._advance();
}
var nameStart;
var nameStart: any /** TODO #9100 */;
if (this.peek === $COLON) {
this._advance();
prefix = this.input.substring(nameOrPrefixStart, this.index - 1);
@ -433,7 +433,7 @@ class _HtmlTokenizer {
private _consumeTagOpen(start: ParseLocation) {
let savedPos = this._savePosition();
let lowercaseTagName;
let lowercaseTagName: any /** TODO #9100 */;
try {
if (!isAsciiLetter(this.peek)) {
throw this._createError(unexpectedCharacterErrorMsg(this.peek), this._getSpan());
@ -500,11 +500,11 @@ class _HtmlTokenizer {
private _consumeAttributeValue() {
this._beginToken(HtmlTokenType.ATTR_VALUE);
var value;
var value: any /** TODO #9100 */;
if (this.peek === $SQ || this.peek === $DQ) {
var quoteChar = this.peek;
this._advance();
var parts = [];
var parts: any[] /** TODO #9100 */ = [];
while (this.peek !== quoteChar) {
parts.push(this._readChar(true));
}
@ -529,7 +529,7 @@ class _HtmlTokenizer {
private _consumeTagClose(start: ParseLocation) {
this._beginToken(HtmlTokenType.TAG_CLOSE, start);
this._attemptCharCodeUntilFn(isNotWhitespace);
var prefixAndName;
var prefixAndName: any /** TODO #9100 */;
prefixAndName = this._consumePrefixAndName();
this._attemptCharCodeUntilFn(isNotWhitespace);
this._requireCharCode($GT);
@ -593,7 +593,7 @@ class _HtmlTokenizer {
var start = this._getLocation();
this._beginToken(HtmlTokenType.TEXT, start);
var parts = [];
var parts: any[] /** TODO #9100 */ = [];
let interpolation = false;
if (this.peek === $LBRACE && this.nextPeek === $LBRACE) {
@ -712,7 +712,7 @@ function toUpperCaseCharCode(code: number): number {
}
function mergeTextTokens(srcTokens: HtmlToken[]): HtmlToken[] {
let dstTokens = [];
let dstTokens: any[] /** TODO #9100 */ = [];
let lastDstToken: HtmlToken;
for (let i = 0; i < srcTokens.length; i++) {
let token = srcTokens[i];

View File

@ -115,7 +115,7 @@ class TreeBuilder {
let switchValue = this._advance();
let type = this._advance();
let cases = [];
let cases: any[] /** TODO #9100 */ = [];
// read =
while (this.peek.type === HtmlTokenType.EXPANSION_CASE_VALUE) {
@ -170,7 +170,7 @@ class TreeBuilder {
}
private _collectExpansionExpTokens(start: HtmlToken): HtmlToken[] {
let exp = [];
let exp: any[] /** TODO #9100 */ = [];
let expansionFormStack = [HtmlTokenType.EXPANSION_CASE_EXP_START];
while (true) {
@ -239,7 +239,7 @@ class TreeBuilder {
private _consumeStartTag(startTagToken: HtmlToken) {
var prefix = startTagToken.parts[0];
var name = startTagToken.parts[1];
var attrs = [];
var attrs: any[] /** TODO #9100 */ = [];
while (this.peek.type === HtmlTokenType.ATTR_NAME) {
attrs.push(this._consumeAttr(this._advance()));
}

View File

@ -279,14 +279,14 @@ export class I18nHtmlParser implements HtmlParser {
}
private _i18nAttributes(el: HtmlElementAst): HtmlAttrAst[] {
let res = [];
let res: any[] /** TODO #9100 */ = [];
let implicitAttrs: string[] =
isPresent(this._implicitAttrs[el.name]) ? this._implicitAttrs[el.name] : [];
el.attrs.forEach(attr => {
if (attr.name.startsWith(I18N_ATTR_PREFIX) || attr.name == I18N_ATTR) return;
let message;
let message: any /** TODO #9100 */;
let i18ns = el.attrs.filter(a => a.name == `${I18N_ATTR_PREFIX}${attr.name}`);
@ -333,7 +333,7 @@ export class I18nHtmlParser implements HtmlParser {
private _replacePlaceholdersWithExpressions(message: string, exps: string[],
sourceSpan: ParseSourceSpan): string {
let expMap = this._buildExprMap(exps);
return RegExpWrapper.replaceAll(_PLACEHOLDER_EXPANDED_REGEXP, message, (match) => {
return RegExpWrapper.replaceAll(_PLACEHOLDER_EXPANDED_REGEXP, message, (match: any /** TODO #9100 */) => {
let nameWithQuotes = match[2];
let name = nameWithQuotes.substring(1, nameWithQuotes.length - 1);
return this._convertIntoExpression(name, expMap, sourceSpan);

View File

@ -28,11 +28,11 @@ export class I18nError extends ParseError {
// Man, this is so ugly!
export function partition(nodes: HtmlAst[], errors: ParseError[], implicitTags: string[]): Part[] {
let res = [];
let res: any[] /** TODO #9100 */ = [];
for (let i = 0; i < nodes.length; ++i) {
let n = nodes[i];
let temp = [];
let temp: any[] /** TODO #9100 */ = [];
if (_isOpeningComment(n)) {
let i18n = (<HtmlCommentAst>n).value.substring(5).trim();
i++;

View File

@ -38,7 +38,7 @@ export function deserializeXmb(content: string, url: string): XmbDeserialization
}
let bundleEl = <HtmlElementAst>parsed.rootNodes[0]; // test this
let errors = [];
let errors: any[] /** TODO #9100 */ = [];
let messages: {[key: string]: HtmlAst[]} = {};
_createMessages(bundleEl.children, messages, errors);
@ -88,7 +88,7 @@ function _serializeMessage(m: Message): string {
}
function _expandPlaceholder(input: string): string {
return RegExpWrapper.replaceAll(_PLACEHOLDER_REGEXP, input, (match) => {
return RegExpWrapper.replaceAll(_PLACEHOLDER_REGEXP, input, (match: any /** TODO #9100 */) => {
let nameWithQuotes = match[2];
return `<ph name=${nameWithQuotes}></ph>`;
});

View File

@ -126,9 +126,9 @@ export class CompileMetadataResolver {
var meta = this._directiveCache.get(directiveType);
if (isBlank(meta)) {
var dirMeta = this._directiveResolver.resolve(directiveType);
var templateMeta = null;
var changeDetectionStrategy = null;
var viewProviders = [];
var templateMeta: any /** TODO #9100 */ = null;
var changeDetectionStrategy: any /** TODO #9100 */ = null;
var viewProviders: any[] /** TODO #9100 */ = [];
var moduleUrl = staticTypeModuleUrl(directiveType);
if (dirMeta instanceof ComponentMetadata) {
assertArrayOfStrings('styles', dirMeta.styles);
@ -154,12 +154,12 @@ export class CompileMetadataResolver {
moduleUrl = componentModuleUrl(this._reflector, directiveType, cmpMeta);
}
var providers = [];
var providers: any[] /** TODO #9100 */ = [];
if (isPresent(dirMeta.providers)) {
providers = this.getProvidersMetadata(dirMeta.providers);
}
var queries = [];
var viewQueries = [];
var queries: any[] /** TODO #9100 */ = [];
var viewQueries: any[] /** TODO #9100 */ = [];
if (isPresent(dirMeta.queries)) {
queries = this.getQueriesMetadata(dirMeta.queries, false, directiveType);
viewQueries = this.getQueriesMetadata(dirMeta.queries, true, directiveType);
@ -275,7 +275,7 @@ export class CompileMetadataResolver {
let isOptional = false;
let query: QueryMetadata = null;
let viewQuery: ViewQueryMetadata = null;
var token = null;
var token: any /** TODO #9100 */ = null;
if (isArray(param)) {
(<any[]>param)
.forEach((paramEntry) => {
@ -324,7 +324,7 @@ export class CompileMetadataResolver {
getTokenMetadata(token: any): cpl.CompileTokenMetadata {
token = resolveForwardRef(token);
var compileToken;
var compileToken: any /** TODO #9100 */;
if (isString(token)) {
compileToken = new cpl.CompileTokenMetadata({value: token});
} else {
@ -356,7 +356,7 @@ export class CompileMetadataResolver {
}
getProviderMetadata(provider: Provider): cpl.CompileProviderMetadata {
var compileDeps;
var compileDeps: any /** TODO #9100 */;
if (isPresent(provider.useClass)) {
compileDeps = this.getDependenciesMetadata(provider.useClass, provider.dependencies);
} else if (isPresent(provider.useFactory)) {
@ -382,8 +382,8 @@ export class CompileMetadataResolver {
getQueriesMetadata(queries: {[key: string]: QueryMetadata},
isViewQuery: boolean, directiveType: Type): cpl.CompileQueryMetadata[] {
var compileQueries = [];
StringMapWrapper.forEach(queries, (query, propertyName) => {
var compileQueries: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(queries, (query: any /** TODO #9100 */, propertyName: any /** TODO #9100 */) => {
if (query.isViewQuery === isViewQuery) {
compileQueries.push(this.getQueryMetadata(query, propertyName, directiveType));
}
@ -392,7 +392,7 @@ export class CompileMetadataResolver {
}
getQueryMetadata(q: QueryMetadata, propertyName: string, typeOrFunc: Type | Function): cpl.CompileQueryMetadata {
var selectors;
var selectors: any /** TODO #9100 */;
if (q.isVarBindingQuery) {
selectors = q.varBindings.map(varName => this.getTokenMetadata(varName));
} else {
@ -412,7 +412,7 @@ export class CompileMetadataResolver {
}
function flattenDirectives(view: ViewMetadata, platformDirectives: any[]): Type[] {
let directives = [];
let directives: any[] /** TODO #9100 */ = [];
if (isPresent(platformDirectives)) {
flattenArray(platformDirectives, directives);
}
@ -423,7 +423,7 @@ function flattenDirectives(view: ViewMetadata, platformDirectives: any[]): Type[
}
function flattenPipes(view: ViewMetadata, platformPipes: any[]): Type[] {
let pipes = [];
let pipes: any[] /** TODO #9100 */ = [];
if (isPresent(platformPipes)) {
flattenArray(platformPipes, pipes);
}

View File

@ -53,8 +53,8 @@ export class OfflineCompiler {
if (components.length === 0) {
throw new BaseException('No components given');
}
var statements = [];
var exportedVars = [];
var statements: any[] /** TODO #9100 */ = [];
var exportedVars: any[] /** TODO #9100 */ = [];
var moduleUrl = _templateModuleUrl(components[0].component);
components.forEach(componentWithDirs => {
var compMeta = <CompileDirectiveMetadata>componentWithDirs.component;
@ -88,7 +88,7 @@ export class OfflineCompiler {
return this._xhr.get(stylesheetUrl)
.then((cssText) => {
var compileResult = this._styleCompiler.compileStylesheet(stylesheetUrl, cssText, shim);
var importedUrls = [];
var importedUrls: any[] /** TODO #9100 */ = [];
compileResult.dependencies.forEach((dep) => {
importedUrls.push(dep.moduleUrl);
dep.valuePlaceholder.moduleUrl = _stylesModuleUrl(dep.moduleUrl, dep.isShimmed, suffix);

View File

@ -274,7 +274,7 @@ export abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.Ex
abstract visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, context: any): any;
visitBinaryOperatorExpr(ast: o.BinaryOperatorExpr, ctx: EmitterVisitorContext): any {
var opStr;
var opStr: any /** TODO #9100 */;
switch (ast.operator) {
case o.BinaryOperator.Equals:
opStr = '==';
@ -358,7 +358,7 @@ export abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.Ex
var useNewLine = ast.entries.length > 1;
ctx.print(`{`, useNewLine);
ctx.incIndent();
this.visitAllObjects((entry) => {
this.visitAllObjects((entry: any /** TODO #9100 */) => {
ctx.print(`${escapeSingleQuoteString(entry[0], this._escapeDollarInStrings)}: `);
entry[1].visitExpression(this, ctx);
}, ast.entries, ctx, ',', useNewLine);
@ -369,7 +369,7 @@ export abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.Ex
visitAllExpressions(expressions: o.Expression[], ctx: EmitterVisitorContext, separator: string,
newLine: boolean = false): void {
this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator,
this.visitAllObjects((expr: any /** TODO #9100 */) => expr.visitExpression(this, ctx), expressions, ctx, separator,
newLine);
}
@ -395,7 +395,7 @@ export function escapeSingleQuoteString(input: string, escapeDollar: boolean): a
if (isBlank(input)) {
return null;
}
var body = StringWrapper.replaceAllMapped(input, _SINGLE_QUOTE_ESCAPE_STRING_RE, (match) => {
var body = StringWrapper.replaceAllMapped(input, _SINGLE_QUOTE_ESCAPE_STRING_RE, (match: any /** TODO #9100 */) => {
if (match[0] == '$') {
return escapeDollar ? '\\$' : '$';
} else if (match[0] == '\n') {

View File

@ -141,11 +141,11 @@ export abstract class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
}
private _visitParams(params: o.FnParam[], ctx: EmitterVisitorContext): void {
this.visitAllObjects((param) => ctx.print(param.name), params, ctx, ',');
this.visitAllObjects((param: any /** TODO #9100 */) => ctx.print(param.name), params, ctx, ',');
}
getBuiltinMethodName(method: o.BuiltinMethod): string {
var name;
var name: any /** TODO #9100 */;
switch (method) {
case o.BuiltinMethod.ConcatArray:
name = 'concat';

View File

@ -39,7 +39,7 @@ export function debugOutputAstAsDart(ast: o.Statement | o.Expression | o.Type |
export class DartEmitter implements OutputEmitter {
constructor(private _importGenerator: ImportGenerator) {}
emitStatements(moduleUrl: string, stmts: o.Statement[], exportedVars: string[]): string {
var srcParts = [];
var srcParts: any[] /** TODO #9100 */ = [];
// Note: We are not creating a library here as Dart does not need it.
// Dart analzyer might complain about it though.
@ -195,7 +195,7 @@ class _DartEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisito
}
getBuiltinMethodName(method: o.BuiltinMethod): string {
var name;
var name: any /** TODO #9100 */;
switch (method) {
case o.BuiltinMethod.ConcatArray:
name = '.addAll';
@ -271,7 +271,7 @@ class _DartEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisito
return null;
}
visitBuiltintType(type: o.BuiltinType, ctx: EmitterVisitorContext): any {
var typeStr;
var typeStr: any /** TODO #9100 */;
switch (type.name) {
case o.BuiltinTypeName.Bool:
typeStr = 'bool';
@ -323,7 +323,7 @@ class _DartEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisito
}
private _visitParams(params: o.FnParam[], ctx: EmitterVisitorContext): void {
this.visitAllObjects((param) => {
this.visitAllObjects((param: any /** TODO #9100 */) => {
if (isPresent(param.type)) {
param.type.visitType(this, ctx);
ctx.print(' ');
@ -348,7 +348,7 @@ class _DartEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisito
ctx.print(value.name);
if (isPresent(typeParams) && typeParams.length > 0) {
ctx.print(`<`);
this.visitAllObjects((type) => type.visitType(this, ctx), typeParams, ctx, ',');
this.visitAllObjects((type: any /** TODO #9100 */) => type.visitType(this, ctx), typeParams, ctx, ',');
ctx.print(`>`);
}
}

View File

@ -31,7 +31,7 @@ export function getRelativePath(modulePath: string, importedPath: string): strin
var importedParts = importedPath.split(_PATH_SEP_RE);
var longestPrefix = getLongestPathSegmentPrefix(moduleParts, importedParts);
var resultParts = [];
var resultParts: any[] /** TODO #9100 */ = [];
var goParentCount = moduleParts.length - 1 - longestPrefix;
for (var i = 0; i < goParentCount; i++) {
resultParts.push('..');

View File

@ -18,7 +18,7 @@ export class JavaScriptEmitter implements OutputEmitter {
var converter = new JsEmitterVisitor(moduleUrl);
var ctx = EmitterVisitorContext.createRoot(exportedVars);
converter.visitAllStatements(stmts, ctx);
var srcParts = [];
var srcParts: any[] /** TODO #9100 */ = [];
converter.importsWithPrefixes.forEach((prefix, importedModuleUrl) => {
// Note: can't write the real word for import as it screws up system.js auto detection...
srcParts.push(

View File

@ -179,7 +179,7 @@ export enum BuiltinVar {
}
export class ReadVarExpr extends Expression {
public name;
public name: any /** TODO #9100 */;
public builtin: BuiltinVar;
constructor(name: string | BuiltinVar, type: Type = null) {

View File

@ -172,7 +172,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
visitInvokeMethodExpr(expr: o.InvokeMethodExpr, ctx: _ExecutionContext): any {
var receiver = expr.receiver.visitExpression(this, ctx);
var args = this.visitAllExpressions(expr.args, ctx);
var result;
var result: any /** TODO #9100 */;
if (isPresent(expr.builtin)) {
switch (expr.builtin) {
case o.BuiltinMethod.ConcatArray:
@ -324,7 +324,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
}
}
visitReadPropExpr(ast: o.ReadPropExpr, ctx: _ExecutionContext): any {
var result;
var result: any /** TODO #9100 */;
var receiver = ast.receiver.visitExpression(this, ctx);
if (isDynamicInstance(receiver)) {
var di = <DynamicInstance>receiver;
@ -352,7 +352,7 @@ class StatementInterpreter implements o.StatementVisitor, o.ExpressionVisitor {
}
visitLiteralMapExpr(ast: o.LiteralMapExpr, ctx: _ExecutionContext): any {
var result = {};
ast.entries.forEach((entry) => result[<string>entry[0]] =
ast.entries.forEach((entry) => (result as any /** TODO #9100 */)[<string>entry[0]] =
(<o.Expression>entry[1]).visitExpression(this, ctx));
return result;
}
@ -379,32 +379,32 @@ function _declareFn(varNames: string[], statements: o.Statement[], ctx: _Executi
case 0:
return () => _executeFunctionStatements(varNames, [], statements, ctx, visitor);
case 1:
return (d0) => _executeFunctionStatements(varNames, [d0], statements, ctx, visitor);
return (d0: any /** TODO #9100 */) => _executeFunctionStatements(varNames, [d0], statements, ctx, visitor);
case 2:
return (d0, d1) => _executeFunctionStatements(varNames, [d0, d1], statements, ctx, visitor);
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */) => _executeFunctionStatements(varNames, [d0, d1], statements, ctx, visitor);
case 3:
return (d0, d1, d2) =>
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */) =>
_executeFunctionStatements(varNames, [d0, d1, d2], statements, ctx, visitor);
case 4:
return (d0, d1, d2, d3) =>
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */) =>
_executeFunctionStatements(varNames, [d0, d1, d2, d3], statements, ctx, visitor);
case 5:
return (d0, d1, d2, d3, d4) => _executeFunctionStatements(varNames, [d0, d1, d2, d3, d4],
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */) => _executeFunctionStatements(varNames, [d0, d1, d2, d3, d4],
statements, ctx, visitor);
case 6:
return (d0, d1, d2, d3, d4, d5) => _executeFunctionStatements(
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */, d5: any /** TODO #9100 */) => _executeFunctionStatements(
varNames, [d0, d1, d2, d3, d4, d5], statements, ctx, visitor);
case 7:
return (d0, d1, d2, d3, d4, d5, d6) => _executeFunctionStatements(
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */, d5: any /** TODO #9100 */, d6: any /** TODO #9100 */) => _executeFunctionStatements(
varNames, [d0, d1, d2, d3, d4, d5, d6], statements, ctx, visitor);
case 8:
return (d0, d1, d2, d3, d4, d5, d6, d7) => _executeFunctionStatements(
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */, d5: any /** TODO #9100 */, d6: any /** TODO #9100 */, d7: any /** TODO #9100 */) => _executeFunctionStatements(
varNames, [d0, d1, d2, d3, d4, d5, d6, d7], statements, ctx, visitor);
case 9:
return (d0, d1, d2, d3, d4, d5, d6, d7, d8) => _executeFunctionStatements(
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */, d5: any /** TODO #9100 */, d6: any /** TODO #9100 */, d7: any /** TODO #9100 */, d8: any /** TODO #9100 */) => _executeFunctionStatements(
varNames, [d0, d1, d2, d3, d4, d5, d6, d7, d8], statements, ctx, visitor);
case 10:
return (d0, d1, d2, d3, d4, d5, d6, d7, d8, d9) => _executeFunctionStatements(
return (d0: any /** TODO #9100 */, d1: any /** TODO #9100 */, d2: any /** TODO #9100 */, d3: any /** TODO #9100 */, d4: any /** TODO #9100 */, d5: any /** TODO #9100 */, d6: any /** TODO #9100 */, d7: any /** TODO #9100 */, d8: any /** TODO #9100 */, d9: any /** TODO #9100 */) => _executeFunctionStatements(
varNames, [d0, d1, d2, d3, d4, d5, d6, d7, d8, d9], statements, ctx, visitor);
default:
throw new BaseException(

View File

@ -22,7 +22,7 @@ class JitEmitterVisitor extends AbstractJsEmitterVisitor {
getArgs(): {[key: string]: any} {
var result = {};
for (var i = 0; i < this._evalArgNames.length; i++) {
result[this._evalArgNames[i]] = this._evalArgValues[i];
(result as any /** TODO #9100 */)[this._evalArgNames[i]] = this._evalArgValues[i];
}
return result;
}

View File

@ -43,7 +43,7 @@ export class TypeScriptEmitter implements OutputEmitter {
var converter = new _TsEmitterVisitor(moduleUrl);
var ctx = EmitterVisitorContext.createRoot(exportedVars);
converter.visitAllStatements(stmts, ctx);
var srcParts = [];
var srcParts: any[] /** TODO #9100 */ = [];
converter.importsWithPrefixes.forEach((prefix, importedModuleUrl) => {
// Note: can't write the real word for import as it screws up system.js auto detection...
srcParts.push(
@ -208,7 +208,7 @@ class _TsEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisitor
}
visitBuiltintType(type: o.BuiltinType, ctx: EmitterVisitorContext): any {
var typeStr;
var typeStr: any /** TODO #9100 */;
switch (type.name) {
case o.BuiltinTypeName.Bool:
typeStr = 'boolean';
@ -251,7 +251,7 @@ class _TsEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisitor
}
getBuiltinMethodName(method: o.BuiltinMethod): string {
var name;
var name: any /** TODO #9100 */;
switch (method) {
case o.BuiltinMethod.ConcatArray:
name = 'concat';
@ -270,7 +270,7 @@ class _TsEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisitor
private _visitParams(params: o.FnParam[], ctx: EmitterVisitorContext): void {
this.visitAllObjects((param) => {
this.visitAllObjects((param: any /** TODO #9100 */) => {
ctx.print(param.name);
ctx.print(':');
this.visitType(param.type, ctx);
@ -293,7 +293,7 @@ class _TsEmitterVisitor extends AbstractEmitterVisitor implements o.TypeVisitor
ctx.print(value.name);
if (isPresent(typeParams) && typeParams.length > 0) {
ctx.print(`<`);
this.visitAllObjects((type) => type.visitType(this, ctx), typeParams, ctx, ',');
this.visitAllObjects((type: any /** TODO #9100 */) => type.visitType(this, ctx), typeParams, ctx, ',');
ctx.print(`>`);
}
}

View File

@ -162,7 +162,7 @@ export class ProviderElementContext {
var transformedProviders = resolvedProvider.providers.map((provider) => {
var transformedUseValue = provider.useValue;
var transformedUseExisting = provider.useExisting;
var transformedDeps;
var transformedDeps: any /** TODO #9100 */;
if (isPresent(provider.useExisting)) {
var existingDiDep = this._getDependency(
resolvedProvider.providerType,

View File

@ -101,7 +101,7 @@ export class RuntimeCompiler implements ComponentResolver {
this._templateParser.parse(compMeta, compMeta.template.template,
normalizedViewDirMetas, pipes, compMeta.type.name);
var childPromises = [];
var childPromises: any[] /** TODO #9100 */ = [];
compiledTemplate.init(this._compileComponent(compMeta, parsedTemplate, styles,
pipes, compilingComponentsPath, childPromises));
return PromiseWrapper.all(childPromises).then((_) => { return compiledTemplate; });
@ -140,7 +140,7 @@ export class RuntimeCompiler implements ComponentResolver {
childPromises.push(this._compiledTemplateDone.get(childCacheKey));
}
});
var factory;
var factory: any /** TODO #9100 */;
if (IS_DART || !this._genConfig.useJit) {
factory = interpretStatements(compileResult.statements, compileResult.viewFactoryVar,
new InterpretiveAppViewInstanceFactory());
@ -161,7 +161,7 @@ export class RuntimeCompiler implements ComponentResolver {
var promises = result.dependencies.map((dep) => this._loadStylesheetDep(dep));
return PromiseWrapper.all(promises)
.then((cssTexts) => {
var nestedCompileResultPromises = [];
var nestedCompileResultPromises: any[] /** TODO #9100 */ = [];
for (var i = 0; i < result.dependencies.length; i++) {
var dep = result.dependencies[i];
var cssText = cssTexts[i];
@ -202,7 +202,7 @@ class CompiledTemplate {
viewFactory: Function = null;
proxyViewFactory: Function;
constructor() {
this.proxyViewFactory = (viewUtils, childInjector, contextEl) =>
this.proxyViewFactory = (viewUtils: any /** TODO #9100 */, childInjector: any /** TODO #9100 */, contextEl: any /** TODO #9100 */) =>
this.viewFactory(viewUtils, childInjector, contextEl);
}

View File

@ -238,7 +238,7 @@ export class DomElementSchemaRegistry extends ElementSchemaRegistry {
typeName.split(',').forEach(tag => this.schema[tag] = type);
var superType = this.schema[typeParts[1]];
if (isPresent(superType)) {
StringMapWrapper.forEach(superType, (v, k) => type[k] = v);
StringMapWrapper.forEach(superType, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => type[k] = v);
}
properties.forEach((property: string) => {
if (property == '') {

View File

@ -33,7 +33,7 @@ export class CssSelector {
static parse(selector: string): CssSelector[] {
var results: CssSelector[] = [];
var _addResult = (res: CssSelector[], cssSel) => {
var _addResult = (res: CssSelector[], cssSel: any /** TODO #9100 */) => {
if (cssSel.notSelectors.length > 0 && isBlank(cssSel.element) &&
ListWrapper.isEmpty(cssSel.classNames) && ListWrapper.isEmpty(cssSel.attrs)) {
cssSel.element = "*";
@ -42,7 +42,7 @@ export class CssSelector {
};
var cssSelector = new CssSelector();
var matcher = RegExpWrapper.matcher(_SELECTOR_REGEXP, selector);
var match;
var match: any /** TODO #9100 */;
var current = cssSelector;
var inNot = false;
while (isPresent(match = RegExpMatcherWrapper.next(matcher))) {
@ -159,7 +159,7 @@ export class SelectorMatcher {
private _listContexts: SelectorListContext[] = [];
addSelectables(cssSelectors: CssSelector[], callbackCtxt?: any) {
var listContext = null;
var listContext: any /** TODO #9100 */ = null;
if (cssSelectors.length > 1) {
listContext = new SelectorListContext(cssSelectors);
this._listContexts.push(listContext);
@ -308,7 +308,7 @@ export class SelectorMatcher {
}
/** @internal */
_matchTerminal(map: Map<string, SelectorContext[]>, name, cssSelector: CssSelector,
_matchTerminal(map: Map<string, SelectorContext[]>, name: any /** TODO #9100 */, cssSelector: CssSelector,
matchedCallback: (c: CssSelector, a: any) => void): boolean {
if (isBlank(map) || isBlank(name)) {
return false;
@ -322,7 +322,7 @@ export class SelectorMatcher {
if (isBlank(selectables)) {
return false;
}
var selectable;
var selectable: any /** TODO #9100 */;
var result = false;
for (var index = 0; index < selectables.length; index++) {
selectable = selectables[index];
@ -332,8 +332,8 @@ export class SelectorMatcher {
}
/** @internal */
_matchPartial(map: Map<string, SelectorMatcher>, name, cssSelector: CssSelector,
matchedCallback /*: (c: CssSelector, a: any) => void*/): boolean {
_matchPartial(map: Map<string, SelectorMatcher>, name: any /** TODO #9100 */, cssSelector: CssSelector,
matchedCallback: any /** TODO #9100 */ /*: (c: CssSelector, a: any) => void*/): boolean {
if (isBlank(map) || isBlank(name)) {
return false;
}

View File

@ -175,7 +175,7 @@ export class ShadowCss {
private _insertPolyfillDirectivesInCssText(cssText: string): string {
// Difference with webcomponents.js: does not handle comments
return StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe,
function(m) { return m[1] + '{'; });
function(m: any /** TODO #9100 */) { return m[1] + '{'; });
}
/*
@ -195,7 +195,7 @@ export class ShadowCss {
**/
private _insertPolyfillRulesInCssText(cssText: string): string {
// Difference with webcomponents.js: does not handle comments
return StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m) {
return StringWrapper.replaceAllMapped(cssText, _cssContentRuleRe, function(m: any /** TODO #9100 */) {
var rule = m[0];
rule = StringWrapper.replace(rule, m[1], '');
rule = StringWrapper.replace(rule, m[2], '');
@ -241,7 +241,7 @@ export class ShadowCss {
**/
private _extractUnscopedRulesFromCssText(cssText: string): string {
// Difference with webcomponents.js: does not handle comments
var r = '', m;
var r = '', m: any /** TODO #9100 */;
var matcher = RegExpWrapper.matcher(_cssContentUnscopedRuleRe, cssText);
while (isPresent(m = RegExpMatcherWrapper.next(matcher))) {
var rule = m[0];
@ -285,9 +285,9 @@ export class ShadowCss {
private _convertColonRule(cssText: string, regExp: RegExp, partReplacer: Function): string {
// p1 = :host, p2 = contents of (), p3 rest of rule
return StringWrapper.replaceAllMapped(cssText, regExp, function(m) {
return StringWrapper.replaceAllMapped(cssText, regExp, function(m: any /** TODO #9100 */) {
if (isPresent(m[2])) {
var parts = m[2].split(','), r = [];
var parts = m[2].split(','), r: any[] /** TODO #9100 */ = [];
for (var i = 0; i < parts.length; i++) {
var p = parts[i];
if (isBlank(p)) break;
@ -341,7 +341,7 @@ export class ShadowCss {
private _scopeSelector(selector: string, scopeSelector: string, hostSelector: string,
strict: boolean): string {
var r = [], parts = selector.split(',');
var r: any[] /** TODO #9100 */ = [], parts = selector.split(',');
for (var i = 0; i < parts.length; i++) {
var p = parts[i].trim();
var deepParts = StringWrapper.split(p, _shadowDeepSelectors);
@ -392,7 +392,7 @@ export class ShadowCss {
// e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
private _applyStrictSelectorScope(selector: string, scopeSelector: string): string {
var isRe = /\[is=([^\]]*)\]/g;
scopeSelector = StringWrapper.replaceAllMapped(scopeSelector, isRe, (m) => m[1]);
scopeSelector = StringWrapper.replaceAllMapped(scopeSelector, isRe, (m: any /** TODO #9100 */) => m[1]);
var splits = [' ', '>', '+', '~'], scoped = selector, attrName = '[' + scopeSelector + ']';
for (var i = 0; i < splits.length; i++) {
var sep = splits[i];
@ -454,7 +454,7 @@ var _colonHostContextRe = /:host-context/gim;
var _commentRe = /\/\*[\s\S]*?\*\//g;
function stripComments(input:string):string {
return StringWrapper.replaceAllMapped(input, _commentRe, (_) => '');
return StringWrapper.replaceAllMapped(input, _commentRe, (_: any /** TODO #9100 */) => '');
}
var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
@ -470,7 +470,7 @@ export class CssRule {
export function processRules(input:string, ruleCallback:Function):string {
var inputWithEscapedBlocks = escapeBlocks(input);
var nextBlockIndex = 0;
return StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m) {
return StringWrapper.replaceAllMapped(inputWithEscapedBlocks.escapedString, _ruleRe, function(m: any /** TODO #9100 */) {
var selector = m[2];
var content = '';
var suffix = m[4];
@ -491,10 +491,10 @@ class StringWithEscapedBlocks {
function escapeBlocks(input:string):StringWithEscapedBlocks {
var inputParts = StringWrapper.split(input, _curlyRe);
var resultParts = [];
var escapedBlocks = [];
var resultParts: any[] /** TODO #9100 */ = [];
var escapedBlocks: any[] /** TODO #9100 */ = [];
var bracketCount = 0;
var currentBlockParts = [];
var currentBlockParts: any[] /** TODO #9100 */ = [];
for (var partIndex = 0; partIndex<inputParts.length; partIndex++) {
var part = inputParts[partIndex];
if (part == CLOSE_CURLY) {

View File

@ -43,7 +43,7 @@ export class StyleCompiler {
shim: boolean): StylesCompileResult {
var styleExpressions =
plainStyles.map(plainStyle => o.literal(this._shimIfNeeded(plainStyle, shim)));
var dependencies = [];
var dependencies: any[] /** TODO #9100 */ = [];
for (var i = 0; i < absUrls.length; i++) {
var identifier = new CompileIdentifierMetadata({name: getStylesVarName(null)});
dependencies.push(new StylesCompileDependency(absUrls[i], shim, identifier));

View File

@ -20,8 +20,8 @@ export function isStyleUrlResolvable(url: string): boolean {
*/
export function extractStyleUrls(resolver: UrlResolver, baseUrl: string,
cssText: string): StyleWithImports {
var foundUrls = [];
var modifiedCssText = StringWrapper.replaceAllMapped(cssText, _cssImportRe, (m) => {
var foundUrls: any[] /** TODO #9100 */ = [];
var modifiedCssText = StringWrapper.replaceAllMapped(cssText, _cssImportRe, (m: any /** TODO #9100 */) => {
var url = isPresent(m[1]) ? m[1] : m[2];
if (!isStyleUrlResolvable(url)) {
// Do not attempt to resolve non-package absolute URLs with URI scheme

View File

@ -244,7 +244,7 @@ export interface TemplateAstVisitor {
*/
export function templateVisitAll(visitor: TemplateAstVisitor, asts: TemplateAst[],
context: any = null): any[] {
var result = [];
var result: any[] /** TODO #9100 */ = [];
asts.forEach(ast => {
var astResult = ast.visit(visitor, context);
if (isPresent(astResult)) {

View File

@ -141,7 +141,7 @@ export class TemplateParser {
templateUrl: string): TemplateParseResult {
var htmlAstWithErrors = this._htmlParser.parse(template, templateUrl);
var errors:ParseError[] = htmlAstWithErrors.errors;
var result;
var result: any /** TODO #???? */;
if (htmlAstWithErrors.rootNodes.length > 0) {
var uniqDirectives = <CompileDirectiveMetadata[]>removeDuplicates(directives);
var uniqPipes = <CompilePipeMetadata[]>removeDuplicates(pipes);
@ -170,10 +170,10 @@ export class TemplateParser {
/** @internal */
_assertNoReferenceDuplicationOnTemplate(result:any[], errors:TemplateParseError[]):void {
const existingReferences = [];
const existingReferences: any[] /** TODO #???? */ = [];
result
.filter(element => !!element.references)
.forEach(element => element.references.forEach(reference=> {
.forEach(element => element.references.forEach((reference: any /** TODO #???? */)=> {
const name = reference.name;
if (existingReferences.indexOf(name) < 0) {
existingReferences.push(name);
@ -335,7 +335,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
var templateElementVars: VariableAst[] = [];
var hasInlineTemplates = false;
var attrs = [];
var attrs: any[] /** TODO #???? */ = [];
var lcElName = splitNsName(nodeName.toLowerCase())[1];
var isTemplateElement = lcElName == TEMPLATE_ELEMENT;
@ -377,7 +377,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
CssSelector.parse(preparsedElement.projectAs)[0] :
elementCssSelector;
var ngContentIndex = parent.findNgContentIndex(projectionSelector);
var parsedElement;
var parsedElement: any /** TODO #???? */;
if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
if (isPresent(element.children) && element.children.length > 0) {
@ -434,7 +434,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
private _parseInlineTemplateBinding(attr: HtmlAttrAst, targetMatchableAttrs: string[][],
targetProps: BoundElementOrDirectiveProperty[],
targetVars: VariableAst[]): boolean {
var templateBindingsSource = null;
var templateBindingsSource: any /** TODO #???? */ = null;
if (attr.name == TEMPLATE_ATTR) {
templateBindingsSource = attr.value;
} else if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) {
@ -667,7 +667,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
elOrDirRef.sourceSpan);
};
} else if (isBlank(component)) {
var refToken = null;
var refToken: any /** TODO #???? */ = null;
if (isTemplateElement) {
refToken = identifierToken(Identifiers.TemplateRef);
}
@ -744,8 +744,8 @@ class TemplateParseVisitor implements HtmlAstVisitor {
private _createElementPropertyAst(elementName: string, name: string, ast: AST,
sourceSpan: ParseSourceSpan): BoundElementPropertyAst {
var unit = null;
var bindingType;
var unit: any /** TODO #???? */ = null;
var bindingType: any /** TODO #???? */;
var boundPropertyName: string;
var parts = name.split(PROPERTY_PARTS_SEPARATOR);
let securityContext: SecurityContext;
@ -837,7 +837,7 @@ class TemplateParseVisitor implements HtmlAstVisitor {
var allDirectiveEvents = new Set<string>();
directives.forEach(directive => {
StringMapWrapper.forEach(directive.directive.outputs,
(eventName: string, _) => { allDirectiveEvents.add(eventName); });
(eventName: string, _: any /** TODO #???? */) => { allDirectiveEvents.add(eventName); });
});
events.forEach(event => {
if (isPresent(event.target) || !SetWrapper.has(allDirectiveEvents, event.name)) {
@ -897,7 +897,7 @@ class ElementContext {
static create(isTemplateElement: boolean, directives: DirectiveAst[],
providerContext: ProviderElementContext): ElementContext {
var matcher = new SelectorMatcher();
var wildcardNgContentIndex = null;
var wildcardNgContentIndex: any /** TODO #???? */ = null;
var component = directives.find(directive => directive.directive.isComponent);
if (isPresent(component)) {
var ngContentSelectors = component.directive.template.ngContentSelectors;
@ -917,7 +917,7 @@ class ElementContext {
public providerContext: ProviderElementContext) {}
findNgContentIndex(selector: CssSelector): number {
var ngContentIndices = [];
var ngContentIndices: any[] /** TODO #???? */ = [];
this._ngContentIndexMatcher.match(
selector, (selector, ngContentIndex) => { ngContentIndices.push(ngContentIndex); });
ListWrapper.sort(ngContentIndices);
@ -963,7 +963,7 @@ export class PipeCollector extends RecursiveAstVisitor {
}
function removeDuplicates(items: CompileMetadataWithType[]): CompileMetadataWithType[] {
let res = [];
let res: any[] /** TODO #???? */ = [];
items.forEach(item => {
let hasMatch =
res.filter(r => r.type.name == item.type.name && r.type.moduleUrl == item.type.moduleUrl &&

View File

@ -15,9 +15,9 @@ const NG_NON_BINDABLE_ATTR = 'ngNonBindable';
const NG_PROJECT_AS = 'ngProjectAs';
export function preparseElement(ast: HtmlElementAst): PreparsedElement {
var selectAttr = null;
var hrefAttr = null;
var relAttr = null;
var selectAttr: any /** TODO #9100 */ = null;
var hrefAttr: any /** TODO #9100 */ = null;
var relAttr: any /** TODO #9100 */ = null;
var nonBindable = false;
var projectAs: string = null;
ast.attrs.forEach(attr => {

View File

@ -105,7 +105,7 @@ export function getUrlScheme(url: string): string {
function _buildFromEncodedParts(opt_scheme?: string, opt_userInfo?: string, opt_domain?: string,
opt_port?: string, opt_path?: string, opt_queryData?: string,
opt_fragment?: string): string {
var out = [];
var out: any[] /** TODO #9100 */ = [];
if (isPresent(opt_scheme)) {
out.push(opt_scheme + ':');

View File

@ -16,12 +16,12 @@ var DASH_CASE_REGEXP = /-([a-z])/g;
export function camelCaseToDashCase(input: string): string {
return StringWrapper.replaceAllMapped(input, CAMEL_CASE_REGEXP,
(m) => { return '-' + m[1].toLowerCase(); });
(m: any /** TODO #9100 */) => { return '-' + m[1].toLowerCase(); });
}
export function dashCaseToCamelCase(input: string): string {
return StringWrapper.replaceAllMapped(input, DASH_CASE_REGEXP,
(m) => { return m[1].toUpperCase(); });
(m: any /** TODO #9100 */) => { return m[1].toUpperCase(); });
}
export function splitAtColon(input: string, defaultValues: string[]): string[] {
@ -63,7 +63,7 @@ export class ValueTransformer implements ValueVisitor {
visitStringMap(map: {[key: string]: any}, context: any): any {
var result = {};
StringMapWrapper.forEach(map,
(value, key) => { result[key] = visitValue(value, this, context); });
(value: any /** TODO #9100 */, key: any /** TODO #9100 */) => { (result as any /** TODO #9100 */)[key] = visitValue(value, this, context); });
return result;
}
visitPrimitive(value: any, context: any): any { return value; }

View File

@ -167,9 +167,9 @@ export class CompileElement extends CompileNode {
queriesWithReads,
queriesForProvider.map(query => new _QueryWithRead(query, resolvedProvider.token)));
});
StringMapWrapper.forEach(this.referenceTokens, (_, varName) => {
StringMapWrapper.forEach(this.referenceTokens, (_: any /** TODO #9100 */, varName: any /** TODO #9100 */) => {
var token = this.referenceTokens[varName];
var varValue;
var varValue: any /** TODO #9100 */;
if (isPresent(token)) {
varValue = this._instances.get(token);
} else {
@ -282,7 +282,7 @@ export class CompileElement extends CompileNode {
private _getLocalDependency(requestingProviderType: ProviderAstType,
dep: CompileDiDependencyMetadata): o.Expression {
var result = null;
var result: any /** TODO #9100 */ = null;
// constructor content query
if (isBlank(result) && isPresent(dep.query)) {
result = this._addQuery(dep.query, null).queryList;
@ -319,7 +319,7 @@ export class CompileElement extends CompileNode {
private _getDependency(requestingProviderType: ProviderAstType,
dep: CompileDiDependencyMetadata): o.Expression {
var currElement: CompileElement = this;
var result = null;
var result: any /** TODO #9100 */ = null;
if (dep.isValue) {
result = o.literal(dep.value);
}
@ -346,7 +346,7 @@ export class CompileElement extends CompileNode {
function createInjectInternalCondition(nodeIndex: number, childNodeCount: number,
provider: ProviderAst,
providerExpr: o.Expression): o.Statement {
var indexCondition;
var indexCondition: any /** TODO #9100 */;
if (childNodeCount > 0) {
indexCondition = o.literal(nodeIndex)
.lowerEquals(InjectMethodVars.requestNodeIndex)
@ -364,8 +364,8 @@ function createProviderProperty(propName: string, provider: ProviderAst,
providerValueExpressions: o.Expression[], isMulti: boolean,
isEager: boolean, compileElement: CompileElement): o.Expression {
var view = compileElement.view;
var resolvedProviderValueExpr;
var type;
var resolvedProviderValueExpr: any /** TODO #9100 */;
var type: any /** TODO #9100 */;
if (isMulti) {
resolvedProviderValueExpr = o.literalArr(providerValueExpressions);
type = new o.ArrayType(o.DYNAMIC_TYPE);
@ -410,9 +410,9 @@ class _ValueOutputAstTransformer extends ValueTransformer {
return o.literalArr(arr.map(value => visitValue(value, this, context)));
}
visitStringMap(map: {[key: string]: any}, context: any): o.Expression {
var entries = [];
var entries: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(
map, (value, key) => { entries.push([key, visitValue(value, this, context)]); });
map, (value: any /** TODO #9100 */, key: any /** TODO #9100 */) => { entries.push([key, visitValue(value, this, context)]); });
return o.literalMap(entries);
}
visitPrimitive(value: any, context: any): o.Expression { return o.literal(value); }

View File

@ -57,7 +57,7 @@ export class CompileQuery {
return !this._values.values.some(value => value instanceof ViewQueryValues);
}
afterChildren(targetStaticMethod, targetDynamicMethod: CompileMethod) {
afterChildren(targetStaticMethod: any /** TODO #9100 */, targetDynamicMethod: CompileMethod) {
var values = createQueryValues(this._values);
var updateStmts = [this.queryList.callMethod('reset', [o.literalArr(values)]).toStmt()];
if (isPresent(this.ownerDirectiveExpression)) {

View File

@ -84,7 +84,7 @@ export class CompileEventListener {
}
listenToRenderer() {
var listenExpr;
var listenExpr: any /** TODO #9100 */;
var eventListener = o.THIS_EXPR.callMethod(
'eventHandler',
[o.THIS_EXPR.prop(this._methodName).callMethod(o.BuiltinMethod.bind, [o.THIS_EXPR])]);
@ -139,7 +139,7 @@ export function collectEventListeners(hostEvents: BoundEventAst[], dirs: Directi
export function bindDirectiveOutputs(directiveAst: DirectiveAst, directiveInstance: o.Expression,
eventListeners: CompileEventListener[]) {
StringMapWrapper.forEach(directiveAst.directive.outputs, (eventName, observablePropName) => {
StringMapWrapper.forEach(directiveAst.directive.outputs, (eventName: any /** TODO #9100 */, observablePropName: any /** TODO #9100 */) => {
eventListeners.filter(listener => listener.eventName == eventName)
.forEach(
(listener) => { listener.listenToDirective(directiveInstance, observablePropName); });

View File

@ -29,7 +29,7 @@ export function convertCdExpressionToIr(
export function convertCdStatementToIr(nameResolver: NameResolver, implicitReceiver: o.Expression,
stmt: cdAst.AST): o.Statement[] {
var visitor = new _AstToIrVisitor(nameResolver, implicitReceiver, null);
var statements = [];
var statements: any[] /** TODO #9100 */ = [];
flattenStatements(stmt.visit(visitor, _Mode.Statement), statements);
return statements;
}
@ -66,7 +66,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
private _valueUnwrapper: o.ReadVarExpr) {}
visitBinary(ast: cdAst.Binary, mode: _Mode): any {
var op;
var op: any /** TODO #9100 */;
switch (ast.operation) {
case '+':
op = o.BinaryOperator.Plus;
@ -171,7 +171,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
mode, this._nameResolver.createLiteralArray(this.visitAll(ast.expressions, mode)));
}
visitLiteralMap(ast: cdAst.LiteralMap, mode: _Mode): any {
var parts = [];
var parts: any[] /** TODO #9100 */ = [];
for (var i = 0; i < ast.keys.length; i++) {
parts.push([ast.keys[i], ast.values[i].visit(this, _Mode.Expression)]);
}
@ -182,7 +182,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
}
visitMethodCall(ast: cdAst.MethodCall, mode: _Mode): any {
var args = this.visitAll(ast.args, _Mode.Expression);
var result = null;
var result: any /** TODO #9100 */ = null;
var receiver = ast.receiver.visit(this, _Mode.Expression);
if (receiver === IMPLICIT_RECEIVER) {
var varExpr = this._nameResolver.getLocal(ast.name);
@ -201,7 +201,7 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
return convertToStatementIfNeeded(mode, o.not(ast.expression.visit(this, _Mode.Expression)));
}
visitPropertyRead(ast: cdAst.PropertyRead, mode: _Mode): any {
var result = null;
var result: any /** TODO #9100 */ = null;
var receiver = ast.receiver.visit(this, _Mode.Expression);
if (receiver === IMPLICIT_RECEIVER) {
result = this._nameResolver.getLocal(ast.name);

View File

@ -97,7 +97,7 @@ function bindAndWriteToRenderer(boundProps: BoundElementPropertyAst[], context:
var renderMethod: string;
var oldRenderValue: o.Expression = sanitizedValue(boundProp, fieldExpr);
var renderValue: o.Expression = sanitizedValue(boundProp, currValExpr);
var updateStmts = [];
var updateStmts: any[] /** TODO #9100 */ = [];
switch (boundProp.type) {
case PropertyBindingType.Property:
if (view.genConfig.logBindingUpdate) {

View File

@ -63,7 +63,7 @@ export function createDiTokenExpression(token: CompileTokenMetadata): o.Expressi
}
export function createFlatArray(expressions: o.Expression[]): o.Expression {
var lastNonArrayExpressions = [];
var lastNonArrayExpressions: any[] /** TODO #9100 */ = [];
var result: o.Expression = o.literalArr([]);
for (var i = 0; i < expressions.length; i++) {
var expr = expressions[i];

View File

@ -179,7 +179,7 @@ class ViewBuilderVisitor implements TemplateAstVisitor {
visitElement(ast: ElementAst, parent: CompileElement): any {
var nodeIndex = this.view.nodes.length;
var createRenderNodeExpr;
var createRenderNodeExpr: any /** TODO #9100 */;
var debugContextExpr = this.view.createMethod.resetDebugInfoExpr(nodeIndex, ast);
if (nodeIndex === 0 && this.view.viewType === ViewType.HOST) {
createRenderNodeExpr = o.THIS_EXPR.callMethod(
@ -234,7 +234,7 @@ class ViewBuilderVisitor implements TemplateAstVisitor {
compileElement.afterChildren(this.view.nodes.length - nodeIndex - 1);
if (isPresent(compViewExpr)) {
var codeGenContentNodes;
var codeGenContentNodes: any /** TODO #9100 */;
if (this.view.component.type.isHost) {
codeGenContentNodes = ViewProperties.projectableNodes;
} else {
@ -304,9 +304,9 @@ class ViewBuilderVisitor implements TemplateAstVisitor {
function _mergeHtmlAndDirectiveAttrs(declaredHtmlAttrs: {[key: string]: string},
directives: CompileDirectiveMetadata[]): string[][] {
var result: {[key: string]: string} = {};
StringMapWrapper.forEach(declaredHtmlAttrs, (value, key) => { result[key] = value; });
StringMapWrapper.forEach(declaredHtmlAttrs, (value: any /** TODO #9100 */, key: any /** TODO #9100 */) => { result[key] = value; });
directives.forEach(directiveMeta => {
StringMapWrapper.forEach(directiveMeta.hostAttributes, (value, name) => {
StringMapWrapper.forEach(directiveMeta.hostAttributes, (value: any /** TODO #9100 */, name: any /** TODO #9100 */) => {
var prevValue = result[name];
result[name] = isPresent(prevValue) ? mergeAttributeValue(name, prevValue, value) : value;
});
@ -329,12 +329,12 @@ function mergeAttributeValue(attrName: string, attrValue1: string, attrValue2: s
}
function mapToKeyValueArray(data: {[key: string]: string}): string[][] {
var entryArray = [];
StringMapWrapper.forEach(data, (value, name) => { entryArray.push([name, value]); });
var entryArray: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(data, (value: any /** TODO #9100 */, name: any /** TODO #9100 */) => { entryArray.push([name, value]); });
// We need to sort to get a defined output order
// for tests and for caching generated artifacts...
ListWrapper.sort(entryArray, (entry1, entry2) => StringWrapper.compare(entry1[0], entry2[0]));
var keyValueArray = [];
var keyValueArray: any[] /** TODO #9100 */ = [];
entryArray.forEach((entry) => { keyValueArray.push([entry[0], entry[1]]); });
return keyValueArray;
}
@ -369,13 +369,13 @@ function createStaticNodeDebugInfo(node: CompileNode): o.Expression {
var compileElement = node instanceof CompileElement ? node : null;
var providerTokens: o.Expression[] = [];
var componentToken: o.Expression = o.NULL_EXPR;
var varTokenEntries = [];
var varTokenEntries: any[] /** TODO #9100 */ = [];
if (isPresent(compileElement)) {
providerTokens = compileElement.getProviderTokens();
if (isPresent(compileElement.component)) {
componentToken = createDiTokenExpression(identifierToken(compileElement.component.type));
}
StringMapWrapper.forEach(compileElement.referenceTokens, (token, varName) => {
StringMapWrapper.forEach(compileElement.referenceTokens, (token: any /** TODO #9100 */, varName: any /** TODO #9100 */) => {
varTokenEntries.push(
[varName, isPresent(token) ? createDiTokenExpression(token) : o.NULL_EXPR]);
});
@ -446,8 +446,8 @@ function createViewFactory(view: CompileView, viewClass: o.ClassStmt,
new o.FnParam(ViewConstructorVars.parentInjector.name, o.importType(Identifiers.Injector)),
new o.FnParam(ViewConstructorVars.declarationEl.name, o.importType(Identifiers.AppElement))
];
var initRenderCompTypeStmts = [];
var templateUrlInfo;
var initRenderCompTypeStmts: any[] /** TODO #9100 */ = [];
var templateUrlInfo: any /** TODO #9100 */;
if (view.component.template.templateUrl == view.component.type.moduleUrl) {
templateUrlInfo =
`${view.component.type.moduleUrl} class ${view.component.type.name} - inline template`;
@ -483,7 +483,7 @@ function createViewFactory(view: CompileView, viewClass: o.ClassStmt,
function generateCreateMethod(view: CompileView): o.Statement[] {
var parentRenderNodeExpr: o.Expression = o.NULL_EXPR;
var parentRenderNodeStmts = [];
var parentRenderNodeStmts: any[] /** TODO #9100 */ = [];
if (view.viewType === ViewType.COMPONENT) {
parentRenderNodeExpr = ViewProperties.renderer.callMethod(
'createViewRoot', [o.THIS_EXPR.prop('declarationAppElement').prop('nativeElement')]);
@ -513,7 +513,7 @@ function generateCreateMethod(view: CompileView): o.Statement[] {
}
function generateDetectChangesMethod(view: CompileView): o.Statement[] {
var stmts = [];
var stmts: any[] /** TODO #9100 */ = [];
if (view.detectChangesInInputsMethod.isEmpty() && view.updateContentQueriesMethod.isEmpty() &&
view.afterContentLifecycleCallbacksMethod.isEmpty() &&
view.detectChangesRenderPropertiesMethod.isEmpty() &&
@ -538,7 +538,7 @@ function generateDetectChangesMethod(view: CompileView): o.Statement[] {
stmts.push(new o.IfStmt(o.not(DetectChangesVars.throwOnChange), afterViewStmts));
}
var varStmts = [];
var varStmts: any[] /** TODO #9100 */ = [];
var readVars = o.findReadVarNames(stmts);
if (SetWrapper.has(readVars, DetectChangesVars.changed.name)) {
varStmts.push(DetectChangesVars.changed.set(o.literal(true)).toDeclStmt(o.BOOL_TYPE));

View File

@ -22,9 +22,9 @@ export class ViewCompiler {
compileComponent(component: CompileDirectiveMetadata, template: TemplateAst[],
styles: o.Expression, pipes: CompilePipeMetadata[]): ViewCompileResult {
var dependencies = [];
var dependencies: any[] /** TODO #9100 */ = [];
var compiledAnimations = this._animationCompiler.compileComponent(component);
var statements = [];
var statements: any[] /** TODO #9100 */ = [];
compiledAnimations.map(entry => {
statements.push(entry.statesMapStatement);
statements.push(entry.fnStatement);

View File

@ -25,7 +25,7 @@ import {CompileMetadataResolver} from '../../src/metadata_resolver';
export function main() {
describe('RuntimeAnimationCompiler', () => {
var resolver;
var resolver: any /** TODO #9100 */;
beforeEach(inject([CompileMetadataResolver], (res: CompileMetadataResolver) => {
resolver = res;
}));

View File

@ -52,7 +52,7 @@ export function main() {
describe('parseAnimationEntry', () => {
var combineStyles = (styles: AnimationStylesAst): {[key: string]: string | number} => {
var flatStyles: {[key: string]: string | number} = {};
styles.styles.forEach(entry => StringMapWrapper.forEach(entry, (val, prop) => { flatStyles[prop] = val; }));
styles.styles.forEach(entry => StringMapWrapper.forEach(entry, (val: any /** TODO #9100 */, prop: any /** TODO #9100 */) => { flatStyles[prop] = val; }));
return flatStyles;
};
@ -62,7 +62,7 @@ export function main() {
var collectStepStyles = (step: AnimationStepAst): Array<{[key: string]: string | number}> => {
var keyframes = step.keyframes;
var styles = [];
var styles: any[] /** TODO #9100 */ = [];
if (step.startingStyles.styles.length > 0) {
styles.push(combineStyles(step.startingStyles));
}
@ -70,7 +70,7 @@ export function main() {
return styles;
};
var resolver;
var resolver: any /** TODO #9100 */;
beforeEach(inject([CompileMetadataResolver], (res: CompileMetadataResolver) => {
resolver = res;
}));

View File

@ -20,12 +20,12 @@ import {
} from '@angular/compiler/src/css/lexer';
export function main() {
function tokenize(code, trackComments: boolean = false,
function tokenize(code: any /** TODO #9100 */, trackComments: boolean = false,
mode: CssLexerMode = CssLexerMode.ALL): CssToken[] {
var scanner = new CssLexer().scan(code, trackComments);
scanner.setMode(mode);
var tokens = [];
var tokens: any[] /** TODO #9100 */ = [];
var output = scanner.scan();
while (output != null) {
var error = output.error;
@ -280,7 +280,7 @@ export function main() {
it('should throw an error if a selector is being parsed while in the wrong mode', () => {
var cssCode = ".class > tag";
var capturedMessage;
var capturedMessage: any /** TODO #9100 */;
try {
tokenize(cssCode, false, CssLexerMode.STYLE_BLOCK);
} catch (e) {
@ -304,7 +304,7 @@ export function main() {
describe('Attribute Mode', () => {
it('should consider attribute selectors as valid input and throw when an invalid modifier is used',
() => {
function tokenizeAttr(modifier) {
function tokenizeAttr(modifier: any /** TODO #9100 */) {
var cssCode = "value" + modifier + "='something'";
return tokenize(cssCode, false, CssLexerMode.ATTRIBUTE_SELECTOR);
}
@ -322,7 +322,7 @@ export function main() {
describe('Media Query Mode', () => {
it('should validate media queries with a reduced subset of valid characters', () => {
function tokenizeQuery(code) { return tokenize(code, false, CssLexerMode.MEDIA_QUERY); }
function tokenizeQuery(code: any /** TODO #9100 */) { return tokenize(code, false, CssLexerMode.MEDIA_QUERY); }
// the reason why the numbers are so high is because MediaQueries keep
// track of the whitespace values
@ -341,7 +341,7 @@ export function main() {
describe('Pseudo Selector Mode', () => {
it('should validate pseudo selector identifiers with a reduced subset of valid characters',
() => {
function tokenizePseudo(code) {
function tokenizePseudo(code: any /** TODO #9100 */) {
return tokenize(code, false, CssLexerMode.PSEUDO_SELECTOR);
}
@ -358,7 +358,7 @@ export function main() {
describe('Pseudo Selector Mode', () => {
it('should validate pseudo selector identifiers with a reduced subset of valid characters',
() => {
function tokenizePseudo(code) {
function tokenizePseudo(code: any /** TODO #9100 */) {
return tokenize(code, false, CssLexerMode.PSEUDO_SELECTOR);
}
@ -374,7 +374,7 @@ export function main() {
describe('Style Block Mode', () => {
it('should style blocks with a reduced subset of valid characters', () => {
function tokenizeStyles(code) { return tokenize(code, false, CssLexerMode.STYLE_BLOCK); }
function tokenizeStyles(code: any /** TODO #9100 */) { return tokenize(code, false, CssLexerMode.STYLE_BLOCK); }
expect(tokenizeStyles(`
key: value;

View File

@ -33,7 +33,7 @@ import {
import {CssLexer} from '@angular/compiler/src/css/lexer';
export function assertTokens(tokens, valuesArr) {
export function assertTokens(tokens: any /** TODO #9100 */, valuesArr: any /** TODO #9100 */) {
for (var i = 0; i < tokens.length; i++) {
expect(tokens[i].strValue == valuesArr[i]);
}
@ -41,14 +41,14 @@ export function assertTokens(tokens, valuesArr) {
export function main() {
describe('CssParser', () => {
function parse(css): ParsedCssResult {
function parse(css: any /** TODO #9100 */): ParsedCssResult {
var lexer = new CssLexer();
var scanner = lexer.scan(css);
var parser = new CssParser(scanner, 'some-fake-file-name.css');
return parser.parse();
}
function makeAST(css): CssStyleSheetAST {
function makeAST(css: any /** TODO #9100 */): CssStyleSheetAST {
var output = parse(css);
var errors = output.errors;
if (errors.length > 0) {

View File

@ -37,7 +37,7 @@ import {
import {CssLexer} from '@angular/compiler/src/css/lexer';
function _assertTokens(tokens, valuesArr) {
function _assertTokens(tokens: any /** TODO #9100 */, valuesArr: any /** TODO #9100 */) {
for (var i = 0; i < tokens.length; i++) {
expect(tokens[i].strValue == valuesArr[i]);
}
@ -46,16 +46,16 @@ function _assertTokens(tokens, valuesArr) {
class MyVisitor implements CssASTVisitor {
captures: {[key: string]: any[]} = {};
_capture(method, ast, context) {
_capture(method: any /** TODO #9100 */, ast: any /** TODO #9100 */, context: any /** TODO #9100 */) {
this.captures[method] = isPresent(this.captures[method]) ? this.captures[method] : [];
this.captures[method].push([ast, context]);
}
constructor(ast: CssStyleSheetAST, context?: any) { ast.visit(this, context); }
visitCssValue(ast, context?: any): void { this._capture("visitCssValue", ast, context); }
visitCssValue(ast: any /** TODO #9100 */, context?: any): void { this._capture("visitCssValue", ast, context); }
visitInlineCssRule(ast, context?: any): void {
visitInlineCssRule(ast: any /** TODO #9100 */, context?: any): void {
this._capture("visitInlineCssRule", ast, context);
}
@ -118,7 +118,7 @@ export function main() {
}
describe('CSS parsing and visiting', () => {
var ast;
var ast: any /** TODO #9100 */;
var context = {};
beforeEach(() => {

View File

@ -113,7 +113,7 @@ export function main() {
class DirectiveNoHooks {}
class DirectiveWithOnChangesMethod {
ngOnChanges(_) {}
ngOnChanges(_: any /** TODO #9100 */) {}
}
class DirectiveWithOnInitMethod {

View File

@ -36,7 +36,7 @@ export function main() {
describe('inline template', () => {
it('should store the template',
inject([AsyncTestCompleter, DirectiveNormalizer],
(async, normalizer: DirectiveNormalizer) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer) => {
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
template: 'a',
@ -53,7 +53,7 @@ export function main() {
it('should resolve styles on the annotation against the moduleUrl',
inject([AsyncTestCompleter, DirectiveNormalizer],
(async, normalizer: DirectiveNormalizer) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer) => {
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
template: '',
@ -69,7 +69,7 @@ export function main() {
it('should resolve styles in the template against the moduleUrl',
inject([AsyncTestCompleter, DirectiveNormalizer],
(async, normalizer: DirectiveNormalizer) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer) => {
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
template: '<style>@import test.css</style>',
@ -85,7 +85,7 @@ export function main() {
it('should use ViewEncapsulation.Emulated by default',
inject([AsyncTestCompleter, DirectiveNormalizer],
(async, normalizer: DirectiveNormalizer) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer) => {
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
template: '',
@ -101,7 +101,7 @@ export function main() {
it('should use default encapsulation provided by CompilerConfig',
inject([AsyncTestCompleter, CompilerConfig , DirectiveNormalizer],
(async, config: CompilerConfig, normalizer: DirectiveNormalizer) => {
(async: any /** TODO #9100 */, config: CompilerConfig, normalizer: DirectiveNormalizer) => {
config.defaultEncapsulation = ViewEncapsulation.None;
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
@ -121,7 +121,7 @@ export function main() {
it('should load a template from a url that is resolved against moduleUrl',
inject([AsyncTestCompleter, DirectiveNormalizer, XHR],
(async, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
xhr.expect('package:some/module/sometplurl.html', 'a');
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
@ -141,7 +141,7 @@ export function main() {
it('should resolve styles on the annotation against the moduleUrl',
inject([AsyncTestCompleter, DirectiveNormalizer, XHR],
(async, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
xhr.expect('package:some/module/tpl/sometplurl.html', '');
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({
encapsulation: null,
@ -159,7 +159,7 @@ export function main() {
it('should resolve styles in the template against the templateUrl',
inject([AsyncTestCompleter, DirectiveNormalizer, XHR],
(async, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
(async: any /** TODO #9100 */, normalizer: DirectiveNormalizer, xhr: MockXHR) => {
xhr.expect('package:some/module/tpl/sometplurl.html',
'<style>@import test.css</style>');
normalizer.normalizeTemplate(dirType, new CompileTemplateMetadata({

View File

@ -27,22 +27,22 @@ class SomeChildDirective extends SomeDirective {
@Directive({selector: 'someDirective', inputs: ['c']})
class SomeDirectiveWithInputs {
@Input() a;
@Input("renamed") b;
c;
@Input() a: any /** TODO #9100 */;
@Input("renamed") b: any /** TODO #9100 */;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', outputs: ['c']})
class SomeDirectiveWithOutputs {
@Output() a;
@Output("renamed") b;
c;
@Output() a: any /** TODO #9100 */;
@Output("renamed") b: any /** TODO #9100 */;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', outputs: ['a']})
class SomeDirectiveWithDuplicateOutputs {
@Output() a;
@Output() a: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', properties: ['a']})
@ -56,23 +56,23 @@ class SomeDirectiveWithEvents {
@Directive({selector: 'someDirective'})
class SomeDirectiveWithSetterProps {
@Input("renamed")
set a(value) {
set a(value: any /** TODO #9100 */) {
}
}
@Directive({selector: 'someDirective'})
class SomeDirectiveWithGetterOutputs {
@Output("renamed")
get a() {
get a(): any /** TODO #9100 */ {
return null;
}
}
@Directive({selector: 'someDirective', host: {'[c]': 'c'}})
class SomeDirectiveWithHostBindings {
@HostBinding() a;
@HostBinding("renamed") b;
c;
@HostBinding() a: any /** TODO #9100 */;
@HostBinding("renamed") b: any /** TODO #9100 */;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', host: {'(c)': 'onC()'}})
@ -81,32 +81,32 @@ class SomeDirectiveWithHostListeners {
onA() {
}
@HostListener('b', ['$event.value'])
onB(value) {
onB(value: any /** TODO #9100 */) {
}
}
@Directive({selector: 'someDirective', queries: {"cs": new ContentChildren("c")}})
class SomeDirectiveWithContentChildren {
@ContentChildren("a") as: any;
c;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', queries: {"cs": new ViewChildren("c")}})
class SomeDirectiveWithViewChildren {
@ViewChildren("a") as: any;
c;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', queries: {"c": new ContentChild("c")}})
class SomeDirectiveWithContentChild {
@ContentChild("a") a: any;
c;
c: any /** TODO #9100 */;
}
@Directive({selector: 'someDirective', queries: {"c": new ViewChild("c")}})
class SomeDirectiveWithViewChild {
@ViewChild("a") a: any;
c;
c: any /** TODO #9100 */;
}
class SomeDirectiveWithoutMetadata {}

View File

@ -8,41 +8,41 @@ function lex(text: string): any[] {
return new Lexer().tokenize(text);
}
function expectToken(token, index) {
function expectToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */) {
expect(token instanceof Token).toBe(true);
expect(token.index).toEqual(index);
}
function expectCharacterToken(token, index, character) {
function expectCharacterToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, character: any /** TODO #9100 */) {
expect(character.length).toBe(1);
expectToken(token, index);
expect(token.isCharacter(StringWrapper.charCodeAt(character, 0))).toBe(true);
}
function expectOperatorToken(token, index, operator) {
function expectOperatorToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, operator: any /** TODO #9100 */) {
expectToken(token, index);
expect(token.isOperator(operator)).toBe(true);
}
function expectNumberToken(token, index, n) {
function expectNumberToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, n: any /** TODO #9100 */) {
expectToken(token, index);
expect(token.isNumber()).toBe(true);
expect(token.toNumber()).toEqual(n);
}
function expectStringToken(token, index, str) {
function expectStringToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, str: any /** TODO #9100 */) {
expectToken(token, index);
expect(token.isString()).toBe(true);
expect(token.toString()).toEqual(str);
}
function expectIdentifierToken(token, index, identifier) {
function expectIdentifierToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, identifier: any /** TODO #9100 */) {
expectToken(token, index);
expect(token.isIdentifier()).toBe(true);
expect(token.toString()).toEqual(identifier);
}
function expectKeywordToken(token, index, keyword) {
function expectKeywordToken(token: any /** TODO #9100 */, index: any /** TODO #9100 */, keyword: any /** TODO #9100 */) {
expectToken(token, index);
expect(token.isKeyword()).toBe(true);
expect(token.toString()).toEqual(keyword);

View File

@ -8,23 +8,23 @@ import {BindingPipe, LiteralPrimitive, AST} from '@angular/compiler/src/expressi
export function main() {
function createParser() { return new Parser(new Lexer()); }
function parseAction(text, location = null): any {
function parseAction(text: any /** TODO #9100 */, location: any /** TODO #9100 */ = null): any {
return createParser().parseAction(text, location);
}
function parseBinding(text, location = null): any {
function parseBinding(text: any /** TODO #9100 */, location: any /** TODO #9100 */ = null): any {
return createParser().parseBinding(text, location);
}
function parseTemplateBindings(text, location = null): any {
function parseTemplateBindings(text: any /** TODO #9100 */, location: any /** TODO #9100 */ = null): any {
return createParser().parseTemplateBindings(text, location).templateBindings;
}
function parseInterpolation(text, location = null): any {
function parseInterpolation(text: any /** TODO #9100 */, location: any /** TODO #9100 */ = null): any {
return createParser().parseInterpolation(text, location);
}
function parseSimpleBinding(text, location = null): any {
function parseSimpleBinding(text: any /** TODO #9100 */, location: any /** TODO #9100 */ = null): any {
return createParser().parseSimpleBinding(text, location);
}
@ -48,9 +48,9 @@ export function main() {
expect(unparse(ast)).toEqual(expected);
}
function expectActionError(text) { return expect(() => parseAction(text)); }
function expectActionError(text: any /** TODO #9100 */) { return expect(() => parseAction(text)); }
function expectBindingError(text) { return expect(() => parseBinding(text)); }
function expectBindingError(text: any /** TODO #9100 */) { return expect(() => parseBinding(text)); }
describe("parser", () => {
describe("parseAction", () => {

View File

@ -18,7 +18,7 @@ export function main() {
let htmlParser = new HtmlParser();
let msgs = '';
StringMapWrapper.forEach(messages, (v, k) => msgs += `<msg id="${k}">${v}</msg>`);
StringMapWrapper.forEach(messages, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => msgs += `<msg id="${k}">${v}</msg>`);
let res = deserializeXmb(`<message-bundle>${msgs}</message-bundle>`, 'someUrl');
return new I18nHtmlParser(htmlParser, parser, res.content, res.messages, implicitTags,

View File

@ -43,7 +43,7 @@ export function main() {
var injector: Injector;
var sharedStylesHost: SharedStylesHost;
beforeEach(inject([Injector, SharedStylesHost], (_injector, _sharedStylesHost) => {
beforeEach(inject([Injector, SharedStylesHost], (_injector: any /** TODO #9100 */, _sharedStylesHost: any /** TODO #9100 */) => {
injector = _injector;
sharedStylesHost = _sharedStylesHost;
}));

View File

@ -26,7 +26,7 @@ import {
export function
main() {
var outputDefs = [];
var outputDefs: any[] /** TODO #9100 */ = [];
outputDefs.push({
'getExpressions': () => interpretStatements(codegenStmts, 'getExpressions',
new DynamicClassInstanceFactory()),
@ -50,7 +50,7 @@ import {
describe('output emitter', () => {
outputDefs.forEach((outputDef) => {
describe(`${outputDef['name']}`, () => {
var expressions;
var expressions: any /** TODO #9100 */;
beforeEach(() => { expressions = outputDef['getExpressions']()(); });
it('should support literals', () => {
@ -116,8 +116,8 @@ import {
});
describe('operators', () => {
var ops;
var aObj, bObj;
var ops: any /** TODO #9100 */;
var aObj: any /** TODO #9100 */, bObj: any /** TODO #9100 */;
beforeEach(() => {
ops = expressions['operators'];
aObj = new Object();

View File

@ -10,7 +10,7 @@ import * as o from '@angular/compiler/src/output/output_ast';
export class ExternalClass {
changeable: any;
constructor(public data: any) { this.changeable = data; }
someMethod(a) { return {'param': a, 'data': this.data}; }
someMethod(a: any /** TODO #9100 */) { return {'param': a, 'data': this.data}; }
}
var testDataIdentifier = new CompileIdentifierMetadata({
@ -271,5 +271,5 @@ class _InterpretiveDynamicClass extends ExternalClass implements DynamicInstance
public getters: Map<string, Function>, public methods: Map<string, Function>) {
super(args[0]);
}
childMethod(a) { return this.methods.get('childMethod')(a); }
childMethod(a: any /** TODO #9100 */) { return this.methods.get('childMethod')(a); }
}

View File

@ -2,16 +2,16 @@ import {isString, isPresent} from '../../src/facade/lang';
const SVG_PREFIX = ':svg:';
var document = typeof global['document'] == 'object' ? global['document'] : null;
var document = typeof (global as any /** TODO #???? */)['document'] == 'object' ? (global as any /** TODO #???? */)['document'] : null;
export function extractSchema(): Map<string, string[]> {
var SVGGraphicsElement = global['SVGGraphicsElement'];
var SVGAnimationElement = global['SVGAnimationElement'];
var SVGGeometryElement = global['SVGGeometryElement'];
var SVGComponentTransferFunctionElement = global['SVGComponentTransferFunctionElement'];
var SVGGradientElement = global['SVGGradientElement'];
var SVGTextContentElement = global['SVGTextContentElement'];
var SVGTextPositioningElement = global['SVGTextPositioningElement'];
var SVGGraphicsElement = (global as any /** TODO #???? */)['SVGGraphicsElement'];
var SVGAnimationElement = (global as any /** TODO #???? */)['SVGAnimationElement'];
var SVGGeometryElement = (global as any /** TODO #???? */)['SVGGeometryElement'];
var SVGComponentTransferFunctionElement = (global as any /** TODO #???? */)['SVGComponentTransferFunctionElement'];
var SVGGradientElement = (global as any /** TODO #???? */)['SVGGradientElement'];
var SVGTextContentElement = (global as any /** TODO #???? */)['SVGTextContentElement'];
var SVGTextPositioningElement = (global as any /** TODO #???? */)['SVGTextPositioningElement'];
if (!document || !SVGGraphicsElement) return null;
var descMap: Map<string, string[]> = new Map();
var visited: {[name: string]: boolean} = {};
@ -44,7 +44,7 @@ export function extractSchema(): Map<string, string[]> {
var keys = Object.getOwnPropertyNames(window).filter(
k => k.endsWith('Element') && (k.startsWith('HTML') || k.startsWith('SVG')));
keys.sort();
keys.forEach(name => extractRecursiveProperties(visited, descMap, window[name]));
keys.forEach(name => extractRecursiveProperties(visited, descMap, (window as any /** TODO #???? */)[name]));
return descMap;
}

View File

@ -6,7 +6,7 @@ import {el} from '@angular/platform-browser/testing';
export function main() {
describe('SelectorMatcher', () => {
var matcher, selectableCollector, s1, s2, s3, s4;
var matcher: any /** TODO #9100 */, selectableCollector: any /** TODO #9100 */, s1: any /** TODO #9100 */, s2: any /** TODO #9100 */, s3: any /** TODO #9100 */, s4: any /** TODO #9100 */;
var matched: any[];
function reset() { matched = []; }
@ -14,7 +14,7 @@ export function main() {
beforeEach(() => {
reset();
s1 = s2 = s3 = s4 = null;
selectableCollector = (selector, context) => {
selectableCollector = (selector: any /** TODO #9100 */, context: any /** TODO #9100 */) => {
matched.push(selector);
matched.push(context);
};

View File

@ -186,8 +186,8 @@ export function main() {
describe('processRules', () => {
describe('parse rules', () => {
function captureRules(input: string): CssRule[] {
var result = [];
processRules(input, (cssRule) => {
var result: any[] /** TODO #9100 */ = [];
processRules(input, (cssRule: any /** TODO #9100 */) => {
result.push(cssRule);
return cssRule;
});
@ -216,13 +216,13 @@ export function main() {
describe('modify rules', () => {
it('should allow to change the selector while preserving whitespaces', () => {
expect(processRules('@import a; b {c {d}} e {f}',
(cssRule) => new CssRule(cssRule.selector + '2', cssRule.content)))
(cssRule: any /** TODO #9100 */) => new CssRule(cssRule.selector + '2', cssRule.content)))
.toEqual('@import a2; b2 {c {d}} e2 {f}');
});
it('should allow to change the content', () => {
expect(processRules('a {b}',
(cssRule) => new CssRule(cssRule.selector, cssRule.content + '2')))
(cssRule: any /** TODO #9100 */) => new CssRule(cssRule.selector, cssRule.content + '2')))
.toEqual('a {b2}');
});
});

View File

@ -5,7 +5,7 @@ import {UrlResolver} from '@angular/compiler/src/url_resolver';
export function main() {
describe('extractStyleUrls', () => {
var urlResolver;
var urlResolver: any /** TODO #9100 */;
beforeEach(() => { urlResolver = new UrlResolver(); });

View File

@ -71,7 +71,7 @@ var MOCK_SCHEMA_REGISTRY = [
let zeConsole = console;
export function main() {
var ngIf;
var ngIf: any /** TODO #9100 */;
var parse:
(template: string, directives: CompileDirectiveMetadata[], pipes?: CompilePipeMetadata[]) =>
TemplateAst[];
@ -82,7 +82,7 @@ export function main() {
console = new ArrayConsole();
return [{provide: Console, useValue: console}];
});
beforeEach(inject([TemplateParser], (parser) => {
beforeEach(inject([TemplateParser], (parser: any /** TODO #9100 */) => {
var component = CompileDirectiveMetadata.create({
selector: 'root',
type: new CompileTypeMetadata({moduleUrl: someModuleUrl, name: 'Root'}),
@ -518,10 +518,10 @@ export function main() {
});
describe('providers', () => {
var nextProviderId;
var nextProviderId: any /** TODO #9100 */;
function createToken(value: string): CompileTokenMetadata {
var token;
var token: any /** TODO #9100 */;
if (value.startsWith('type:')) {
token = new CompileTokenMetadata({
identifier:
@ -1071,7 +1071,7 @@ Reference "#a" is defined several times ("<div #a></div><div [ERROR ->]#a></div>
});
describe('content projection', () => {
var compCounter;
var compCounter: any /** TODO #9100 */;
beforeEach(() => { compCounter = 0; });
function createComp(selector: string,

View File

@ -21,7 +21,7 @@ import {
export function main() {
describe('preparseElement', () => {
var htmlParser;
var htmlParser: any /** TODO #9100 */;
beforeEach(inject([HtmlParser], (_htmlParser: HtmlParser) => { htmlParser = _htmlParser; }));
function preparse(html: string): PreparsedElement {

View File

@ -192,7 +192,7 @@ class DirectiveListComp {
export function main() {
describe('test component builder', function() {
it('should instantiate a component with valid DOM',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(ChildComp).then((componentFixture) => {
componentFixture.detectChanges();
@ -203,7 +203,7 @@ export function main() {
}));
it('should allow changing members of the component',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyIfComp).then((componentFixture) => {
componentFixture.detectChanges();
@ -218,7 +218,7 @@ export function main() {
}));
it('should override a template',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(MockChildComp, '<span>Mock</span>')
.createAsync(MockChildComp)
@ -231,7 +231,7 @@ export function main() {
}));
it('should override a view',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(ChildComp,
new ViewMetadata({template: '<span>Modified {{childBinding}}</span>'}))
@ -245,7 +245,7 @@ export function main() {
}));
it('should override component dependencies',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideDirective(ParentComp, ChildComp, MockChildComp)
.createAsync(ParentComp)
@ -258,7 +258,7 @@ export function main() {
}));
it('should override items from a list',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideDirective(DirectiveListComp, ListDir1, ListDir1Alt)
.createAsync(DirectiveListComp)
@ -271,7 +271,7 @@ export function main() {
}));
it("should override child component's dependencies",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideDirective(ParentComp, ChildComp, ChildWithChildComp)
.overrideDirective(ChildWithChildComp, ChildChildComp, MockChildChildComp)
@ -286,7 +286,7 @@ export function main() {
}));
it('should override a provider',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideProviders(TestBindingsComp,
[{provide: FancyService, useClass: MockFancyService}])
@ -301,7 +301,7 @@ export function main() {
it('should override a viewBinding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideViewProviders(TestViewBindingsComp,
[{provide: FancyService, useClass: MockFancyService}])
@ -318,7 +318,7 @@ export function main() {
describe('ComponentFixture', () => {
it('should auto detect changes if autoDetectChanges is called',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AutoDetectComp)
.then((componentFixture) => {
@ -338,7 +338,7 @@ export function main() {
it('should auto detect changes if ComponentFixtureAutoDetect is provided as true',
withProviders(() => [{provide: ComponentFixtureAutoDetect, useValue: true}])
.inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AutoDetectComp)
.then((componentFixture) => {
@ -354,7 +354,7 @@ export function main() {
it('should signal through whenStable when the fixture is stable (autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncComp).then((componentFixture) => {
componentFixture.autoDetectChanges();
@ -377,7 +377,7 @@ export function main() {
it('should signal through isStable when the fixture is stable (no autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncComp).then((componentFixture) => {
componentFixture.detectChanges();
@ -401,7 +401,7 @@ export function main() {
it('should wait for macroTask(setTimeout) while checking for whenStable ' +
'(autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncTimeoutComp)
.then((componentFixture) => {
@ -426,7 +426,7 @@ export function main() {
it('should wait for macroTask(setTimeout) while checking for whenStable ' +
'(no autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncTimeoutComp)
.then((componentFixture) => {
@ -452,7 +452,7 @@ export function main() {
it('should wait for nested macroTasks(setTimeout) while checking for whenStable ' +
'(autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(NestedAsyncTimeoutComp)
.then((componentFixture) => {
@ -477,7 +477,7 @@ export function main() {
it('should wait for nested macroTasks(setTimeout) while checking for whenStable ' +
'(no autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(NestedAsyncTimeoutComp)
.then((componentFixture) => {
@ -502,7 +502,7 @@ export function main() {
it('should stabilize after async task in change detection (autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncChangeComp)
.then((componentFixture) => {
@ -523,7 +523,7 @@ export function main() {
it('should stabilize after async task in change detection(no autoDetectChanges)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(AsyncChangeComp)
.then((componentFixture) => {
@ -554,7 +554,7 @@ export function main() {
it('calling autoDetectChanges raises an error', () => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.createAsync(ChildComp).then((componentFixture) => {
expect(() => {
componentFixture.autoDetectChanges();
@ -566,7 +566,7 @@ export function main() {
it('should instantiate a component with valid DOM',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(ChildComp).then((componentFixture) => {
expect(componentFixture.ngZone).toBeNull();
@ -578,7 +578,7 @@ export function main() {
it('should allow changing members of the component',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyIfComp).then((componentFixture) => {
componentFixture.detectChanges();
@ -596,7 +596,7 @@ export function main() {
describe('createSync', () => {
it('should create components',
inject([ComponentResolver, TestComponentBuilder, AsyncTestCompleter],
(cr: ComponentResolver, tcb: TestComponentBuilder, async) => {
(cr: ComponentResolver, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
cr.resolveComponent(MyIfComp).then((cmpFactory) => {
let componentFixture = tcb.createSync(cmpFactory);

View File

@ -18,7 +18,7 @@ export function main() {
beforeEach(() => { xhr = new MockXHR(); });
function expectResponse(request: Promise<string>, url: string, response: string, done = null) {
function expectResponse(request: Promise<string>, url: string, response: string, done: any /** TODO #9100 */ = null) {
function onResponse(text: string): string {
if (response === null) {
throw `Unexpected response ${url} -> ${text}`;
@ -42,7 +42,7 @@ export function main() {
PromiseWrapper.then(request, onResponse, onError);
}
it('should return a response from the definitions', inject([AsyncTestCompleter], (async) => {
it('should return a response from the definitions', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var url = '/foo';
var response = 'bar';
xhr.when(url, response);
@ -50,15 +50,15 @@ export function main() {
xhr.flush();
}));
it('should return an error from the definitions', inject([AsyncTestCompleter], (async) => {
it('should return an error from the definitions', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var url = '/foo';
var response = null;
var response: any /** TODO #9100 */ = null;
xhr.when(url, response);
expectResponse(xhr.get(url), url, response, () => async.done());
xhr.flush();
}));
it('should return a response from the expectations', inject([AsyncTestCompleter], (async) => {
it('should return a response from the expectations', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var url = '/foo';
var response = 'bar';
xhr.expect(url, response);
@ -66,9 +66,9 @@ export function main() {
xhr.flush();
}));
it('should return an error from the expectations', inject([AsyncTestCompleter], (async) => {
it('should return an error from the expectations', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var url = '/foo';
var response = null;
var response: any /** TODO #9100 */ = null;
xhr.expect(url, response);
expectResponse(xhr.get(url), url, response, () => async.done());
xhr.flush();
@ -83,7 +83,7 @@ export function main() {
expect(() => { xhr.flush(); }).toThrowError('Unexpected request /foo');
});
it('should return expectations before definitions', inject([AsyncTestCompleter], (async) => {
it('should return expectations before definitions', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
var url = '/foo';
xhr.when(url, 'when');
xhr.expect(url, 'expect');

View File

@ -75,10 +75,10 @@ export class ComponentFixture<T> {
private _isStable: boolean = true;
private _completer: PromiseCompleter<any> = null;
private _onUnstableSubscription = null;
private _onStableSubscription = null;
private _onMicrotaskEmptySubscription = null;
private _onErrorSubscription = null;
private _onUnstableSubscription: any /** TODO #9100 */ = null;
private _onStableSubscription: any /** TODO #9100 */ = null;
private _onMicrotaskEmptySubscription: any /** TODO #9100 */ = null;
private _onErrorSubscription: any /** TODO #9100 */ = null;
constructor(componentRef: ComponentRef<T>, ngZone: NgZone, autoDetect: boolean) {
this.changeDetectorRef = componentRef.changeDetectorRef;
@ -368,8 +368,8 @@ export class TestComponentBuilder {
}
createFakeAsync(rootComponentType: Type): ComponentFixture<any> {
let result;
let error;
let result: any /** TODO #9100 */;
let error: any /** TODO #9100 */;
PromiseWrapper.then(this.createAsync(rootComponentType), (_result) => { result = _result; },
(_error) => { error = _error; });
tick();

View File

@ -71,7 +71,7 @@ export class MockViewResolver extends ViewResolver {
view = super.resolve(component);
}
var directives = [];
var directives: any[] /** TODO #9100 */ = [];
if (isPresent(view.directives)) {
flattenArray(view.directives, directives);
}

View File

@ -61,7 +61,7 @@ export class MockXHR extends XHR {
verifyNoOutstandingExpectations() {
if (this._expectations.length === 0) return;
var urls = [];
var urls: any[] /** TODO #9100 */ = [];
for (var i = 0; i < this._expectations.length; i++) {
var expectation = this._expectations[i];
urls.push(expectation.url);
@ -96,7 +96,7 @@ class _PendingRequest {
url: string;
completer: PromiseCompleter<string>;
constructor(url) {
constructor(url: any /** TODO #9100 */) {
this.url = url;
this.completer = PromiseWrapper.completer();
}

View File

@ -18,8 +18,8 @@ export class ActiveAnimationPlayersMap {
}
findAllPlayersByElement(element: any): AnimationPlayer[] {
var players = [];
StringMapWrapper.forEach(this._map.get(element), player => players.push(player));
var players: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(this._map.get(element), (player: any /** TODO #9100 */) => players.push(player));
return players;
}

View File

@ -55,7 +55,7 @@ export class AnimationGroupPlayer implements AnimationPlayer {
reset(): void { this._players.forEach(player => player.reset()); }
setPosition(p): void {
setPosition(p: any /** TODO #9100 */): void {
this._players.forEach(player => {
player.setPosition(p);
});

View File

@ -9,7 +9,7 @@ export abstract class AnimationPlayer {
abstract finish(): void;
abstract destroy(): void;
abstract reset(): void;
abstract setPosition(p): void;
abstract setPosition(p: any /** TODO #9100 */): void;
abstract getPosition(): number;
get parentPlayer(): AnimationPlayer { throw new BaseException('NOT IMPLEMENTED: Base Class'); }
set parentPlayer(player: AnimationPlayer) { throw new BaseException('NOT IMPLEMENTED: Base Class'); }
@ -17,7 +17,7 @@ export abstract class AnimationPlayer {
export class NoOpAnimationPlayer implements AnimationPlayer {
private _subscriptions = [];
private _subscriptions: any[] /** TODO #9100 */ = [];
public parentPlayer: AnimationPlayer = null;
constructor() {
scheduleMicroTask(() => this._onFinish());
@ -36,6 +36,6 @@ export class NoOpAnimationPlayer implements AnimationPlayer {
}
destroy(): void {}
reset(): void {}
setPosition(p): void {}
setPosition(p: any /** TODO #9100 */): void {}
getPosition(): number { return 0; }
}

Some files were not shown because too many files have changed in this diff Show More