diff --git a/modules/angular2/directives.ts b/modules/angular2/directives.ts index 0206a2daf42823..cd7df147dc733d 100644 --- a/modules/angular2/directives.ts +++ b/modules/angular2/directives.ts @@ -60,5 +60,5 @@ export * from './src/core/directives/ng_switch'; * ``` * */ -export const CORE_DIRECTIVES: List = +export const CORE_DIRECTIVES: Array = CONST_EXPR([NgClass, NgFor, NgIf, NgNonBindable, NgSwitch, NgSwitchWhen, NgSwitchDefault]); diff --git a/modules/angular2/forms.ts b/modules/angular2/forms.ts index 238df34a153ca5..2797153577de4e 100644 --- a/modules/angular2/forms.ts +++ b/modules/angular2/forms.ts @@ -39,4 +39,4 @@ export {FormBuilder} from './src/forms/form_builder'; import {FormBuilder} from './src/forms/form_builder'; import {CONST_EXPR, Type} from './src/core/facade/lang'; -export const FORM_BINDINGS: List = CONST_EXPR([FormBuilder]); +export const FORM_BINDINGS: Array = CONST_EXPR([FormBuilder]); diff --git a/modules/angular2/globals.d.ts b/modules/angular2/globals.d.ts index a0f11f9223022c..9e1b5c315148a9 100644 --- a/modules/angular2/globals.d.ts +++ b/modules/angular2/globals.d.ts @@ -5,11 +5,9 @@ /// declare var assert: any; -interface List extends Array {} - // FIXME: K must be string! // FIXME: should have an index signature, `[k: string]: V;` -interface StringMap {} +interface StringMap {} interface BrowserNodeGlobal { Object: typeof Object; diff --git a/modules/angular2/http.ts b/modules/angular2/http.ts index d0c7673ef67cb6..5fe783592e0b10 100644 --- a/modules/angular2/http.ts +++ b/modules/angular2/http.ts @@ -62,7 +62,7 @@ export {EventEmitter, Observable} from './src/core/facade/async'; * ``` * */ -export const HTTP_BINDINGS: List = [ +export const HTTP_BINDINGS: Array = [ // TODO(pascal): use factory type annotations once supported in DI // issue: https://github.com/angular/angular/issues/3183 bind(Http) @@ -74,7 +74,7 @@ export const HTTP_BINDINGS: List = [ XHRBackend ]; -export const JSONP_BINDINGS: List = [ +export const JSONP_BINDINGS: Array = [ // TODO(pascal): use factory type annotations once supported in DI // issue: https://github.com/angular/angular/issues/3183 bind(Jsonp) diff --git a/modules/angular2/router.ts b/modules/angular2/router.ts index 5399e740b4e90d..2059d3197a7fe8 100644 --- a/modules/angular2/router.ts +++ b/modules/angular2/router.ts @@ -35,11 +35,10 @@ import {Location} from './src/router/location'; import {APP_COMPONENT} from './src/core/application_tokens'; import {Binding} from './di'; import {CONST_EXPR} from './src/core/facade/lang'; -import {List} from './src/core/facade/collection'; -export const ROUTER_DIRECTIVES: List = CONST_EXPR([RouterOutlet, RouterLink]); +export const ROUTER_DIRECTIVES: Array = CONST_EXPR([RouterOutlet, RouterLink]); -export const ROUTER_BINDINGS: List = CONST_EXPR([ +export const ROUTER_BINDINGS: Array = CONST_EXPR([ RouteRegistry, Pipeline, CONST_EXPR(new Binding(LocationStrategy, {toClass: PathLocationStrategy})), diff --git a/modules/angular2/src/compiler/html_parser.ts b/modules/angular2/src/compiler/html_parser.ts index beea26d27a2d33..654da009370362 100644 --- a/modules/angular2/src/compiler/html_parser.ts +++ b/modules/angular2/src/compiler/html_parser.ts @@ -1,4 +1,3 @@ -import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import { isPresent, StringWrapper, @@ -56,8 +55,8 @@ function parseAttrs(element: Element, elementSourceInfo: string): HtmlAttrAst[] // in DOM parsers! var attrMap = DOM.attributeMap(element); var attrList: string[][] = []; - MapWrapper.forEach(attrMap, (value, name) => { attrList.push([name, value]); }); - ListWrapper.sort(attrList, (entry1, entry2) => StringWrapper.compare(entry1[0], entry2[0])); + attrMap.forEach((value, name) => attrList.push([name, value])); + attrList.sort((entry1, entry2) => StringWrapper.compare(entry1[0], entry2[0])); return attrList.map(entry => parseAttr(element, elementSourceInfo, entry[0], entry[1])); } diff --git a/modules/angular2/src/core/application_common.ts b/modules/angular2/src/core/application_common.ts index 74816e7cf4212d..ff88f0d35b4ec9 100644 --- a/modules/angular2/src/core/application_common.ts +++ b/modules/angular2/src/core/application_common.ts @@ -33,7 +33,7 @@ import {StyleInliner} from 'angular2/src/core/render/dom/compiler/style_inliner' import {ViewResolver} from './compiler/view_resolver'; import {DirectiveResolver} from './compiler/directive_resolver'; import {PipeResolver} from './compiler/pipe_resolver'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper, PromiseCompleter} from 'angular2/src/core/facade/async'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle'; @@ -84,7 +84,7 @@ var _rootInjector: Injector; // Contains everything that is safe to share between applications. var _rootBindings = [bind(Reflector).toValue(reflector), TestabilityRegistry]; -function _injectorBindings(appComponentType): List> { +function _injectorBindings(appComponentType): Array> { var bestChangeDetection = new DynamicChangeDetection(); if (PreGeneratedChangeDetection.isSupported()) { bestChangeDetection = new PreGeneratedChangeDetection(); @@ -290,9 +290,9 @@ export function createNgZone(): NgZone { * * Returns a `Promise` of {@link ApplicationRef}. */ -export function commonBootstrap( - appComponentType: /*Type*/ any, - componentInjectableBindings: List> = null): Promise { +export function commonBootstrap(appComponentType: /*Type*/ any, + componentInjectableBindings: Array> = + null): Promise { BrowserDomAdapter.makeCurrent(); wtfInit(); var bootstrapProcess = PromiseWrapper.completer(); @@ -338,7 +338,7 @@ export function commonBootstrap( return bootstrapProcess.promise; } -function _createAppInjector(appComponentType: Type, bindings: List>, +function _createAppInjector(appComponentType: Type, bindings: Array>, zone: NgZone): Injector { if (isBlank(_rootInjector)) _rootInjector = Injector.resolveAndCreate(_rootBindings); var mergedBindings: any[] = diff --git a/modules/angular2/src/core/change_detection/abstract_change_detector.ts b/modules/angular2/src/core/change_detection/abstract_change_detector.ts index 7b3df9c7b0a702..8d79cab16bd31a 100644 --- a/modules/angular2/src/core/change_detection/abstract_change_detector.ts +++ b/modules/angular2/src/core/change_detection/abstract_change_detector.ts @@ -1,5 +1,5 @@ import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ChangeDetectionUtil} from './change_detection_util'; import {ChangeDetectorRef} from './change_detector_ref'; import {DirectiveIndex} from './directive_record'; @@ -25,8 +25,8 @@ class _Context { } export class AbstractChangeDetector implements ChangeDetector { - lightDomChildren: List = []; - shadowDomChildren: List = []; + lightDomChildren: Array = []; + shadowDomChildren: Array = []; parent: ChangeDetector; ref: ChangeDetectorRef; diff --git a/modules/angular2/src/core/change_detection/change_detection.ts b/modules/angular2/src/core/change_detection/change_detection.ts index 0644e3188b2dae..449ecf11ee0aec 100644 --- a/modules/angular2/src/core/change_detection/change_detection.ts +++ b/modules/angular2/src/core/change_detection/change_detection.ts @@ -12,7 +12,7 @@ import { ChangeDetectorGenConfig } from './interfaces'; import {Injector, Inject, Injectable, OpaqueToken, Optional, Binding} from 'angular2/di'; -import {List, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { CONST, CONST_EXPR, diff --git a/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts b/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts index ef2378ac0a53a7..f76622e13ccb18 100644 --- a/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts +++ b/modules/angular2/src/core/change_detection/change_detection_jit_generator.ts @@ -1,5 +1,5 @@ import {BaseException, Type, isBlank, isPresent} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {AbstractChangeDetector} from './abstract_change_detector'; import {ChangeDetectionUtil} from './change_detection_util'; @@ -36,8 +36,8 @@ export class ChangeDetectorJITGenerator { _typeName: string; constructor(private id: string, private changeDetectionStrategy: ChangeDetectionStrategy, - private records: List, private propertyBindingTargets: BindingTarget[], - private eventBindings: EventBinding[], private directiveRecords: List, + private records: Array, private propertyBindingTargets: BindingTarget[], + private eventBindings: EventBinding[], private directiveRecords: Array, private genConfig: ChangeDetectorGenConfig) { this._names = new CodegenNameUtil(this.records, this.eventBindings, this.directiveRecords, UTIL); diff --git a/modules/angular2/src/core/change_detection/change_detection_util.ts b/modules/angular2/src/core/change_detection/change_detection_util.ts index 043ed685078a3b..d9f23dfe7d6854 100644 --- a/modules/angular2/src/core/change_detection/change_detection_util.ts +++ b/modules/angular2/src/core/change_detection/change_detection_util.ts @@ -6,7 +6,7 @@ import { Type, StringWrapper } from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {ProtoRecord} from './proto_record'; import {ChangeDetectionStrategy, isDefaultChangeDetectionStrategy} from './constants'; import {implementsOnDestroy} from './pipe_lifecycle_reflector'; @@ -128,7 +128,7 @@ export class ChangeDetectionUtil { static operation_logical_or(left, right): any { return left || right; } static cond(cond, trueVal, falseVal): any { return cond ? trueVal : falseVal; } - static mapFn(keys: List): any { + static mapFn(keys: Array): any { function buildMap(values): StringMap { var res = StringMapWrapper.create(); for (var i = 0; i < keys.length; ++i) { diff --git a/modules/angular2/src/core/change_detection/coalesce.ts b/modules/angular2/src/core/change_detection/coalesce.ts index b22f1df9b91b6b..dee18da1b6ae38 100644 --- a/modules/angular2/src/core/change_detection/coalesce.ts +++ b/modules/angular2/src/core/change_detection/coalesce.ts @@ -1,5 +1,5 @@ import {isPresent, isBlank, looseIdentical} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, Map} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map} from 'angular2/src/core/facade/collection'; import {RecordType, ProtoRecord} from './proto_record'; /** @@ -13,7 +13,7 @@ import {RecordType, ProtoRecord} from './proto_record'; * replaced with very cheap SELF records. */ export function coalesce(records: ProtoRecord[]): ProtoRecord[] { - var res: List = []; + var res: Array = []; var indexMap: Map = new Map(); for (var i = 0; i < records.length; ++i) { @@ -48,7 +48,7 @@ function _selfRecord(r: ProtoRecord, contextIndex: number, selfIndex: number): P r.lastInDirective, false, false, r.propertyBindingIndex); } -function _findMatching(r: ProtoRecord, rs: List) { +function _findMatching(r: ProtoRecord, rs: Array) { return ListWrapper.find( rs, (rr) => rr.mode !== RecordType.DirectiveLifecycle && _sameDirIndex(rr, r) && rr.mode === r.mode && looseIdentical(rr.funcOrValue, r.funcOrValue) && diff --git a/modules/angular2/src/core/change_detection/codegen_facade.ts b/modules/angular2/src/core/change_detection/codegen_facade.ts index d593e11daa7dce..2ff2cad549a3ba 100644 --- a/modules/angular2/src/core/change_detection/codegen_facade.ts +++ b/modules/angular2/src/core/change_detection/codegen_facade.ts @@ -1,4 +1,3 @@ -import {List} from 'angular2/src/core/facade/collection'; /** * Converts `funcOrValue` to a string which can be used in generated code. diff --git a/modules/angular2/src/core/change_detection/codegen_name_util.ts b/modules/angular2/src/core/change_detection/codegen_name_util.ts index ca352501b99324..efcf33b877a6c4 100644 --- a/modules/angular2/src/core/change_detection/codegen_name_util.ts +++ b/modules/angular2/src/core/change_detection/codegen_name_util.ts @@ -1,5 +1,5 @@ import {RegExpWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, Map} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Map} from 'angular2/src/core/facade/collection'; import {DirectiveIndex} from './directive_record'; @@ -41,11 +41,11 @@ export class CodegenNameUtil { * Record names sanitized for use as fields. * See [sanitizeName] for details. */ - _sanitizedNames: List; - _sanitizedEventNames: Map>; + _sanitizedNames: Array; + _sanitizedEventNames: Map>; - constructor(private records: List, private eventBindings: EventBinding[], - private directiveRecords: List, private utilName: string) { + constructor(private records: Array, private eventBindings: EventBinding[], + private directiveRecords: Array, private utilName: string) { this._sanitizedNames = ListWrapper.createFixedSize(this.records.length + 1); this._sanitizedNames[CONTEXT_INDEX] = _CONTEXT_ACCESSOR; for (var i = 0, iLen = this.records.length; i < iLen; ++i) { @@ -135,7 +135,7 @@ export class CodegenNameUtil { getFieldName(idx: number): string { return this._addFieldPrefix(this._sanitizedNames[idx]); } - getAllFieldNames(): List { + getAllFieldNames(): Array { var fieldList = []; for (var k = 0, kLen = this.getFieldCount(); k < kLen; ++k) { if (k === 0 || this.records[k - 1].shouldBeChecked()) { diff --git a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts index a2b100c2e848dd..7b32340fc1dfa9 100644 --- a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts +++ b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts @@ -5,7 +5,7 @@ import { FunctionWrapper, StringWrapper } from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {AbstractChangeDetector} from './abstract_change_detector'; import {EventBinding} from './event_binding'; @@ -18,10 +18,10 @@ import {ChangeDetectionStrategy} from './constants'; import {ProtoRecord, RecordType} from './proto_record'; export class DynamicChangeDetector extends AbstractChangeDetector { - values: List; - changes: List; - localPipes: List; - prevContexts: List; + values: Array; + changes: Array; + localPipes: Array; + prevContexts: Array; directives: any = null; constructor(id: string, dispatcher: any, numberOfPropertyProtoRecords: number, diff --git a/modules/angular2/src/core/change_detection/interfaces.ts b/modules/angular2/src/core/change_detection/interfaces.ts index 9f00c3f50dd847..4e795f4f549613 100644 --- a/modules/angular2/src/core/change_detection/interfaces.ts +++ b/modules/angular2/src/core/change_detection/interfaces.ts @@ -1,4 +1,3 @@ -import {List} from 'angular2/src/core/facade/collection'; import {CONST} from 'angular2/src/core/facade/lang'; import {Locals} from './parser/locals'; import {BindingTarget, BindingRecord} from './binding_record'; @@ -82,7 +81,7 @@ export class ChangeDetectorGenConfig { export class ChangeDetectorDefinition { constructor(public id: string, public strategy: ChangeDetectionStrategy, - public variableNames: List, public bindingRecords: BindingRecord[], + public variableNames: Array, public bindingRecords: BindingRecord[], public eventRecords: BindingRecord[], public directiveRecords: DirectiveRecord[], public genConfig: ChangeDetectorGenConfig) {} } diff --git a/modules/angular2/src/core/change_detection/parser/ast.ts b/modules/angular2/src/core/change_detection/parser/ast.ts index 7dbe59c35f18f5..48ba82256b8f34 100644 --- a/modules/angular2/src/core/change_detection/parser/ast.ts +++ b/modules/angular2/src/core/change_detection/parser/ast.ts @@ -1,5 +1,5 @@ import {isBlank, isPresent, FunctionWrapper, BaseException} from "angular2/src/core/facade/lang"; -import {List, Map, ListWrapper, StringMapWrapper} from "angular2/src/core/facade/collection"; +import {Map, ListWrapper, StringMapWrapper} from "angular2/src/core/facade/collection"; export class AST { visit(visitor: AstVisitor): any { return null; } @@ -20,7 +20,7 @@ export class ImplicitReceiver extends AST { * Multiple expressions separated by a semicolon. */ export class Chain extends AST { - constructor(public expressions: List) { super(); } + constructor(public expressions: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitChain(this); } } @@ -63,7 +63,7 @@ export class KeyedWrite extends AST { } export class BindingPipe extends AST { - constructor(public exp: AST, public name: string, public args: List) { super(); } + constructor(public exp: AST, public name: string, public args: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitPipe(this); } } @@ -74,17 +74,17 @@ export class LiteralPrimitive extends AST { } export class LiteralArray extends AST { - constructor(public expressions: List) { super(); } + constructor(public expressions: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitLiteralArray(this); } } export class LiteralMap extends AST { - constructor(public keys: List, public values: List) { super(); } + constructor(public keys: Array, public values: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitLiteralMap(this); } } export class Interpolation extends AST { - constructor(public strings: List, public expressions: List) { super(); } + constructor(public strings: Array, public expressions: Array) { super(); } visit(visitor: AstVisitor) { visitor.visitInterpolation(this); } } @@ -100,7 +100,7 @@ export class PrefixNot extends AST { export class MethodCall extends AST { constructor(public receiver: AST, public name: string, public fn: Function, - public args: List) { + public args: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitMethodCall(this); } @@ -108,14 +108,14 @@ export class MethodCall extends AST { export class SafeMethodCall extends AST { constructor(public receiver: AST, public name: string, public fn: Function, - public args: List) { + public args: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitSafeMethodCall(this); } } export class FunctionCall extends AST { - constructor(public target: AST, public args: List) { super(); } + constructor(public target: AST, public args: Array) { super(); } visit(visitor: AstVisitor): any { return visitor.visitFunctionCall(this); } } @@ -222,7 +222,7 @@ export class RecursiveAstVisitor implements AstVisitor { ast.receiver.visit(this); return this.visitAll(ast.args); } - visitAll(asts: List): any { + visitAll(asts: Array): any { ListWrapper.forEach(asts, (ast) => { ast.visit(this); }); return null; } @@ -294,7 +294,7 @@ export class AstTransformer implements AstVisitor { return new KeyedWrite(ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this)); } - visitAll(asts: List): List { + visitAll(asts: Array): Array { var res = ListWrapper.createFixedSize(asts.length); for (var i = 0; i < asts.length; ++i) { res[i] = asts[i].visit(this); diff --git a/modules/angular2/src/core/change_detection/parser/lexer.ts b/modules/angular2/src/core/change_detection/parser/lexer.ts index 3f56ac7f9bf8ea..28c7aeddee1b95 100644 --- a/modules/angular2/src/core/change_detection/parser/lexer.ts +++ b/modules/angular2/src/core/change_detection/parser/lexer.ts @@ -1,5 +1,5 @@ import {Injectable} from 'angular2/src/core/di/decorators'; -import {List, ListWrapper, SetWrapper} from "angular2/src/core/facade/collection"; +import {ListWrapper, SetWrapper} from "angular2/src/core/facade/collection"; import { NumberWrapper, StringJoiner, @@ -19,7 +19,7 @@ export enum TokenType { @Injectable() export class Lexer { - tokenize(text: string): List { + tokenize(text: string): Array { var scanner = new _Scanner(text); var tokens = []; var token = scanner.scanToken(); diff --git a/modules/angular2/src/core/change_detection/parser/parser.ts b/modules/angular2/src/core/change_detection/parser/parser.ts index 40e571fdf1b42d..da379fb7851925 100644 --- a/modules/angular2/src/core/change_detection/parser/parser.ts +++ b/modules/angular2/src/core/change_detection/parser/parser.ts @@ -1,6 +1,6 @@ import {Injectable} from 'angular2/src/core/di/decorators'; import {isBlank, isPresent, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; -import {ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import { Lexer, EOF, @@ -85,7 +85,7 @@ export class Parser { return new ASTWithSource(ast, input, location); } - parseTemplateBindings(input: string, location: any): List { + parseTemplateBindings(input: string, location: any): Array { var tokens = this._lexer.tokenize(input); return new _ParseAST(input, location, tokens, this._reflector, false).parseTemplateBindings(); } @@ -141,7 +141,7 @@ export class Parser { export class _ParseAST { index: number = 0; - constructor(public input: string, public location: any, public tokens: List, + constructor(public input: string, public location: any, public tokens: Array, public reflector: Reflector, public parseAction: boolean) {} peek(offset: number): Token { @@ -471,7 +471,7 @@ export class _ParseAST { throw new BaseException("Fell through all cases in parsePrimary"); } - parseExpressionList(terminator: number): List { + parseExpressionList(terminator: number): Array { var result = []; if (!this.next.isCharacter(terminator)) { do { @@ -677,7 +677,7 @@ class SimpleExpressionChecker implements AstVisitor { visitKeyedWrite(ast: KeyedWrite) { this.simple = false; } - visitAll(asts: List): List { + visitAll(asts: Array): Array { var res = ListWrapper.createFixedSize(asts.length); for (var i = 0; i < asts.length; ++i) { res[i] = asts[i].visit(this); diff --git a/modules/angular2/src/core/change_detection/pipe_transform.ts b/modules/angular2/src/core/change_detection/pipe_transform.ts index e47526a350990e..caada4ce7e3da9 100644 --- a/modules/angular2/src/core/change_detection/pipe_transform.ts +++ b/modules/angular2/src/core/change_detection/pipe_transform.ts @@ -13,7 +13,7 @@ import {ABSTRACT, BaseException, CONST, Type} from 'angular2/src/core/facade/lan * } * ``` */ -export interface PipeTransform { transform(value: any, args: List): any; } +export interface PipeTransform { transform(value: any, args: Array): any; } /** * An interface that stateful pipes should implement. diff --git a/modules/angular2/src/core/change_detection/proto_change_detector.ts b/modules/angular2/src/core/change_detection/proto_change_detector.ts index 6e5d4bafdbf629..591868f363024f 100644 --- a/modules/angular2/src/core/change_detection/proto_change_detector.ts +++ b/modules/angular2/src/core/change_detection/proto_change_detector.ts @@ -1,5 +1,5 @@ import {BaseException, Type, isBlank, isPresent, isString} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { PropertyRead, @@ -76,7 +76,7 @@ export function createEventRecords(definition: ChangeDetectorDefinition): EventB } export class ProtoRecordBuilder { - records: List; + records: Array; constructor() { this.records = []; } @@ -117,16 +117,16 @@ export class ProtoRecordBuilder { } class _ConvertAstIntoProtoRecords implements AstVisitor { - constructor(private _records: List, private _bindingRecord: BindingRecord, + constructor(private _records: Array, private _bindingRecord: BindingRecord, private _variableNames: string[], private _bindingIndex: number) {} - static append(records: List, b: BindingRecord, variableNames: string[], + static append(records: Array, b: BindingRecord, variableNames: string[], bindingIndex: number) { var c = new _ConvertAstIntoProtoRecords(records, b, variableNames, bindingIndex); b.ast.visit(c); } - static create(b: BindingRecord, variableNames: List): ProtoRecord[] { + static create(b: BindingRecord, variableNames: Array): ProtoRecord[] { var rec = []; _ConvertAstIntoProtoRecords.append(rec, b, variableNames, null); rec[rec.length - 1].lastInBinding = true; @@ -256,7 +256,7 @@ class _ConvertAstIntoProtoRecords implements AstVisitor { visitIf(ast: If) { throw new BaseException('Not supported'); } - _visitAll(asts: List) { + _visitAll(asts: Array) { var res = ListWrapper.createFixedSize(asts.length); for (var i = 0; i < asts.length; ++i) { res[i] = asts[i].visit(this); @@ -307,7 +307,7 @@ function _arrayFn(length: number): Function { } } -function _mapPrimitiveName(keys: List) { +function _mapPrimitiveName(keys: Array) { var stringifiedKeys = ListWrapper.join(ListWrapper.map(keys, (k) => isString(k) ? `"${k}"` : `${k}`), ", "); return `mapFn([${stringifiedKeys}])`; @@ -391,7 +391,7 @@ function s(v): string { return isPresent(v) ? `${v}` : ''; } -function _interpolationFn(strings: List) { +function _interpolationFn(strings: Array) { var length = strings.length; var c0 = length > 0 ? strings[0] : null; var c1 = length > 1 ? strings[1] : null; diff --git a/modules/angular2/src/core/change_detection/proto_record.ts b/modules/angular2/src/core/change_detection/proto_record.ts index f58df466ad5a96..a1124eb2338e5d 100644 --- a/modules/angular2/src/core/change_detection/proto_record.ts +++ b/modules/angular2/src/core/change_detection/proto_record.ts @@ -1,4 +1,3 @@ -import {List} from 'angular2/src/core/facade/collection'; import {BindingRecord} from './binding_record'; import {DirectiveIndex} from './directive_record'; @@ -24,7 +23,7 @@ export enum RecordType { export class ProtoRecord { constructor(public mode: RecordType, public name: string, public funcOrValue, - public args: List, public fixedArgs: List, public contextIndex: number, + public args: Array, public fixedArgs: Array, public contextIndex: number, public directiveIndex: DirectiveIndex, public selfIndex: number, public bindingRecord: BindingRecord, public lastInBinding: boolean, public lastInDirective: boolean, public argumentToPureFunction: boolean, diff --git a/modules/angular2/src/core/compiler/compiler.ts b/modules/angular2/src/core/compiler/compiler.ts index 23d3851acd76ab..8a0441f1ee128c 100644 --- a/modules/angular2/src/core/compiler/compiler.ts +++ b/modules/angular2/src/core/compiler/compiler.ts @@ -11,7 +11,7 @@ import { isPromise } from 'angular2/src/core/facade/lang'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; import {DirectiveResolver} from './directive_resolver'; @@ -212,7 +212,8 @@ export class Compiler { return resultPromise; } - private _removeDuplicatedDirectives(directives: List): List { + private _removeDuplicatedDirectives(directives: + Array): Array { var directivesMap: Map = new Map(); directives.forEach((dirBinding) => { directivesMap.set(dirBinding.key.id, dirBinding); }); return MapWrapper.values(directivesMap); @@ -270,7 +271,7 @@ export class Compiler { } private _collectMergeRenderProtoViews(appProtoView: - AppProtoView): List> { + AppProtoView): Array> { var result = [appProtoView.render]; for (var i = 0; i < appProtoView.elementBinders.length; i++) { var binder = appProtoView.elementBinders[i]; @@ -330,14 +331,14 @@ export class Compiler { return pipes; } - private _flattenDirectives(view: ViewMetadata): List { + private _flattenDirectives(view: ViewMetadata): Array { if (isBlank(view.directives)) return []; var directives = []; this._flattenList(view.directives, directives); return directives; } - private _flattenList(tree: List, out: List>): void { + private _flattenList(tree: Array, out: Array>): void { for (var i = 0; i < tree.length; i++) { var item = resolveForwardRef(tree[i]); if (isArray(item)) { diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index c4edd73df38660..650e3a04f51c8e 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -8,7 +8,7 @@ import { StringWrapper } from 'angular2/src/core/facade/lang'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { Injector, ProtoInjector, @@ -163,7 +163,7 @@ export class TreeNode> { export class DirectiveDependency extends Dependency { constructor(key: Key, optional: boolean, lowerBoundVisibility: Object, - upperBoundVisibility: Object, properties: List, public attributeName: string, + upperBoundVisibility: Object, properties: Array, public attributeName: string, public queryDecorator: QueryMetadata) { super(key, optional, lowerBoundVisibility, upperBoundVisibility, properties); this._verify(); @@ -195,9 +195,9 @@ export class DirectiveDependency extends Dependency { } export class DirectiveBinding extends ResolvedBinding { - constructor(key: Key, factory: Function, dependencies: List, - public resolvedBindings: List, - public resolvedViewBindings: List, + constructor(key: Key, factory: Function, dependencies: Array, + public resolvedBindings: Array, + public resolvedViewBindings: Array, public metadata: RenderDirectiveMetadata) { super(key, factory, dependencies); } @@ -210,7 +210,7 @@ export class DirectiveBinding extends ResolvedBinding { get displayName(): string { return this.key.displayName; } - get eventEmitters(): List { + get eventEmitters(): Array { return isPresent(this.metadata) && isPresent(this.metadata.events) ? this.metadata.events : []; } @@ -291,7 +291,7 @@ export class HostActionAccessor { subscribe(view: viewModule.AppView, boundElementIndex: number, directive: Object): Object { var eventEmitter = this.getter(directive); - return ObservableWrapper.subscribe>( + return ObservableWrapper.subscribe>( eventEmitter, actionArgs => view.invokeElementMethod(boundElementIndex, this.methodName, actionArgs)); } @@ -310,10 +310,10 @@ function _createEventEmitterAccessors(bwv: BindingWithVisibility): EventEmitterA export class ProtoElementInjector { view: viewModule.AppView; attributes: Map; - eventEmitterAccessors: List>; + eventEmitterAccessors: Array>; protoInjector: ProtoInjector; - static create(parent: ProtoElementInjector, index: number, bindings: List, + static create(parent: ProtoElementInjector, index: number, bindings: Array, firstBindingIsComponent: boolean, distanceToParent: number, directiveVariableBindings: Map): ProtoElementInjector { var bd = []; @@ -328,7 +328,7 @@ export class ProtoElementInjector { directiveVariableBindings); } - private static _createDirectiveBindingWithVisibility(dirBindings: List, + private static _createDirectiveBindingWithVisibility(dirBindings: Array, bd: BindingWithVisibility[], firstBindingIsComponent: boolean) { ListWrapper.forEach(dirBindings, dirBinding => { @@ -337,7 +337,7 @@ export class ProtoElementInjector { }); } - private static _createBindingsWithVisibility(dirBindings: List, + private static _createBindingsWithVisibility(dirBindings: Array, bd: BindingWithVisibility[], firstBindingIsComponent: boolean) { ListWrapper.forEach(dirBindings, dirBinding => { @@ -355,7 +355,7 @@ export class ProtoElementInjector { isComponent ? Visibility.PublicAndPrivate : Visibility.Public); } - private static _createViewBindingsWithVisibility(bindings: List, + private static _createViewBindingsWithVisibility(bindings: Array, bd: BindingWithVisibility[]) { var db = bindings[0]; ListWrapper.forEach(db.resolvedViewBindings, @@ -537,7 +537,7 @@ export class ElementInjector extends TreeNode implements Depend hasDirective(type: Type): boolean { return isPresent(this._injector.getOptional(type)); } - getEventEmitterAccessors(): List> { + getEventEmitterAccessors(): Array> { return this._proto.eventEmitterAccessors; } @@ -625,7 +625,7 @@ export class ElementInjector extends TreeNode implements Depend } } - _buildQueriesForDeps(deps: List): void { + _buildQueriesForDeps(deps: Array): void { for (var i = 0; i < deps.length; i++) { var dep = deps[i]; if (isPresent(dep.queryDecorator)) { @@ -945,34 +945,34 @@ class ElementInjectorInlineStrategy implements _ElementInjectorStrategy { var p = this.injectorStrategy.protoStrategy; if (p.binding0 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding0.dependencies); + this._ei._buildQueriesForDeps(>p.binding0.dependencies); } if (p.binding1 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding1.dependencies); + this._ei._buildQueriesForDeps(>p.binding1.dependencies); } if (p.binding2 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding2.dependencies); + this._ei._buildQueriesForDeps(>p.binding2.dependencies); } if (p.binding3 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding3.dependencies); + this._ei._buildQueriesForDeps(>p.binding3.dependencies); } if (p.binding4 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding4.dependencies); + this._ei._buildQueriesForDeps(>p.binding4.dependencies); } if (p.binding5 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding5.dependencies); + this._ei._buildQueriesForDeps(>p.binding5.dependencies); } if (p.binding6 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding6.dependencies); + this._ei._buildQueriesForDeps(>p.binding6.dependencies); } if (p.binding7 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding7.dependencies); + this._ei._buildQueriesForDeps(>p.binding7.dependencies); } if (p.binding8 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding8.dependencies); + this._ei._buildQueriesForDeps(>p.binding8.dependencies); } if (p.binding9 instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.binding9.dependencies); + this._ei._buildQueriesForDeps(>p.binding9.dependencies); } } @@ -1078,7 +1078,7 @@ class ElementInjectorDynamicStrategy implements _ElementInjectorStrategy { for (var i = 0; i < p.bindings.length; i++) { if (p.bindings[i] instanceof DirectiveBinding) { - this._ei._buildQueriesForDeps(>p.bindings[i].dependencies); + this._ei._buildQueriesForDeps(>p.bindings[i].dependencies); } } } @@ -1150,7 +1150,7 @@ export class QueryRef { } } - private _aggregateVariableBindings(inj: ElementInjector, aggregator: List): void { + private _aggregateVariableBindings(inj: ElementInjector, aggregator: Array): void { var vb = this.query.varBindings; for (var i = 0; i < vb.length; ++i) { if (inj.hasVariableBinding(vb[i])) { @@ -1159,7 +1159,7 @@ export class QueryRef { } } - private _aggregateDirective(inj: ElementInjector, aggregator: List): void { + private _aggregateDirective(inj: ElementInjector, aggregator: Array): void { inj.addDirectivesMatchingQuery(this.query, aggregator); } } diff --git a/modules/angular2/src/core/compiler/proto_view_factory.ts b/modules/angular2/src/core/compiler/proto_view_factory.ts index 54d82b8fdce260..ab30a81b9025c1 100644 --- a/modules/angular2/src/core/compiler/proto_view_factory.ts +++ b/modules/angular2/src/core/compiler/proto_view_factory.ts @@ -1,6 +1,6 @@ import {Injectable} from 'angular2/di'; -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import { StringWrapper, isPresent, @@ -40,7 +40,7 @@ import {ProtoElementInjector, DirectiveBinding} from './element_injector'; export class BindingRecordsCreator { _directiveRecordsMap: Map = new Map(); - getEventBindingRecords(elementBinders: List, + getEventBindingRecords(elementBinders: Array, allDirectiveMetadatas: RenderDirectiveMetadata[]): BindingRecord[] { var res = []; for (var boundElementIndex = 0; boundElementIndex < elementBinders.length; @@ -75,10 +75,10 @@ export class BindingRecordsCreator { } } - getPropertyBindingRecords(textBindings: List, - elementBinders: List, + getPropertyBindingRecords(textBindings: Array, + elementBinders: Array, allDirectiveMetadatas: - List): List { + Array): Array { var bindings = []; this._createTextNodeRecords(bindings, textBindings); @@ -93,8 +93,9 @@ export class BindingRecordsCreator { return bindings; } - getDirectiveRecords(elementBinders: List, - allDirectiveMetadatas: List): List { + getDirectiveRecords(elementBinders: Array, + allDirectiveMetadatas: + Array): Array { var directiveRecords = []; for (var elementIndex = 0; elementIndex < elementBinders.length; ++elementIndex) { @@ -108,13 +109,13 @@ export class BindingRecordsCreator { return directiveRecords; } - _createTextNodeRecords(bindings: List, textBindings: List) { + _createTextNodeRecords(bindings: Array, textBindings: Array) { for (var i = 0; i < textBindings.length; i++) { bindings.push(BindingRecord.createForTextNode(textBindings[i], i)); } } - _createElementPropertyRecords(bindings: List, boundElementIndex: number, + _createElementPropertyRecords(bindings: Array, boundElementIndex: number, renderElementBinder: RenderElementBinder) { ListWrapper.forEach(renderElementBinder.propertyBindings, (binding) => { if (binding.type === PropertyBindingType.PROPERTY) { @@ -133,9 +134,9 @@ export class BindingRecordsCreator { }); } - _createDirectiveRecords(bindings: List, boundElementIndex: number, - directiveBinders: List, - allDirectiveMetadatas: List) { + _createDirectiveRecords(bindings: Array, boundElementIndex: number, + directiveBinders: Array, + allDirectiveMetadatas: Array) { for (var i = 0; i < directiveBinders.length; i++) { var directiveBinder = directiveBinders[i]; var directiveMetadata = allDirectiveMetadatas[directiveBinder.directiveIndex]; @@ -211,7 +212,8 @@ export class ProtoViewFactory { constructor(public _changeDetection: ChangeDetection) {} createAppProtoViews(hostComponentBinding: DirectiveBinding, rootRenderProtoView: ProtoViewDto, - allDirectives: List, pipes: PipeBinding[]): AppProtoView[] { + allDirectives: Array, + pipes: PipeBinding[]): AppProtoView[] { var allRenderDirectiveMetadata = ListWrapper.map(allDirectives, directiveBinding => directiveBinding.metadata); var nestedPvsWithIndex = _collectNestedProtoViews(rootRenderProtoView); @@ -261,8 +263,8 @@ export class ProtoViewFactory { */ export function getChangeDetectorDefinitions( hostComponentMetadata: RenderDirectiveMetadata, rootRenderProtoView: ProtoViewDto, - allRenderDirectiveMetadata: List, genConfig: ChangeDetectorGenConfig): - List { + allRenderDirectiveMetadata: Array, genConfig: ChangeDetectorGenConfig): + Array { var nestedPvsWithIndex = _collectNestedProtoViews(rootRenderProtoView); var nestedPvVariableNames = _collectNestedProtoViewsVariableNames(nestedPvsWithIndex); return _getChangeDetectorDefinitions(hostComponentMetadata, nestedPvsWithIndex, @@ -272,7 +274,7 @@ export function getChangeDetectorDefinitions( function _collectNestedProtoViews( renderProtoView: ProtoViewDto, parentIndex: number = null, boundElementIndex = null, - result: List = null): List { + result: Array = null): Array { if (isBlank(result)) { result = []; } @@ -291,11 +293,12 @@ function _collectNestedProtoViews( return result; } -function _getChangeDetectorDefinitions( - hostComponentMetadata: RenderDirectiveMetadata, - nestedPvsWithIndex: List, nestedPvVariableNames: List>, - allRenderDirectiveMetadata: List, genConfig: ChangeDetectorGenConfig): - List { +function _getChangeDetectorDefinitions(hostComponentMetadata: RenderDirectiveMetadata, + nestedPvsWithIndex: Array, + nestedPvVariableNames: Array>, + allRenderDirectiveMetadata: Array, + genConfig: ChangeDetectorGenConfig): + Array { return ListWrapper.map(nestedPvsWithIndex, (pvWithIndex) => { var elementBinders = pvWithIndex.renderProtoView.elementBinders; var bindingRecordsCreator = new BindingRecordsCreator(); @@ -317,7 +320,7 @@ function _getChangeDetectorDefinitions( } function _getChangeDetectorDefinitionIds(hostComponentMetadata: RenderDirectiveMetadata, - nestedPvsWithIndex: List): + nestedPvsWithIndex: Array): string[] { return nestedPvsWithIndex.map(pvWithIndex => _protoViewId(hostComponentMetadata, pvWithIndex)); } @@ -337,7 +340,7 @@ function _protoViewId(hostComponentMetadata: RenderDirectiveMetadata, function _createAppProtoView( renderProtoView: ProtoViewDto, protoChangeDetector: ProtoChangeDetector, - variableBindings: Map, allDirectives: List, + variableBindings: Map, allDirectives: Array, pipes: PipeBinding[]): AppProtoView { var elementBinders = renderProtoView.elementBinders; // Embedded ProtoViews that contain `` will be merged into their parents and use @@ -352,7 +355,7 @@ function _createAppProtoView( } function _collectNestedProtoViewsVariableBindings( - nestedPvsWithIndex: List): List> { + nestedPvsWithIndex: Array): Array> { return ListWrapper.map(nestedPvsWithIndex, (pvWithIndex) => { return _createVariableBindings(pvWithIndex.renderProtoView); }); @@ -365,8 +368,8 @@ function _createVariableBindings(renderProtoView): Map { return variableBindings; } -function _collectNestedProtoViewsVariableNames(nestedPvsWithIndex: List): - List> { +function _collectNestedProtoViewsVariableNames(nestedPvsWithIndex: Array): + Array> { var nestedPvVariableNames = ListWrapper.createFixedSize(nestedPvsWithIndex.length); ListWrapper.forEach(nestedPvsWithIndex, (pvWithIndex) => { var parentVariableNames = @@ -377,9 +380,9 @@ function _collectNestedProtoViewsVariableNames(nestedPvsWithIndex: List, renderProtoView): List { +function _createVariableNames(parentVariableNames: Array, renderProtoView): Array { var res = - isBlank(parentVariableNames) ? >[] : ListWrapper.clone(parentVariableNames); + isBlank(parentVariableNames) ? >[] : ListWrapper.clone(parentVariableNames); MapWrapper.forEach(renderProtoView.variableBindings, (mappedName, varName) => { res.push(mappedName); }); ListWrapper.forEach(renderProtoView.elementBinders, binder => { @@ -389,7 +392,7 @@ function _createVariableNames(parentVariableNames: List, renderProtoView return res; } -export function createVariableLocations(elementBinders: List): +export function createVariableLocations(elementBinders: Array): Map { var variableLocations = new Map(); for (var i = 0; i < elementBinders.length; i++) { @@ -483,7 +486,7 @@ function _createElementBinder(protoView: AppProtoView, boundElementIndex, render } export function createDirectiveVariableBindings(renderElementBinder: RenderElementBinder, - directiveBindings: List): + directiveBindings: Array): Map { var directiveVariableBindings = new Map(); MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => { diff --git a/modules/angular2/src/core/compiler/query_list.ts b/modules/angular2/src/core/compiler/query_list.ts index 1f862ddd6e6322..31adc9c7dc75e7 100644 --- a/modules/angular2/src/core/compiler/query_list.ts +++ b/modules/angular2/src/core/compiler/query_list.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; /** * An iterable and observable live list of components in the DOM. @@ -72,11 +72,11 @@ import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection * ``` */ export class QueryList { - protected _results: List < T >= []; - protected _callbacks: List < () => void >= []; + protected _results: Array < T >= []; + protected _callbacks: Array < () => void >= []; protected _dirty: boolean = false; - reset(newList: List): void { + reset(newList: Array): void { this._results = newList; this._dirty = true; } diff --git a/modules/angular2/src/core/compiler/view.ts b/modules/angular2/src/core/compiler/view.ts index 425477abeee4d3..058e21a1c830bd 100644 --- a/modules/angular2/src/core/compiler/view.ts +++ b/modules/angular2/src/core/compiler/view.ts @@ -3,7 +3,6 @@ import { MapWrapper, Map, StringMapWrapper, - List, StringMap } from 'angular2/src/core/facade/collection'; import { @@ -74,7 +73,7 @@ function inverseIndexMapping(input: number[], resultLength: number): number[] { export class AppViewContainer { // The order in this list matches the DOM order. - views: List = []; + views: Array = []; } /** @@ -85,26 +84,26 @@ export class AppView implements ChangeDispatcher, RenderEventDispatcher { // AppViews that have been merged in depth first order. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. - views: List = null; + views: Array = null; // root elementInjectors of this AppView // This list is local to this AppView and not shared with other Views. - rootElementInjectors: List; + rootElementInjectors: Array; // ElementInjectors of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. - elementInjectors: List = null; + elementInjectors: Array = null; // ViewContainers of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. - viewContainers: List = null; + viewContainers: Array = null; // PreBuiltObjects of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. - preBuiltObjects: List = null; + preBuiltObjects: Array = null; // ElementRef of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. - elementRefs: List; + elementRefs: Array; ref: ViewRef; changeDetector: ChangeDetector = null; @@ -134,10 +133,10 @@ export class AppView implements ChangeDispatcher, RenderEventDispatcher { this.locals = new Locals(null, MapWrapper.clone(protoLocals)); // TODO optimize this } - init(changeDetector: ChangeDetector, elementInjectors: List, - rootElementInjectors: List, preBuiltObjects: List, - views: List, elementRefs: List, - viewContainers: List) { + init(changeDetector: ChangeDetector, elementInjectors: Array, + rootElementInjectors: Array, preBuiltObjects: Array, + views: Array, elementRefs: Array, + viewContainers: Array) { this.changeDetector = changeDetector; this.elementInjectors = elementInjectors; this.rootElementInjectors = rootElementInjectors; @@ -256,7 +255,7 @@ export class AppView implements ChangeDispatcher, RenderEventDispatcher { return isPresent(childView) ? childView.changeDetector : null; } - invokeElementMethod(elementIndex: number, methodName: string, args: List) { + invokeElementMethod(elementIndex: number, methodName: string, args: Array) { this.renderer.invokeElementMethod(this.elementRefs[elementIndex], methodName, args); } @@ -321,7 +320,7 @@ class EventEvaluationError extends BaseException { * */ export class AppProtoView { - elementBinders: List = []; + elementBinders: Array = []; protoLocals: Map = new Map(); mergeMapping: AppProtoViewMergeMapping; ref: ProtoViewRef; diff --git a/modules/angular2/src/core/compiler/view_container_ref.ts b/modules/angular2/src/core/compiler/view_container_ref.ts index a11a4babf1df89..8a70ac69a36f1c 100644 --- a/modules/angular2/src/core/compiler/view_container_ref.ts +++ b/modules/angular2/src/core/compiler/view_container_ref.ts @@ -1,4 +1,4 @@ -import {ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ResolvedBinding} from 'angular2/di'; import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; @@ -22,7 +22,7 @@ export class ViewContainerRef { */ constructor(public viewManager: avmModule.AppViewManager, public element: ElementRef) {} - private _getViews(): List { + private _getViews(): Array { var vc = internalView(this.element.parentView).viewContainers[this.element.boundElementIndex]; return isPresent(vc) ? vc.views : []; } diff --git a/modules/angular2/src/core/compiler/view_manager_utils.ts b/modules/angular2/src/core/compiler/view_manager_utils.ts index b7576f7503ce92..d9f9358bd773ff 100644 --- a/modules/angular2/src/core/compiler/view_manager_utils.ts +++ b/modules/angular2/src/core/compiler/view_manager_utils.ts @@ -1,11 +1,5 @@ import {Injector, Binding, Injectable, ResolvedBinding} from 'angular2/di'; -import { - ListWrapper, - MapWrapper, - Map, - StringMapWrapper, - List -} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection'; import * as eli from './element_injector'; import {isPresent, isBlank, BaseException} from 'angular2/src/core/facade/lang'; import * as viewModule from './view'; diff --git a/modules/angular2/src/core/compiler/view_pool.ts b/modules/angular2/src/core/compiler/view_pool.ts index 229891562c328f..e37994bddcf762 100644 --- a/modules/angular2/src/core/compiler/view_pool.ts +++ b/modules/angular2/src/core/compiler/view_pool.ts @@ -1,6 +1,6 @@ import {Inject, Injectable, OpaqueToken} from 'angular2/di'; -import {ListWrapper, MapWrapper, Map, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Map} from 'angular2/src/core/facade/collection'; import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/core/facade/lang'; import * as viewModule from './view'; @@ -10,7 +10,7 @@ export const APP_VIEW_POOL_CAPACITY = CONST_EXPR(new OpaqueToken('AppViewPool.vi @Injectable() export class AppViewPool { _poolCapacityPerProtoView: number; - _pooledViewsPerProtoView: Map> = new Map(); + _pooledViewsPerProtoView: Map> = new Map(); constructor(@Inject(APP_VIEW_POOL_CAPACITY) poolCapacityPerProtoView) { this._poolCapacityPerProtoView = poolCapacityPerProtoView; diff --git a/modules/angular2/src/core/compiler/view_resolver.ts b/modules/angular2/src/core/compiler/view_resolver.ts index 9f3673c3a340e7..6a829e7defcd13 100644 --- a/modules/angular2/src/core/compiler/view_resolver.ts +++ b/modules/angular2/src/core/compiler/view_resolver.ts @@ -2,7 +2,7 @@ import {Injectable} from 'angular2/di'; import {ViewMetadata} from '../metadata/view'; import {Type, stringify, isBlank, BaseException} from 'angular2/src/core/facade/lang'; -import {Map, MapWrapper, List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {reflector} from 'angular2/src/core/reflection/reflection'; diff --git a/modules/angular2/src/core/debug/debug_element.ts b/modules/angular2/src/core/debug/debug_element.ts index 1ac528529af404..e34cc77404be66 100644 --- a/modules/angular2/src/core/debug/debug_element.ts +++ b/modules/angular2/src/core/debug/debug_element.ts @@ -1,5 +1,5 @@ import {Type, isPresent, BaseException, isBlank} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, Predicate} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Predicate} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; @@ -42,9 +42,9 @@ export class DebugElement { /** * Get child DebugElements from within the Light DOM. * - * @return {List} + * @return {Array} */ - get children(): List { + get children(): Array { return this._getChildElements(this._parentView, this._boundElementIndex); } @@ -52,9 +52,9 @@ export class DebugElement { * Get the root DebugElement children of a component. Returns an empty * list if the current DebugElement is not a component root. * - * @return {List} + * @return {Array} */ - get componentViewChildren(): List { + get componentViewChildren(): Array { var shadowView = this._parentView.getNestedView(this._boundElementIndex); if (!isPresent(shadowView)) { @@ -106,15 +106,15 @@ export class DebugElement { * @param {Function: boolean} predicate * @param {Scope} scope * - * @return {List} + * @return {Array} */ - queryAll(predicate: Predicate, scope: Function = Scope.all): List { + queryAll(predicate: Predicate, scope: Function = Scope.all): Array { var elementsInScope = scope(this); return ListWrapper.filter(elementsInScope, predicate); } - _getChildElements(view: AppView, parentBoundElementIndex: number): List { + _getChildElements(view: AppView, parentBoundElementIndex: number): Array { var els = []; var parentElementBinder = null; if (isPresent(parentBoundElementIndex)) { @@ -128,7 +128,7 @@ export class DebugElement { var views = view.viewContainers[view.elementOffset + i]; if (isPresent(views)) { ListWrapper.forEach(views.views, (nextView) => { - els = ListWrapper.concat(els, this._getChildElements(nextView, null)); + els = els.concat(this._getChildElements(nextView, null)); }); } } @@ -141,38 +141,38 @@ export function inspectElement(elementRef: ElementRef): DebugElement { return DebugElement.create(elementRef); } -export function asNativeElements(arr: List): List { +export function asNativeElements(arr: Array): Array { return arr.map((debugEl) => debugEl.nativeElement); } export class Scope { - static all(debugElement: DebugElement): List { + static all(debugElement: DebugElement): Array { var scope = []; scope.push(debugElement); ListWrapper.forEach(debugElement.children, - (child) => { scope = ListWrapper.concat(scope, Scope.all(child)); }); + (child) => { scope = scope.concat(Scope.all(child)); }); ListWrapper.forEach(debugElement.componentViewChildren, - (child) => { scope = ListWrapper.concat(scope, Scope.all(child)); }); + (child) => { scope = scope.concat(Scope.all(child)); }); return scope; } - static light(debugElement: DebugElement): List { + static light(debugElement: DebugElement): Array { var scope = []; ListWrapper.forEach(debugElement.children, (child) => { scope.push(child); - scope = ListWrapper.concat(scope, Scope.light(child)); + scope = scope.concat(Scope.light(child)); }); return scope; } - static view(debugElement: DebugElement): List { + static view(debugElement: DebugElement): Array { var scope = []; ListWrapper.forEach(debugElement.componentViewChildren, (child) => { scope.push(child); - scope = ListWrapper.concat(scope, Scope.light(child)); + scope = scope.concat(Scope.light(child)); }); return scope; } diff --git a/modules/angular2/src/core/debug/debug_element_view_listener.ts b/modules/angular2/src/core/debug/debug_element_view_listener.ts index 1f3e63078aadbc..5c19895125e731 100644 --- a/modules/angular2/src/core/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/core/debug/debug_element_view_listener.ts @@ -1,5 +1,5 @@ import {CONST_EXPR, isPresent, NumberWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; -import {MapWrapper, Map, ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {MapWrapper, Map, ListWrapper} from 'angular2/src/core/facade/collection'; import {Injectable, bind, Binding} from 'angular2/di'; import {AppViewListener} from 'angular2/src/core/compiler/view_listener'; import {AppView} from 'angular2/src/core/compiler/view'; @@ -18,13 +18,13 @@ var _allViewsById = new Map(); var _nextId = 0; -function _setElementId(element, indices: List) { +function _setElementId(element, indices: Array) { if (isPresent(element)) { DOM.setData(element, NG_ID_PROPERTY, ListWrapper.join(indices, NG_ID_SEPARATOR)); } } -function _getElementId(element): List { +function _getElementId(element): Array { var elId = DOM.getData(element, NG_ID_PROPERTY); if (isPresent(elId)) { return ListWrapper.map(elId.split(NG_ID_SEPARATOR), diff --git a/modules/angular2/src/core/di/binding.ts b/modules/angular2/src/core/di/binding.ts index aa943708fe8bd4..8cace92b1d0076 100644 --- a/modules/angular2/src/core/di/binding.ts +++ b/modules/angular2/src/core/di/binding.ts @@ -8,7 +8,7 @@ import { stringify, isArray } from 'angular2/src/core/facade/lang'; -import {List, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {reflector} from 'angular2/src/core/reflection/reflection'; import {Key} from './key'; import { @@ -28,7 +28,7 @@ import {resolveForwardRef} from './forward_ref'; */ export class Dependency { constructor(public key: Key, public optional: boolean, public lowerBoundVisibility: any, - public upperBoundVisibility: any, public properties: List) {} + public upperBoundVisibility: any, public properties: Array) {} static fromKey(key: Key): Dependency { return new Dependency(key, false, null, null, []); } } @@ -174,12 +174,12 @@ export class Binding { * expect(injector.get(String)).toEqual('Value: 3'); * ``` */ - dependencies: List; + dependencies: Array; constructor( token, {toClass, toValue, toAlias, toFactory, deps}: - {toClass?: Type, toValue?: any, toAlias?: any, toFactory?: Function, deps?: List}) { + {toClass?: Type, toValue?: any, toAlias?: any, toFactory?: Function, deps?: Array}) { this.token = token; this.toClass = toClass; this.toValue = toValue; @@ -238,7 +238,7 @@ export class ResolvedBinding { /** * Arguments (dependencies) to the `factory` function. */ - public dependencies: List) {} + public dependencies: Array) {} } /** @@ -365,31 +365,31 @@ export class BindingBuilder { * expect(injector.get(String)).toEqual('Value: 3'); * ``` */ - toFactory(factoryFunction: Function, dependencies?: List): Binding { + toFactory(factoryFunction: Function, dependencies?: Array): Binding { return new Binding(this.token, {toFactory: factoryFunction, deps: dependencies}); } } -function _constructDependencies(factoryFunction: Function, dependencies: List): - List { +function _constructDependencies(factoryFunction: Function, dependencies: Array): + Array { if (isBlank(dependencies)) { return _dependenciesFor(factoryFunction); } else { - var params: List> = ListWrapper.map(dependencies, (t) => [t]); + var params: Array> = ListWrapper.map(dependencies, (t) => [t]); return ListWrapper.map(dependencies, (t) => _extractToken(factoryFunction, t, params)); } } -function _dependenciesFor(typeOrFunc): List { +function _dependenciesFor(typeOrFunc): Array { var params = reflector.parameters(typeOrFunc); if (isBlank(params)) return []; if (ListWrapper.any(params, (p) => isBlank(p))) { throw new NoAnnotationError(typeOrFunc, params); } - return ListWrapper.map(params, (p: List) => _extractToken(typeOrFunc, p, params)); + return ListWrapper.map(params, (p: Array) => _extractToken(typeOrFunc, p, params)); } -function _extractToken(typeOrFunc, metadata /*List | any*/, params: List>): +function _extractToken(typeOrFunc, metadata /*Array | any*/, params: Array>): Dependency { var depProps = []; var token = null; diff --git a/modules/angular2/src/core/di/exceptions.ts b/modules/angular2/src/core/di/exceptions.ts index dc25df252d07c0..010cf3ce7d6b86 100644 --- a/modules/angular2/src/core/di/exceptions.ts +++ b/modules/angular2/src/core/di/exceptions.ts @@ -1,9 +1,9 @@ -import {ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {stringify, BaseException, isBlank} from 'angular2/src/core/facade/lang'; import {Key} from './key'; import {Injector} from './injector'; -function findFirstClosedCycle(keys: List): List { +function findFirstClosedCycle(keys: Array): Array { var res = []; for (var i = 0; i < keys.length; ++i) { if (ListWrapper.contains(res, keys[i])) { @@ -16,7 +16,7 @@ function findFirstClosedCycle(keys: List): List { return res; } -function constructResolvingPath(keys: List): string { +function constructResolvingPath(keys: Array): string { if (keys.length > 1) { var reversed = findFirstClosedCycle(ListWrapper.reversed(keys)); var tokenStrs = ListWrapper.map(reversed, (k) => stringify(k.token)); @@ -33,8 +33,8 @@ function constructResolvingPath(keys: List): string { export class AbstractBindingError extends BaseException { name: string; message: string; - keys: List; - injectors: List; + keys: Array; + injectors: Array; constructResolvingMessage: Function; constructor(injector: Injector, key: Key, constructResolvingMessage: Function, originalException?, @@ -63,7 +63,7 @@ export class AbstractBindingError extends BaseException { */ export class NoBindingError extends AbstractBindingError { constructor(injector: Injector, key: Key) { - super(injector, key, function(keys: List) { + super(injector, key, function(keys: Array) { var first = stringify(ListWrapper.first(keys).token); return `No provider for ${first}!${constructResolvingPath(keys)}`; }); @@ -88,7 +88,7 @@ export class NoBindingError extends AbstractBindingError { */ export class CyclicDependencyError extends AbstractBindingError { constructor(injector: Injector, key: Key) { - super(injector, key, function(keys: List) { + super(injector, key, function(keys: Array) { return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`; }); } @@ -103,7 +103,7 @@ export class CyclicDependencyError extends AbstractBindingError { export class InstantiationError extends AbstractBindingError { causeKey: Key; constructor(injector: Injector, originalException, originalStack, key: Key) { - super(injector, key, function(keys: List) { + super(injector, key, function(keys: Array) { var first = stringify(ListWrapper.first(keys).token); return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.`; }, originalException, originalStack); @@ -136,7 +136,7 @@ export class InvalidBindingError extends BaseException { export class NoAnnotationError extends BaseException { name: string; message: string; - constructor(typeOrFunc, params: List>) { + constructor(typeOrFunc, params: Array>) { super(); var signature = []; for (var i = 0, ii = params.length; i < ii; i++) { diff --git a/modules/angular2/src/core/di/injector.ts b/modules/angular2/src/core/di/injector.ts index f4a325846c860e..1a8668af865efd 100644 --- a/modules/angular2/src/core/di/injector.ts +++ b/modules/angular2/src/core/di/injector.ts @@ -1,4 +1,4 @@ -import {Map, List, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; +import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {ResolvedBinding, Binding, Dependency, BindingBuilder, bind} from './binding'; import { AbstractBindingError, @@ -427,7 +427,7 @@ export class Injector { *such as * `fromResolvedBindings` and `createChildFromResolved`. */ - static resolve(bindings: List>): List { + static resolve(bindings: Array>): Array { var resolvedBindings = _resolveBindings(bindings); var flatten = _flattenBindings(resolvedBindings, new Map()); return _createListOfBindings(flatten); @@ -446,7 +446,7 @@ export class Injector { * bindings. * @param `depProvider` */ - static resolveAndCreate(bindings: List>, + static resolveAndCreate(bindings: Array>, depProvider: DependencyProvider = null): Injector { var resolvedBindings = Injector.resolve(bindings); return Injector.fromResolvedBindings(resolvedBindings, depProvider); @@ -460,7 +460,7 @@ export class Injector { * {@link Injector}. * @param `depProvider` */ - static fromResolvedBindings(bindings: List, + static fromResolvedBindings(bindings: Array, depProvider: DependencyProvider = null): Injector { var bd = bindings.map(b => new BindingWithVisibility(b, Visibility.Public)); var proto = new ProtoInjector(bd); @@ -537,7 +537,7 @@ export class Injector { * recursive list of more bindings. * @param `depProvider` */ - resolveAndCreateChild(bindings: List>, + resolveAndCreateChild(bindings: Array>, depProvider: DependencyProvider = null): Injector { var resovledBindings = Injector.resolve(bindings); return this.createChildFromResolved(resovledBindings, depProvider); @@ -551,7 +551,7 @@ export class Injector { * @param `depProvider` * @returns a new child {@link Injector}. */ - createChildFromResolved(bindings: List, + createChildFromResolved(bindings: Array, depProvider: DependencyProvider = null): Injector { var bd = bindings.map(b => new BindingWithVisibility(b, Visibility.Public)); var proto = new ProtoInjector(bd); @@ -801,7 +801,7 @@ export class Injector { var INJECTOR_KEY = Key.get(Injector); -function _resolveBindings(bindings: List>): List { +function _resolveBindings(bindings: Array>): Array { var resolvedList = ListWrapper.createFixedSize(bindings.length); for (var i = 0; i < bindings.length; i++) { var unresolved = resolveForwardRef(bindings[i]); @@ -812,7 +812,7 @@ function _resolveBindings(bindings: List>): List>): List): - List { + Array { return MapWrapper.values(flattenedBindings); } -function _flattenBindings(bindings: List>, +function _flattenBindings(bindings: Array>, res: Map): Map { ListWrapper.forEach(bindings, function(b) { if (b instanceof ResolvedBinding) { res.set(b.key.id, b); - } else if (b instanceof List) { + } else if (b instanceof Array) { _flattenBindings(b, res); } }); diff --git a/modules/angular2/src/core/directives/ng_for.ts b/modules/angular2/src/core/directives/ng_for.ts index fe250ddb471519..a1484944b8a962 100644 --- a/modules/angular2/src/core/directives/ng_for.ts +++ b/modules/angular2/src/core/directives/ng_for.ts @@ -83,8 +83,8 @@ export class NgFor { view.setLocal('index', record.currentIndex); } - static bulkRemove(tuples: List, - viewContainer: ViewContainerRef): List { + static bulkRemove(tuples: Array, + viewContainer: ViewContainerRef): Array { tuples.sort((a, b) => a.record.previousIndex - b.record.previousIndex); var movedTuples = []; for (var i = tuples.length - 1; i >= 0; i--) { @@ -100,8 +100,8 @@ export class NgFor { return movedTuples; } - static bulkInsert(tuples: List, viewContainer: ViewContainerRef, - templateRef: TemplateRef): List { + static bulkInsert(tuples: Array, viewContainer: ViewContainerRef, + templateRef: TemplateRef): Array { tuples.sort((a, b) => a.record.currentIndex - b.record.currentIndex); for (var i = 0; i < tuples.length; i++) { var tuple = tuples[i]; diff --git a/modules/angular2/src/core/directives/ng_switch.ts b/modules/angular2/src/core/directives/ng_switch.ts index 031fa0b8f76491..e088a8a89c3661 100644 --- a/modules/angular2/src/core/directives/ng_switch.ts +++ b/modules/angular2/src/core/directives/ng_switch.ts @@ -2,7 +2,7 @@ import {Directive} from 'angular2/metadata'; import {Host} from 'angular2/di'; import {ViewContainerRef, TemplateRef} from 'angular2/core'; import {isPresent, isBlank, normalizeBlank, CONST_EXPR} from 'angular2/src/core/facade/lang'; -import {ListWrapper, List, Map} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map} from 'angular2/src/core/facade/collection'; const _WHEN_DEFAULT = CONST_EXPR(new Object()); @@ -43,8 +43,8 @@ export class SwitchView { export class NgSwitch { private _switchValue: any; private _useDefault: boolean = false; - private _valueViews: Map> = new Map(); - private _activeViews: List = []; + private _valueViews: Map> = new Map(); + private _activeViews: Array = []; set ngSwitch(value) { // Empty the currently active ViewContainers @@ -93,7 +93,7 @@ export class NgSwitch { this._activeViews = []; } - _activateViews(views: List): void { + _activateViews(views: Array): void { // TODO(vicb): assert(this._activeViews.length === 0); if (isPresent(views)) { for (var i = 0; i < views.length; i++) { diff --git a/modules/angular2/src/core/dom/browser_adapter.ts b/modules/angular2/src/core/dom/browser_adapter.ts index 9187c405eb00ee..0087f52d67179d 100644 --- a/modules/angular2/src/core/dom/browser_adapter.ts +++ b/modules/angular2/src/core/dom/browser_adapter.ts @@ -1,4 +1,4 @@ -import {List, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {isBlank, isPresent, global, setValueOnPath} from 'angular2/src/core/facade/lang'; import {setRootDomAdapter} from './dom_adapter'; import {GenericBrowserDomAdapter} from './generic_browser_adapter'; @@ -59,7 +59,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter { hasProperty(element, name: string): boolean { return name in element; } setProperty(el: /*element*/ any, name: string, value: any) { el[name] = value; } getProperty(el: /*element*/ any, name: string): any { return el[name]; } - invoke(el: /*element*/ any, methodName: string, args: List): any { + invoke(el: /*element*/ any, methodName: string, args: Array): any { el[methodName].apply(el, args); } @@ -93,7 +93,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter { query(selector: string): any { return document.querySelector(selector); } querySelector(el, selector: string): HTMLElement { return el.querySelector(selector); } - querySelectorAll(el, selector: string): List { return el.querySelectorAll(selector); } + querySelectorAll(el, selector: string): Array { return el.querySelectorAll(selector); } on(el, evt, listener) { el.addEventListener(evt, listener, false); } onAndCancel(el, evt, listener): Function { el.addEventListener(evt, listener, false); @@ -134,8 +134,8 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter { firstChild(el): Node { return el.firstChild; } nextSibling(el): Node { return el.nextSibling; } parentElement(el): Node { return el.parentNode; } - childNodes(el): List { return el.childNodes; } - childNodesAsList(el): List { + childNodes(el): Array { return el.childNodes; } + childNodesAsList(el): Array { var childNodes = el.childNodes; var res = ListWrapper.createFixedSize(childNodes.length); for (var i = 0; i < childNodes.length; i++) { @@ -190,14 +190,14 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter { getShadowRoot(el: HTMLElement): DocumentFragment { return (el).shadowRoot; } getHost(el: HTMLElement): HTMLElement { return (el).host; } clone(node: Node): Node { return node.cloneNode(true); } - getElementsByClassName(element, name: string): List { + getElementsByClassName(element, name: string): Array { return element.getElementsByClassName(name); } - getElementsByTagName(element, name: string): List { + getElementsByTagName(element, name: string): Array { return element.getElementsByTagName(name); } - classList(element): List { - return >Array.prototype.slice.call(element.classList, 0); + classList(element): Array { + return >Array.prototype.slice.call(element.classList, 0); } addClass(element, classname: string) { element.classList.add(classname); } removeClass(element, classname: string) { element.classList.remove(classname); } diff --git a/modules/angular2/src/core/dom/dom_adapter.ts b/modules/angular2/src/core/dom/dom_adapter.ts index 0459331406f1f0..6757afab82efe6 100644 --- a/modules/angular2/src/core/dom/dom_adapter.ts +++ b/modules/angular2/src/core/dom/dom_adapter.ts @@ -22,7 +22,7 @@ export class DomAdapter { hasProperty(element, name: string): boolean { throw _abstract(); } setProperty(el: Element, name: string, value: any) { throw _abstract(); } getProperty(el: Element, name: string): any { throw _abstract(); } - invoke(el: Element, methodName: string, args: List): any { throw _abstract(); } + invoke(el: Element, methodName: string, args: Array): any { throw _abstract(); } logError(error) { throw _abstract(); } log(error) { throw _abstract(); } @@ -38,7 +38,7 @@ export class DomAdapter { parse(templateHtml: string) { throw _abstract(); } query(selector: string): any { throw _abstract(); } querySelector(el, selector: string): HTMLElement { throw _abstract(); } - querySelectorAll(el, selector: string): List { throw _abstract(); } + querySelectorAll(el, selector: string): Array { throw _abstract(); } on(el, evt, listener) { throw _abstract(); } onAndCancel(el, evt, listener): Function { throw _abstract(); } dispatchEvent(el, evt) { throw _abstract(); } @@ -55,8 +55,8 @@ export class DomAdapter { firstChild(el): Node { throw _abstract(); } nextSibling(el): Node { throw _abstract(); } parentElement(el): Node { throw _abstract(); } - childNodes(el): List { throw _abstract(); } - childNodesAsList(el): List { throw _abstract(); } + childNodes(el): Array { throw _abstract(); } + childNodesAsList(el): Array { throw _abstract(); } clearNodes(el) { throw _abstract(); } appendChild(el, node) { throw _abstract(); } removeChild(el, node) { throw _abstract(); } @@ -83,11 +83,11 @@ export class DomAdapter { createShadowRoot(el): any { throw _abstract(); } getShadowRoot(el): any { throw _abstract(); } getHost(el): any { throw _abstract(); } - getDistributedNodes(el): List { throw _abstract(); } + getDistributedNodes(el): Array { throw _abstract(); } clone /**/ (node: Node /*T*/): Node /*T*/ { throw _abstract(); } - getElementsByClassName(element, name: string): List { throw _abstract(); } - getElementsByTagName(element, name: string): List { throw _abstract(); } - classList(element): List { throw _abstract(); } + getElementsByClassName(element, name: string): Array { throw _abstract(); } + getElementsByTagName(element, name: string): Array { throw _abstract(); } + classList(element): Array { throw _abstract(); } addClass(element, classname: string) { throw _abstract(); } removeClass(element, classname: string) { throw _abstract(); } hasClass(element, classname: string): boolean { throw _abstract(); } @@ -122,7 +122,7 @@ export class DomAdapter { getHref(element): string { throw _abstract(); } getEventKey(event): string { throw _abstract(); } resolveAndSetHref(element, baseUrl: string, href: string) { throw _abstract(); } - cssToRules(css: string): List { throw _abstract(); } + cssToRules(css: string): Array { throw _abstract(); } supportsDOMEvents(): boolean { throw _abstract(); } supportsNativeShadowDOM(): boolean { throw _abstract(); } getGlobalEventTarget(target: string): any { throw _abstract(); } diff --git a/modules/angular2/src/core/dom/generic_browser_adapter.ts b/modules/angular2/src/core/dom/generic_browser_adapter.ts index ee260630e9b3a0..bfabe052f7a309 100644 --- a/modules/angular2/src/core/dom/generic_browser_adapter.ts +++ b/modules/angular2/src/core/dom/generic_browser_adapter.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {isPresent, isFunction} from 'angular2/src/core/facade/lang'; import {DomAdapter} from './dom_adapter'; @@ -6,11 +6,11 @@ import {DomAdapter} from './dom_adapter'; * Provides DOM operations in any browser environment. */ export class GenericBrowserDomAdapter extends DomAdapter { - getDistributedNodes(el: HTMLElement): List { return (el).getDistributedNodes(); } + getDistributedNodes(el: HTMLElement): Array { return (el).getDistributedNodes(); } resolveAndSetHref(el: HTMLAnchorElement, baseUrl: string, href: string) { el.href = href == null ? baseUrl : baseUrl + '/../' + href; } - cssToRules(css: string): List { + cssToRules(css: string): Array { var style = this.createStyleElement(css); this.appendChild(this.defaultDoc().head, style); var rules = []; diff --git a/modules/angular2/src/core/dom/parse5_adapter.ts b/modules/angular2/src/core/dom/parse5_adapter.ts index 375fc52934f217..42bc057ddf2df1 100644 --- a/modules/angular2/src/core/dom/parse5_adapter.ts +++ b/modules/angular2/src/core/dom/parse5_adapter.ts @@ -7,7 +7,7 @@ var cssParse = require('css').parse; var url = require('url'); -import {List, MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {DomAdapter, setRootDomAdapter} from './dom_adapter'; import { BaseException, @@ -66,7 +66,7 @@ export class Parse5DomAdapter extends DomAdapter { query(selector) { throw _notImplemented('query'); } querySelector(el, selector: string): any { return this.querySelectorAll(el, selector)[0]; } - querySelectorAll(el, selector: string): List { + querySelectorAll(el, selector: string): Array { var res = []; var _recursive = (result, node, selector, matcher) => { var cNodes = node.childNodes; @@ -131,7 +131,7 @@ export class Parse5DomAdapter extends DomAdapter { onAndCancel(el, evt, listener): Function { this.on(el, evt, listener); return () => { - ListWrapper.remove(StringMapWrapper.get>(el._eventListenersMap, evt), listener); + ListWrapper.remove(StringMapWrapper.get>(el._eventListenersMap, evt), listener); }; } dispatchEvent(el, evt) { @@ -178,7 +178,7 @@ export class Parse5DomAdapter extends DomAdapter { nextSibling(el): Node { return el.nextSibling; } parentElement(el): Node { return el.parent; } childNodes(el): Node[] { return el.childNodes; } - childNodesAsList(el): List { + childNodesAsList(el): Array { var childNodes = el.childNodes; var res = ListWrapper.createFixedSize(childNodes.length); for (var i = 0; i < childNodes.length; i++) { @@ -292,7 +292,7 @@ export class Parse5DomAdapter extends DomAdapter { } getShadowRoot(el): Element { return el.shadowRoot; } getHost(el): string { return el.host; } - getDistributedNodes(el: any): List { throw _notImplemented('getDistributedNodes'); } + getDistributedNodes(el: any): Array { throw _notImplemented('getDistributedNodes'); } clone(node: Node): Node { var _recursive = (node) => { var nodeClone = Object.create(Object.getPrototypeOf(node)); @@ -334,13 +334,13 @@ export class Parse5DomAdapter extends DomAdapter { }; return _recursive(node); } - getElementsByClassName(element, name: string): List { + getElementsByClassName(element, name: string): Array { return this.querySelectorAll(element, "." + name); } - getElementsByTagName(element: any, name: string): List { + getElementsByTagName(element: any, name: string): Array { throw _notImplemented('getElementsByTagName'); } - classList(element): List { + classList(element): Array { var classAttrValue = null; var attributes = element.attribs; if (attributes && attributes.hasOwnProperty("class")) { @@ -518,7 +518,7 @@ export class Parse5DomAdapter extends DomAdapter { } return rules; } - cssToRules(css: string): List { + cssToRules(css: string): Array { css = css.replace(/url\(\'(.+)\'\)/g, 'url($1)'); var rules = []; var parsedCSS = cssParse(css, {silent: true}); diff --git a/modules/angular2/src/core/facade/async.ts b/modules/angular2/src/core/facade/async.ts index 43f9d6e1e61c8b..fcc96f3a89193b 100644 --- a/modules/angular2/src/core/facade/async.ts +++ b/modules/angular2/src/core/facade/async.ts @@ -1,7 +1,6 @@ /// import {global, isPresent} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; import * as Rx from 'rx'; export {Promise}; @@ -24,7 +23,7 @@ export class PromiseWrapper { return promise.catch(onError); } - static all(promises: List): Promise { + static all(promises: Array): Promise { if (promises.length == 0) return Promise.resolve([]); return Promise.all(promises); } diff --git a/modules/angular2/src/core/facade/collection.dart b/modules/angular2/src/core/facade/collection.dart index 7c4e7d8e8745e8..1e5bb726283b6d 100644 --- a/modules/angular2/src/core/facade/collection.dart +++ b/modules/angular2/src/core/facade/collection.dart @@ -115,10 +115,6 @@ class ListWrapper { static List createFixedSize(int size) => new List(size); static List createGrowableSize(int size) => new List.generate(size, (_) => null, growable: true); - static get(List m, int k) => m[k]; - static void set(List m, int k, v) { - m[k] = v; - } static bool contains(List m, k) => m.contains(k); static List map(list, fn(item)) => list.map(fn).toList(); diff --git a/modules/angular2/src/core/facade/collection.ts b/modules/angular2/src/core/facade/collection.ts index 384c30006feadc..0041c347bfa9dc 100644 --- a/modules/angular2/src/core/facade/collection.ts +++ b/modules/angular2/src/core/facade/collection.ts @@ -1,21 +1,20 @@ import {isJsObject, global, isPresent, isBlank, isArray} from 'angular2/src/core/facade/lang'; -export var List = global.Array; export var Map = global.Map; export var Set = global.Set; export var StringMap = global.Object; // Safari and Internet Explorer do not support the iterable parameter to the // Map constructor. We work around that by manually adding the items. -var createMapFromPairs: {(pairs: List): Map} = (function() { +var createMapFromPairs: {(pairs: Array): Map} = (function() { try { if (new Map([[1, 2]]).size === 1) { - return function createMapFromPairs(pairs: List): + return function createMapFromPairs(pairs: Array): Map { return new Map(pairs); }; } } catch (e) { } - return function createMapAndPopulateFromPairs(pairs: List): Map { + return function createMapAndPopulateFromPairs(pairs: Array): Map { var map = new Map(); for (var i = 0; i < pairs.length; i++) { var pair = pairs[i]; @@ -54,19 +53,19 @@ var _clearValues: {(m: Map)} = (function() { })(); // Safari doesn't implement MapIterator.next(), which is used is Traceur's polyfill of Array.from // TODO(mlaval): remove the work around once we have a working polyfill of Array.from -var _arrayFromMap: {(m: Map, getValues: boolean): List} = (function() { +var _arrayFromMap: {(m: Map, getValues: boolean): Array} = (function() { try { if (((new Map()).values()).next) { - return function createArrayFromMap(m: Map, getValues: boolean): List { + return function createArrayFromMap(m: Map, getValues: boolean): Array { return getValues ? (Array).from(m.values()) : (Array).from(m.keys()); }; } } catch (e) { } - return function createArrayFromMapWithForeach(m: Map, getValues: boolean): List { + return function createArrayFromMapWithForeach(m: Map, getValues: boolean): Array { var res = ListWrapper.createFixedSize(m.size), i = 0; m.forEach((v, k) => { - ListWrapper.set(res, i, getValues ? v : k); + res[i] = getValues ? v : k; i++; }); return res; @@ -87,15 +86,15 @@ export class MapWrapper { m.forEach((v, k) => r[k] = v); return r; } - static createFromPairs(pairs: List): Map { return createMapFromPairs(pairs); } + static createFromPairs(pairs: Array): Map { return createMapFromPairs(pairs); } static forEach(m: Map, fn: /*(V, K) => void*/ Function) { m.forEach(fn); } static get(map: Map, key: K): V { return map.get(key); } static size(m: Map): number { return m.size; } static delete(m: Map, k: K) { m.delete(k); } static clearValues(m: Map) { _clearValues(m); } static iterable(m: T): T { return m; } - static keys(m: Map): List { return _arrayFromMap(m, false); } - static values(m: Map): List { return _arrayFromMap(m, true); } + static keys(m: Map): Array { return _arrayFromMap(m, false); } + static values(m: Map): Array { return _arrayFromMap(m, true); } } /** @@ -115,7 +114,7 @@ export class StringMapWrapper { return map.hasOwnProperty(key) ? map[key] : undefined; } static set(map: StringMap, key: string, value: V) { map[key] = value; } - static keys(map: StringMap): List { return Object.keys(map); } + static keys(map: StringMap): Array { return Object.keys(map); } static isEmpty(map: StringMap): boolean { for (var prop in map) { return false; @@ -171,71 +170,69 @@ export interface Predicate { (value: T, index?: number, array?: T[]): boolean export class ListWrapper { // JS has no way to express a staticly fixed size list, but dart does so we // keep both methods. - static createFixedSize(size: number): List { return new List(size); } - static createGrowableSize(size: number): List { return new List(size); } - static get(m: List, k: number): T { return m[k]; } - static set(m: List, k: number, v: T) { m[k] = v; } - static clone(array: List): T[] { return array.slice(0); } - static map(array: List, fn: (T) => V): List { return array.map(fn); } - static forEach(array: List, fn: (T) => void) { + static createFixedSize(size: number): Array { return new Array(size); } + static createGrowableSize(size: number): Array { return new Array(size); } + static clone(array: Array): T[] { return array.slice(0); } + static map(array: Array, fn: (T) => V): Array { return array.map(fn); } + static forEach(array: Array, fn: (T) => void) { for (var i = 0; i < array.length; i++) { fn(array[i]); } } - static forEachWithIndex(array: List, fn: (T, number) => void) { + static forEachWithIndex(array: Array, fn: (T, number) => void) { for (var i = 0; i < array.length; i++) { fn(array[i], i); } } - static first(array: List): T { + static first(array: Array): T { if (!array) return null; return array[0]; } - static last(array: List): T { + static last(array: Array): T { if (!array || array.length == 0) return null; return array[array.length - 1]; } - static find(list: List, pred: Predicate): T { + static find(list: Array, pred: Predicate): T { for (var i = 0; i < list.length; ++i) { if (pred(list[i])) return list[i]; } return null; } - static indexOf(array: List, value: T, startIndex: number = 0): number { + static indexOf(array: Array, value: T, startIndex: number = 0): number { return array.indexOf(value, startIndex); } - static reduce(list: List, + static reduce(list: Array, fn: (accumValue: E, currentValue: T, currentIndex: number, array: T[]) => E, init: E): E { return list.reduce(fn, init); } - static filter(array: List, pred: Predicate): T[] { return array.filter(pred); } - static any(list: List, pred: Function): boolean { + static filter(array: Array, pred: Predicate): T[] { return array.filter(pred); } + static any(list: Array, pred: Function): boolean { for (var i = 0; i < list.length; ++i) { if (pred(list[i])) return true; } return false; } - static contains(list: List, el: T): boolean { return list.indexOf(el) !== -1; } - static reversed(array: List): T[] { + static contains(list: Array, el: T): boolean { return list.indexOf(el) !== -1; } + static reversed(array: Array): T[] { var a = ListWrapper.clone(array); return a.reverse(); } - static concat(a: List, b: List): List { return a.concat(b); } - static insert(list: List, index: number, value: T) { list.splice(index, 0, value); } - static removeAt(list: List, index: number): T { + static concat(a: Array, b: Array): Array { return a.concat(b); } + static insert(list: Array, index: number, value: T) { list.splice(index, 0, value); } + static removeAt(list: Array, index: number): T { var res = list[index]; list.splice(index, 1); return res; } - static removeAll(list: List, items: List) { + static removeAll(list: Array, items: Array) { for (var i = 0; i < items.length; ++i) { var index = list.indexOf(items[i]); list.splice(index, 1); } } - static removeLast(list: List): T { return list.pop(); } - static remove(list: List, el: T): boolean { + static removeLast(list: Array): T { return list.pop(); } + static remove(list: Array, el: T): boolean { var index = list.indexOf(el); if (index > -1) { list.splice(index, 1); @@ -243,36 +240,36 @@ export class ListWrapper { } return false; } - static clear(list: List) { list.splice(0, list.length); } - static join(list: List, s: string): string { return list.join(s); } - static isEmpty(list: List): boolean { return list.length == 0; } - static fill(list: List, value: any, start: number = 0, end: number = null) { + static clear(list: Array) { list.splice(0, list.length); } + static join(list: Array, s: string): string { return list.join(s); } + static isEmpty(list: Array): boolean { return list.length == 0; } + static fill(list: Array, value: any, start: number = 0, end: number = null) { list.fill(value, start, end === null ? list.length : end); } - static equals(a: List, b: List): boolean { + static equals(a: Array, b: Array): boolean { if (a.length != b.length) return false; for (var i = 0; i < a.length; ++i) { if (a[i] !== b[i]) return false; } return true; } - static slice(l: List, from: number = 0, to: number = null): List { + static slice(l: Array, from: number = 0, to: number = null): Array { return l.slice(from, to === null ? undefined : to); } - static splice(l: List, from: number, length: number): List { + static splice(l: Array, from: number, length: number): Array { return l.splice(from, length); } - static sort(l: List, compareFn?: (a: T, b: T) => number) { + static sort(l: Array, compareFn?: (a: T, b: T) => number) { if (isPresent(compareFn)) { l.sort(compareFn); } else { l.sort(); } } - static toString(l: List): string { return l.toString(); } - static toJSON(l: List): string { return JSON.stringify(l); } + static toString(l: Array): string { return l.toString(); } + static toJSON(l: Array): string { return JSON.stringify(l); } - static maximum(list: List, predicate: (T) => number): T { + static maximum(list: Array, predicate: (T) => number): T { if (list.length == 0) { return null; } @@ -316,12 +313,12 @@ export function iterateListLike(obj: any, fn: Function) { // Safari and Internet Explorer do not support the iterable parameter to the // Set constructor. We work around that by manually adding the items. -var createSetFromList: {(lst: List): Set} = (function() { +var createSetFromList: {(lst: Array): Set} = (function() { var test = new Set([1, 2, 3]); if (test.size === 3) { - return function createSetFromList(lst: List): Set { return new Set(lst); }; + return function createSetFromList(lst: Array): Set { return new Set(lst); }; } else { - return function createSetAndPopulateFromList(lst: List): Set { + return function createSetAndPopulateFromList(lst: Array): Set { var res = new Set(lst); if (res.size !== lst.length) { for (var i = 0; i < lst.length; i++) { @@ -333,7 +330,7 @@ var createSetFromList: {(lst: List): Set} = (function() { } })(); export class SetWrapper { - static createFromList(lst: List): Set { return createSetFromList(lst); } + static createFromList(lst: Array): Set { return createSetFromList(lst); } static has(s: Set, key: T): boolean { return s.has(key); } static delete(m: Set, k: K) { m.delete(k); } } diff --git a/modules/angular2/src/core/facade/lang.ts b/modules/angular2/src/core/facade/lang.ts index d5449f3432836e..10618b73020df1 100644 --- a/modules/angular2/src/core/facade/lang.ts +++ b/modules/angular2/src/core/facade/lang.ts @@ -141,7 +141,7 @@ export class StringWrapper { static charCodeAt(s: string, index: number): number { return s.charCodeAt(index); } - static split(s: string, regExp: RegExp): List { return s.split(regExp); } + static split(s: string, regExp: RegExp): Array { return s.split(regExp); } static equals(s: string, s2: string): boolean { return s === s2; } @@ -251,7 +251,7 @@ export class RegExpWrapper { flags = flags.replace(/g/g, ''); return new _global.RegExp(regExpStr, flags + 'g'); } - static firstMatch(regExp: RegExp, input: string): List { + static firstMatch(regExp: RegExp, input: string): Array { // Reset multimatch regex state regExp.lastIndex = 0; return regExp.exec(input); diff --git a/modules/angular2/src/core/metadata.ts b/modules/angular2/src/core/metadata.ts index 85572e34125e00..ef6d9d6cfd3b49 100644 --- a/modules/angular2/src/core/metadata.ts +++ b/modules/angular2/src/core/metadata.ts @@ -57,11 +57,11 @@ export interface ComponentDecorator extends TypeDecorator { View(obj: { templateUrl?: string, template?: string, - directives?: List>, - pipes?: List>, + directives?: Array>, + pipes?: Array>, renderer?: string, - styles?: List, - styleUrls?: List, + styles?: Array, + styleUrls?: Array, }): ViewDecorator; } @@ -77,11 +77,11 @@ export interface ViewDecorator extends TypeDecorator { View(obj: { templateUrl?: string, template?: string, - directives?: List>, - pipes?: List>, + directives?: Array>, + pipes?: Array>, renderer?: string, - styles?: List, - styleUrls?: List, + styles?: Array, + styleUrls?: Array, }): ViewDecorator; } @@ -127,13 +127,13 @@ export interface ViewDecorator extends TypeDecorator { */ export interface DirectiveFactory { (obj: { - selector?: string, properties?: List, events?: List, - host?: StringMap, lifecycle?: List, bindings?: List, + selector?: string, properties?: Array, events?: Array, + host?: StringMap, lifecycle?: Array, bindings?: Array, exportAs?: string, compileChildren?: boolean; }): DirectiveDecorator; new (obj: { - selector?: string, properties?: List, events?: List, - host?: StringMap, lifecycle?: List, bindings?: List, + selector?: string, properties?: Array, events?: Array, + host?: StringMap, lifecycle?: Array, bindings?: Array, exportAs?: string, compileChildren?: boolean; }): DirectiveMetadata; } @@ -184,26 +184,26 @@ export interface DirectiveFactory { export interface ComponentFactory { (obj: { selector?: string, - properties?: List, - events?: List, + properties?: Array, + events?: Array, host?: StringMap, - lifecycle?: List, - bindings?: List, + lifecycle?: Array, + bindings?: Array, exportAs?: string, compileChildren?: boolean, - viewBindings?: List, + viewBindings?: Array, changeDetection?: ChangeDetectionStrategy, }): ComponentDecorator; new (obj: { selector?: string, - properties?: List, - events?: List, + properties?: Array, + events?: Array, host?: StringMap, - lifecycle?: List, - bindings?: List, + lifecycle?: Array, + bindings?: Array, exportAs?: string, compileChildren?: boolean, - viewBindings?: List, + viewBindings?: Array, changeDetection?: ChangeDetectionStrategy, }): ComponentMetadata; } @@ -255,18 +255,18 @@ export interface ViewFactory { (obj: { templateUrl?: string, template?: string, - directives?: List>, + directives?: Array>, encapsulation?: ViewEncapsulation, - styles?: List, - styleUrls?: List, + styles?: Array, + styleUrls?: Array, }): ViewDecorator; new (obj: { templateUrl?: string, template?: string, - directives?: List>, + directives?: Array>, encapsulation?: ViewEncapsulation, - styles?: List, - styleUrls?: List, + styles?: Array, + styleUrls?: Array, }): ViewMetadata; } diff --git a/modules/angular2/src/core/metadata/di.ts b/modules/angular2/src/core/metadata/di.ts index bf70cf28393371..ebf905a8b3eb8b 100644 --- a/modules/angular2/src/core/metadata/di.ts +++ b/modules/angular2/src/core/metadata/di.ts @@ -70,7 +70,7 @@ export class QueryMetadata extends DependencyMetadata { get isVarBindingQuery(): boolean { return isString(this.selector); } - get varBindings(): List { return StringWrapper.split(this.selector, new RegExp(",")); } + get varBindings(): Array { return StringWrapper.split(this.selector, new RegExp(",")); } toString(): string { return `@Query(${stringify(this.selector)})`; } } diff --git a/modules/angular2/src/core/metadata/directives.ts b/modules/angular2/src/core/metadata/directives.ts index 0e45a25a7f963a..f29db082622d1b 100644 --- a/modules/angular2/src/core/metadata/directives.ts +++ b/modules/angular2/src/core/metadata/directives.ts @@ -1,5 +1,4 @@ import {CONST, CONST_EXPR} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; import {InjectableMetadata} from 'angular2/src/core/di/metadata'; import {ChangeDetectionStrategy} from 'angular2/change_detection'; @@ -482,7 +481,7 @@ export class DirectiveMetadata extends InjectableMetadata { * ``` * */ - properties: List; + properties: Array; /** * Enumerates the set of emitted events. @@ -527,7 +526,7 @@ export class DirectiveMetadata extends InjectableMetadata { * ``` * */ - events: List; + events: Array; /** * Specifiy the events, actions, properties and attributes related to the host element. @@ -636,7 +635,7 @@ export class DirectiveMetadata extends InjectableMetadata { * * See {@link LifecycleEvent} for details. */ - lifecycle: List; + lifecycle: Array; /** * If set to false the compiler does not compile the children of this directive. @@ -674,7 +673,7 @@ export class DirectiveMetadata extends InjectableMetadata { * } * ``` */ - bindings: List; + bindings: Array; /** * Defines the name that can be used in the template to assign this directive to a variable. @@ -708,11 +707,11 @@ export class DirectiveMetadata extends InjectableMetadata { compileChildren = true, }: { selector?: string, - properties?: List, - events?: List, + properties?: Array, + events?: Array, host?: StringMap, - lifecycle?: List, - bindings?: List, + lifecycle?: Array, + bindings?: Array, exportAs?: string, compileChildren?: boolean, } = {}) { @@ -817,19 +816,19 @@ export class ComponentMetadata extends DirectiveMetadata { * * ``` */ - viewBindings: List; + viewBindings: Array; constructor({selector, properties, events, host, exportAs, lifecycle, bindings, viewBindings, changeDetection = ChangeDetectionStrategy.Default, compileChildren = true}: { selector?: string, - properties?: List, - events?: List, + properties?: Array, + events?: Array, host?: StringMap, - lifecycle?: List, - bindings?: List, + lifecycle?: Array, + bindings?: Array, exportAs?: string, compileChildren?: boolean, - viewBindings?: List, + viewBindings?: Array, changeDetection?: ChangeDetectionStrategy, } = {}) { super({ diff --git a/modules/angular2/src/core/metadata/view.ts b/modules/angular2/src/core/metadata/view.ts index 417e2649bc6d2b..ff13ae4e066756 100644 --- a/modules/angular2/src/core/metadata/view.ts +++ b/modules/angular2/src/core/metadata/view.ts @@ -53,12 +53,12 @@ export class ViewMetadata { /** * Specifies stylesheet URLs for an angular component. */ - styleUrls: List; + styleUrls: Array; /** * Specifies an inline stylesheet for an angular component. */ - styles: List; + styles: Array; /** * Specifies a list of directives that can be used within a template. @@ -82,12 +82,12 @@ export class ViewMetadata { * } * ``` */ - // TODO(tbosch): use Type | Binding | List when Dart supports union types, + // TODO(tbosch): use Type | Binding | Array when Dart supports union types, // as otherwise we would need to import Binding type and Dart would warn // for an unused import. - directives: List>; + directives: Array>; - pipes: List>; + pipes: Array>; /** * Specify how the template and the styles should be encapsulated. @@ -100,11 +100,11 @@ export class ViewMetadata { constructor({templateUrl, template, directives, pipes, encapsulation, styles, styleUrls}: { templateUrl?: string, template?: string, - directives?: List>, - pipes?: List>, + directives?: Array>, + pipes?: Array>, encapsulation?: ViewEncapsulation, - styles?: List, - styleUrls?: List, + styles?: Array, + styleUrls?: Array, } = {}) { this.templateUrl = templateUrl; this.template = template; diff --git a/modules/angular2/src/core/pipes/date_pipe.ts b/modules/angular2/src/core/pipes/date_pipe.ts index 8605c760adf98d..929be2d0fc98a4 100644 --- a/modules/angular2/src/core/pipes/date_pipe.ts +++ b/modules/angular2/src/core/pipes/date_pipe.ts @@ -93,7 +93,7 @@ export class DatePipe implements PipeTransform { }; - transform(value: any, args: List): string { + transform(value: any, args: Array): string { if (isBlank(value)) return null; if (!this.supports(value)) { diff --git a/modules/angular2/src/core/pipes/json_pipe.ts b/modules/angular2/src/core/pipes/json_pipe.ts index cdb27dfbeaaf4c..cd8a7900a016a6 100644 --- a/modules/angular2/src/core/pipes/json_pipe.ts +++ b/modules/angular2/src/core/pipes/json_pipe.ts @@ -32,5 +32,5 @@ import {Pipe} from '../metadata'; @Pipe({name: 'json'}) @Injectable() export class JsonPipe implements PipeTransform { - transform(value: any, args: List = null): string { return Json.stringify(value); } + transform(value: any, args: Array = null): string { return Json.stringify(value); } } diff --git a/modules/angular2/src/core/pipes/limit_to_pipe.ts b/modules/angular2/src/core/pipes/limit_to_pipe.ts index ce2a0ea2502ab7..3ea98215d726ac 100644 --- a/modules/angular2/src/core/pipes/limit_to_pipe.ts +++ b/modules/angular2/src/core/pipes/limit_to_pipe.ts @@ -16,7 +16,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception'; import {Pipe} from '../metadata'; /** - * Creates a new List or String containing only a prefix/suffix of the + * Creates a new Array or String containing only a prefix/suffix of the * elements. * * The number of elements to return is specified by the `limitTo` parameter. @@ -25,19 +25,19 @@ import {Pipe} from '../metadata'; * * expression | limitTo:number * - * Where the input expression is a [List] or [String], and `limitTo` is: + * Where the input expression is a [Array] or [String], and `limitTo` is: * * - **a positive integer**: return _number_ items from the beginning of the list or string * expression. * - **a negative integer**: return _number_ items from the end of the list or string expression. * - **`|limitTo|` greater than the size of the expression**: return the entire expression. * - * When operating on a [List], the returned list is always a copy even when all + * When operating on a [Array], the returned list is always a copy even when all * the elements are being returned. * * # Examples * - * ## List Example + * ## Array Example * * Assuming `var collection = ['a', 'b', 'c']`, this `ng-for` directive: * @@ -59,7 +59,7 @@ import {Pipe} from '../metadata'; export class LimitToPipe implements PipeTransform { supports(obj: any): boolean { return isString(obj) || isArray(obj); } - transform(value: any, args: List = null): any { + transform(value: any, args: Array = null): any { if (isBlank(args) || args.length == 0) { throw new BaseException('limitTo pipe requires one argument'); } diff --git a/modules/angular2/src/core/pipes/lowercase_pipe.ts b/modules/angular2/src/core/pipes/lowercase_pipe.ts index ae2e46994535b6..883cf9df133c7a 100644 --- a/modules/angular2/src/core/pipes/lowercase_pipe.ts +++ b/modules/angular2/src/core/pipes/lowercase_pipe.ts @@ -31,7 +31,7 @@ import {Pipe} from '../metadata'; @Pipe({name: 'lowercase'}) @Injectable() export class LowerCasePipe implements PipeTransform { - transform(value: string, args: List = null): string { + transform(value: string, args: Array = null): string { if (isBlank(value)) return value; if (!isString(value)) { throw new InvalidPipeArgumentException(LowerCasePipe, value); diff --git a/modules/angular2/src/core/pipes/uppercase_pipe.ts b/modules/angular2/src/core/pipes/uppercase_pipe.ts index ef6b07f36b4aa1..0b5f7d9d2c4491 100644 --- a/modules/angular2/src/core/pipes/uppercase_pipe.ts +++ b/modules/angular2/src/core/pipes/uppercase_pipe.ts @@ -30,7 +30,7 @@ import {Pipe} from '../metadata'; @Pipe({name: 'uppercase'}) @Injectable() export class UpperCasePipe implements PipeTransform { - transform(value: string, args: List = null): string { + transform(value: string, args: Array = null): string { if (isBlank(value)) return value; if (!isString(value)) { throw new InvalidPipeArgumentException(UpperCasePipe, value); diff --git a/modules/angular2/src/core/reflection/platform_reflection_capabilities.ts b/modules/angular2/src/core/reflection/platform_reflection_capabilities.ts index 3ceba5f91821a5..0b3d1809aa7ffc 100644 --- a/modules/angular2/src/core/reflection/platform_reflection_capabilities.ts +++ b/modules/angular2/src/core/reflection/platform_reflection_capabilities.ts @@ -1,13 +1,12 @@ import {Type} from 'angular2/src/core/facade/lang'; import {GetterFn, SetterFn, MethodFn} from './types'; -import {List} from 'angular2/src/core/facade/collection'; export interface PlatformReflectionCapabilities { isReflectionEnabled(): boolean; factory(type: Type): Function; - interfaces(type: Type): List; - parameters(type: Type): List>; - annotations(type: Type): List; + interfaces(type: Type): Array; + parameters(type: Type): Array>; + annotations(type: Type): Array; getter(name: string): GetterFn; setter(name: string): SetterFn; method(name: string): MethodFn; diff --git a/modules/angular2/src/core/reflection/reflection.ts b/modules/angular2/src/core/reflection/reflection.ts index a91e0bada51040..c1a2b85d54395a 100644 --- a/modules/angular2/src/core/reflection/reflection.ts +++ b/modules/angular2/src/core/reflection/reflection.ts @@ -1,5 +1,5 @@ import {Type, isPresent} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Reflector} from './reflector'; export {Reflector, ReflectionInfo} from './reflector'; import {ReflectionCapabilities} from './reflection_capabilities'; diff --git a/modules/angular2/src/core/reflection/reflection_capabilities.ts b/modules/angular2/src/core/reflection/reflection_capabilities.ts index 366bc800ed9cdd..39b3b2f7ef21ef 100644 --- a/modules/angular2/src/core/reflection/reflection_capabilities.ts +++ b/modules/angular2/src/core/reflection/reflection_capabilities.ts @@ -6,7 +6,7 @@ import { stringify, BaseException } from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {GetterFn, SetterFn, MethodFn} from './types'; import {PlatformReflectionCapabilities} from 'platform_reflection_capabilities'; @@ -82,7 +82,7 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities { `Cannot create a factory for '${stringify(t)}' because its constructor has more than 20 arguments`); } - _zipTypesAndAnnotaions(paramTypes, paramAnnotations): List> { + _zipTypesAndAnnotaions(paramTypes, paramAnnotations): Array> { var result; if (typeof paramTypes === 'undefined') { @@ -109,7 +109,7 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities { return result; } - parameters(typeOfFunc: Type): List> { + parameters(typeOfFunc: Type): Array> { // Prefer the direct API. if (isPresent((typeOfFunc).parameters)) { return (typeOfFunc).parameters; @@ -124,7 +124,7 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities { return ListWrapper.createFixedSize((typeOfFunc).length); } - annotations(typeOfFunc: Type): List { + annotations(typeOfFunc: Type): Array { // Prefer the direct API. if (isPresent((typeOfFunc).annotations)) { var annotations = (typeOfFunc).annotations; @@ -140,7 +140,7 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities { return []; } - interfaces(type: Type): List { + interfaces(type: Type): Array { throw new BaseException("JavaScript does not support interfaces"); } diff --git a/modules/angular2/src/core/reflection/reflector.ts b/modules/angular2/src/core/reflection/reflector.ts index 28a4569df46470..5eefc0d9b7a3ab 100644 --- a/modules/angular2/src/core/reflection/reflector.ts +++ b/modules/angular2/src/core/reflection/reflector.ts @@ -1,6 +1,5 @@ import {Type, isPresent, stringify, BaseException} from 'angular2/src/core/facade/lang'; import { - List, ListWrapper, Map, MapWrapper, @@ -16,12 +15,12 @@ export {PlatformReflectionCapabilities} from './platform_reflection_capabilities export class ReflectionInfo { _factory: Function; - _annotations: List; - _parameters: List>; - _interfaces: List; + _annotations: Array; + _parameters: Array>; + _interfaces: Array; - constructor(annotations?: List, parameters?: List>, factory?: Function, - interfaces?: List) { + constructor(annotations?: Array, parameters?: Array>, factory?: Function, + interfaces?: Array) { this._annotations = annotations; this._parameters = parameters; this._factory = factory; @@ -59,7 +58,7 @@ export class Reflector { * {@link #trackUsage} was called. This list could later be audited as * potential dead code. */ - listUnusedKeys(): List { + listUnusedKeys(): Array { if (this._usedKeys == null) { throw new BaseException('Usage tracking is disabled'); } @@ -96,7 +95,7 @@ export class Reflector { } } - parameters(typeOrFunc: /*Type*/ any): List { + parameters(typeOrFunc: /*Type*/ any): Array { if (this._injectableInfo.has(typeOrFunc)) { var res = this._getReflectionInfo(typeOrFunc)._parameters; return isPresent(res) ? res : []; @@ -105,7 +104,7 @@ export class Reflector { } } - annotations(typeOrFunc: /*Type*/ any): List { + annotations(typeOrFunc: /*Type*/ any): Array { if (this._injectableInfo.has(typeOrFunc)) { var res = this._getReflectionInfo(typeOrFunc)._annotations; return isPresent(res) ? res : []; @@ -114,7 +113,7 @@ export class Reflector { } } - interfaces(type: Type): List { + interfaces(type: Type): Array { if (this._injectableInfo.has(type)) { var res = this._getReflectionInfo(type)._interfaces; return isPresent(res) ? res : []; diff --git a/modules/angular2/src/core/reflection/types.ts b/modules/angular2/src/core/reflection/types.ts index 9570f38370b677..a0318554e744fa 100644 --- a/modules/angular2/src/core/reflection/types.ts +++ b/modules/angular2/src/core/reflection/types.ts @@ -1,6 +1,5 @@ import {Type} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; export type SetterFn = (obj: any, value: any) => void; export type GetterFn = (obj: any) => any; -export type MethodFn = (obj: any, args: List) => any; +export type MethodFn = (obj: any, args: Array) => any; diff --git a/modules/angular2/src/core/render/api.ts b/modules/angular2/src/core/render/api.ts index b9802491d5336e..320478ced3c212 100644 --- a/modules/angular2/src/core/render/api.ts +++ b/modules/angular2/src/core/render/api.ts @@ -1,7 +1,6 @@ import {isPresent, isBlank, RegExpWrapper} from 'angular2/src/core/facade/lang'; import {Promise} from 'angular2/src/core/facade/async'; import { - List, Map, MapWrapper, StringMap, @@ -49,14 +48,14 @@ export class RenderElementBinder { index: number; parentIndex: number; distanceToParent: number; - directives: List; + directives: Array; nestedProtoView: ProtoViewDto; - propertyBindings: List; + propertyBindings: Array; variableBindings: Map; // Note: this contains a preprocessed AST // that replaced the values that should be extracted from the element // with a local name - eventBindings: List; + eventBindings: Array; readAttributes: Map; constructor({index, parentIndex, distanceToParent, directives, nestedProtoView, propertyBindings, @@ -64,11 +63,11 @@ export class RenderElementBinder { index?: number, parentIndex?: number, distanceToParent?: number, - directives?: List, + directives?: Array, nestedProtoView?: ProtoViewDto, - propertyBindings?: List, + propertyBindings?: Array, variableBindings?: Map, - eventBindings?: List, + eventBindings?: Array, readAttributes?: Map } = {}) { this.index = index; @@ -90,13 +89,13 @@ export class DirectiveBinder { // Note: this contains a preprocessed AST // that replaced the values that should be extracted from the element // with a local name - eventBindings: List; - hostPropertyBindings: List; + eventBindings: Array; + hostPropertyBindings: Array; constructor({directiveIndex, propertyBindings, eventBindings, hostPropertyBindings}: { directiveIndex?: number, propertyBindings?: Map, - eventBindings?: List, - hostPropertyBindings?: List + eventBindings?: Array, + hostPropertyBindings?: Array }) { this.directiveIndex = directiveIndex; this.propertyBindings = propertyBindings; @@ -119,19 +118,19 @@ export enum ViewType { export class ProtoViewDto { render: RenderProtoViewRef; - elementBinders: List; + elementBinders: Array; variableBindings: Map; type: ViewType; - textBindings: List; + textBindings: Array; transitiveNgContentCount: number; constructor({render, elementBinders, variableBindings, type, textBindings, transitiveNgContentCount}: { render?: RenderProtoViewRef, - elementBinders?: List, + elementBinders?: Array, variableBindings?: Map, type?: ViewType, - textBindings?: List, + textBindings?: Array, transitiveNgContentCount?: number }) { this.render = render; @@ -149,9 +148,9 @@ export class RenderDirectiveMetadata { id: any; selector: string; compileChildren: boolean; - events: List; - properties: List; - readAttributes: List; + events: Array; + properties: Array; + readAttributes: Array; type: number; callOnDestroy: boolean; callOnChanges: boolean; @@ -173,12 +172,12 @@ export class RenderDirectiveMetadata { id?: string, selector?: string, compileChildren?: boolean, - events?: List, + events?: Array, hostListeners?: Map, hostProperties?: Map, hostAttributes?: Map, - properties?: List, - readAttributes?: List, + properties?: Array, + readAttributes?: Array, type?: number, callOnDestroy?: boolean, callOnChanges?: boolean, @@ -213,10 +212,10 @@ export class RenderDirectiveMetadata { id?: string, selector?: string, compileChildren?: boolean, - events?: List, + events?: Array, host?: Map, - properties?: List, - readAttributes?: List, + properties?: Array, + readAttributes?: Array, type?: number, callOnDestroy?: boolean, callOnChanges?: boolean, @@ -297,9 +296,9 @@ export class ViewDefinition { componentId: string; templateAbsUrl: string; template: string; - directives: List; - styleAbsUrls: List; - styles: List; + directives: Array; + styleAbsUrls: Array; + styles: Array; encapsulation: ViewEncapsulation; constructor({componentId, templateAbsUrl, template, styleAbsUrls, styles, directives, @@ -307,9 +306,9 @@ export class ViewDefinition { componentId?: string, templateAbsUrl?: string, template?: string, - styleAbsUrls?: List, - styles?: List, - directives?: List, + styleAbsUrls?: Array, + styles?: Array, + directives?: Array, encapsulation?: ViewEncapsulation } = {}) { this.componentId = componentId; @@ -364,11 +363,11 @@ export class RenderCompiler { * should be merged. * If the array contains other arrays, they will be merged before processing the parent array. * The array must contain an entry for every component and embedded ProtoView of the first entry. - * @param protoViewRefs List of ProtoViewRefs or nested + * @param protoViewRefs Array of ProtoViewRefs or nested * @return the merge result */ mergeProtoViewsRecursively( - protoViewRefs: List>): Promise { + protoViewRefs: Array>): Promise { return null; } } @@ -483,7 +482,7 @@ export class Renderer { /** * Calls a method on an element. */ - invokeElementMethod(location: RenderElementRef, methodName: string, args: List) {} + invokeElementMethod(location: RenderElementRef, methodName: string, args: Array) {} /** * Sets the value of a text node. diff --git a/modules/angular2/src/core/render/dom/compiler/compile_control.ts b/modules/angular2/src/core/render/dom/compiler/compile_control.ts index 4f11e61a9c0b37..e2ca63bd44c613 100644 --- a/modules/angular2/src/core/render/dom/compiler/compile_control.ts +++ b/modules/angular2/src/core/render/dom/compiler/compile_control.ts @@ -1,5 +1,5 @@ import {isBlank} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {CompileElement} from './compile_element'; import {CompileStep} from './compile_step'; @@ -14,7 +14,7 @@ export class CompileControl { _additionalChildren: CompileElement[] = null; _ignoreCurrentElement: boolean; - constructor(public _steps: List) {} + constructor(public _steps: Array) {} // only public so that it can be used by compile_pipeline internalProcess(results: any[], startStepIndex: number, parent: CompileElement, diff --git a/modules/angular2/src/core/render/dom/compiler/compile_element.ts b/modules/angular2/src/core/render/dom/compiler/compile_element.ts index a5b2876deecbd9..34c1d6d5ebcf41 100644 --- a/modules/angular2/src/core/render/dom/compiler/compile_element.ts +++ b/modules/angular2/src/core/render/dom/compiler/compile_element.ts @@ -1,4 +1,4 @@ -import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import { isBlank, @@ -17,7 +17,7 @@ import {ProtoViewBuilder, ElementBinderBuilder} from '../view/proto_view_builder */ export class CompileElement { _attrs: Map = null; - _classList: List = null; + _classList: Array = null; isViewRoot: boolean = false; // inherited down to children if they don't have an own protoView inheritedProtoView: ProtoViewBuilder = null; @@ -63,7 +63,7 @@ export class CompileElement { return this._attrs; } - classList(): List { + classList(): Array { if (isBlank(this._classList)) { this._classList = []; var elClassList = DOM.classList(this.element); diff --git a/modules/angular2/src/core/render/dom/compiler/compile_pipeline.ts b/modules/angular2/src/core/render/dom/compiler/compile_pipeline.ts index 0d20f0dbb759c8..579eb6ce82bacb 100644 --- a/modules/angular2/src/core/render/dom/compiler/compile_pipeline.ts +++ b/modules/angular2/src/core/render/dom/compiler/compile_pipeline.ts @@ -1,5 +1,5 @@ import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {CompileElement} from './compile_element'; import {CompileControl} from './compile_control'; @@ -13,7 +13,7 @@ import {ProtoViewDto, ViewType, ViewDefinition} from '../../api'; */ export class CompilePipeline { _control: CompileControl; - constructor(public steps: List) { this._control = new CompileControl(steps); } + constructor(public steps: Array) { this._control = new CompileControl(steps); } processStyles(styles: string[]): string[] { return styles.map(style => { diff --git a/modules/angular2/src/core/render/dom/compiler/compile_step_factory.ts b/modules/angular2/src/core/render/dom/compiler/compile_step_factory.ts index 5f2b3b99557122..1574e0fc2be1bf 100644 --- a/modules/angular2/src/core/render/dom/compiler/compile_step_factory.ts +++ b/modules/angular2/src/core/render/dom/compiler/compile_step_factory.ts @@ -1,4 +1,3 @@ -import {List} from 'angular2/src/core/facade/collection'; import {Parser} from 'angular2/src/core/change_detection/change_detection'; import {ViewDefinition} from '../../api'; import {CompileStep} from './compile_step'; @@ -9,14 +8,14 @@ import {ViewSplitter} from './view_splitter'; import {StyleEncapsulator} from './style_encapsulator'; export class CompileStepFactory { - createSteps(view: ViewDefinition): List { return null; } + createSteps(view: ViewDefinition): Array { return null; } } export class DefaultStepFactory extends CompileStepFactory { private _componentUIDsCache: Map = new Map(); constructor(private _parser: Parser, private _appId: string) { super(); } - createSteps(view: ViewDefinition): List { + createSteps(view: ViewDefinition): Array { return [ new ViewSplitter(this._parser), new PropertyBindingParser(this._parser), diff --git a/modules/angular2/src/core/render/dom/compiler/compiler.ts b/modules/angular2/src/core/render/dom/compiler/compiler.ts index 093974a15fbc46..712e7abf171801 100644 --- a/modules/angular2/src/core/render/dom/compiler/compiler.ts +++ b/modules/angular2/src/core/render/dom/compiler/compiler.ts @@ -68,7 +68,7 @@ export class DomCompiler extends RenderCompiler { } mergeProtoViewsRecursively( - protoViewRefs: List>): Promise { + protoViewRefs: Array>): Promise { return PromiseWrapper.resolve( pvm.mergeProtoViewsRecursively(this._templateCloner, protoViewRefs)); } diff --git a/modules/angular2/src/core/render/dom/compiler/directive_parser.ts b/modules/angular2/src/core/render/dom/compiler/directive_parser.ts index 70fa28432b4693..2708e176a72d74 100644 --- a/modules/angular2/src/core/render/dom/compiler/directive_parser.ts +++ b/modules/angular2/src/core/render/dom/compiler/directive_parser.ts @@ -1,5 +1,5 @@ import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang'; -import {List, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {Parser} from 'angular2/src/core/change_detection/change_detection'; @@ -21,7 +21,7 @@ import {DirectiveBuilder, ElementBinderBuilder} from '../view/proto_view_builder export class DirectiveParser implements CompileStep { _selectorMatcher: SelectorMatcher = new SelectorMatcher(); - constructor(public _parser: Parser, public _directives: List) { + constructor(public _parser: Parser, public _directives: Array) { for (var i = 0; i < _directives.length; i++) { var directive = _directives[i]; var selector = CssSelector.parse(directive.selector); @@ -114,7 +114,7 @@ export class DirectiveParser implements CompileStep { let dirProperty: string; // Name of the property on the element let elProp: string; - let pipes: List; + let pipes: Array; let assignIndex: number = bindConfig.indexOf(':'); if (assignIndex > -1) { diff --git a/modules/angular2/src/core/render/dom/compiler/selector.ts b/modules/angular2/src/core/render/dom/compiler/selector.ts index 7694a988e32f34..a868e74ec869a5 100644 --- a/modules/angular2/src/core/render/dom/compiler/selector.ts +++ b/modules/angular2/src/core/render/dom/compiler/selector.ts @@ -1,4 +1,4 @@ -import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import { isPresent, isBlank, @@ -322,7 +322,7 @@ export class SelectorMatcher { var selectables = map.get(name); var starSelectables = map.get("*"); if (isPresent(starSelectables)) { - selectables = ListWrapper.concat(selectables, starSelectables); + selectables = selectables.concat(starSelectables); } if (isBlank(selectables)) { return false; diff --git a/modules/angular2/src/core/render/dom/compiler/shadow_css.ts b/modules/angular2/src/core/render/dom/compiler/shadow_css.ts index 4f6afd624b8e21..fb92f0ac00d776 100644 --- a/modules/angular2/src/core/render/dom/compiler/shadow_css.ts +++ b/modules/angular2/src/core/render/dom/compiler/shadow_css.ts @@ -1,5 +1,5 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import { StringWrapper, RegExp, diff --git a/modules/angular2/src/core/render/dom/compiler/style_inliner.ts b/modules/angular2/src/core/render/dom/compiler/style_inliner.ts index b8c34416fd709c..84d7ffd5e25f62 100644 --- a/modules/angular2/src/core/render/dom/compiler/style_inliner.ts +++ b/modules/angular2/src/core/render/dom/compiler/style_inliner.ts @@ -42,7 +42,7 @@ export class StyleInliner { return this._inlineImports(cssText, baseUrl, []); } - _inlineImports(cssText: string, baseUrl: string, inlinedUrls: List): Promise| + _inlineImports(cssText: string, baseUrl: string, inlinedUrls: Array): Promise| string { var partIndex = 0; var parts = StringWrapper.split(cssText, _importRe); diff --git a/modules/angular2/src/core/render/dom/compiler/view_loader.ts b/modules/angular2/src/core/render/dom/compiler/view_loader.ts index 05095389ab9f97..44bb49081d06e1 100644 --- a/modules/angular2/src/core/render/dom/compiler/view_loader.ts +++ b/modules/angular2/src/core/render/dom/compiler/view_loader.ts @@ -7,7 +7,7 @@ import { isPromise, StringWrapper } from 'angular2/src/core/facade/lang'; -import {Map, MapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {ViewDefinition} from '../../api'; @@ -35,7 +35,7 @@ export class ViewLoader { load(viewDef: ViewDefinition): Promise { var r = wtfStartTimeRange('ViewLoader#load()', stringify(viewDef.componentId)); - let tplAndStyles: List| Promise| string> = + let tplAndStyles: Array| Promise| string> = [this._loadHtml(viewDef.template, viewDef.templateAbsUrl, viewDef.componentId)]; if (isPresent(viewDef.styles)) { viewDef.styles.forEach((cssText: string) => { @@ -54,7 +54,7 @@ export class ViewLoader { // Inline the styles from the @View annotation return PromiseWrapper.all(tplAndStyles) - .then((res: List) => { + .then((res: Array) => { let loadedTplAndStyles = res[0]; let styles = ListWrapper.slice(res, 1); diff --git a/modules/angular2/src/core/render/dom/dom_renderer.ts b/modules/angular2/src/core/render/dom/dom_renderer.ts index d6e7a50bd6d99c..9d52ccffc3d14c 100644 --- a/modules/angular2/src/core/render/dom/dom_renderer.ts +++ b/modules/angular2/src/core/render/dom/dom_renderer.ts @@ -6,13 +6,7 @@ import { RegExpWrapper, CONST_EXPR } from 'angular2/src/core/facade/lang'; -import { - ListWrapper, - MapWrapper, - Map, - StringMapWrapper, - List -} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; @@ -96,7 +90,7 @@ export class DomRenderer extends Renderer { .boundElements[location.renderBoundElementIndex]; } - getRootNodes(fragment: RenderFragmentRef): List { + getRootNodes(fragment: RenderFragmentRef): Array { return resolveInternalDomFragment(fragment); } @@ -194,7 +188,7 @@ export class DomRenderer extends Renderer { view.setElementStyle(location.renderBoundElementIndex, styleName, styleValue); } - invokeElementMethod(location: RenderElementRef, methodName: string, args: List): void { + invokeElementMethod(location: RenderElementRef, methodName: string, args: Array): void { if (isBlank(location.renderBoundElementIndex)) { return; } diff --git a/modules/angular2/src/core/render/dom/events/event_manager.ts b/modules/angular2/src/core/render/dom/events/event_manager.ts index 9d3399595cf16c..f330f4e7ff1a6e 100644 --- a/modules/angular2/src/core/render/dom/events/event_manager.ts +++ b/modules/angular2/src/core/render/dom/events/event_manager.ts @@ -1,12 +1,12 @@ import {isBlank, BaseException, isPresent, StringWrapper} from 'angular2/src/core/facade/lang'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; var BUBBLE_SYMBOL = '^'; export class EventManager { - constructor(public _plugins: List, public _zone: NgZone) { + constructor(public _plugins: Array, public _zone: NgZone) { for (var i = 0; i < _plugins.length; i++) { _plugins[i].manager = this; } diff --git a/modules/angular2/src/core/render/dom/view/element_binder.ts b/modules/angular2/src/core/render/dom/view/element_binder.ts index 8cd669799f4fb8..b75a5572c18a22 100644 --- a/modules/angular2/src/core/render/dom/view/element_binder.ts +++ b/modules/angular2/src/core/render/dom/view/element_binder.ts @@ -1,22 +1,22 @@ import {AST} from 'angular2/src/core/change_detection/change_detection'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {isPresent} from 'angular2/src/core/facade/lang'; export class DomElementBinder { - textNodeIndices: List; + textNodeIndices: Array; hasNestedProtoView: boolean; eventLocals: AST; - localEvents: List; - globalEvents: List; + localEvents: Array; + globalEvents: Array; hasNativeShadowRoot: boolean; constructor({textNodeIndices, hasNestedProtoView, eventLocals, localEvents, globalEvents, hasNativeShadowRoot}: { - textNodeIndices?: List, + textNodeIndices?: Array, hasNestedProtoView?: boolean, eventLocals?: AST, - localEvents?: List, - globalEvents?: List, + localEvents?: Array, + globalEvents?: Array, hasNativeShadowRoot?: boolean } = {}) { this.textNodeIndices = textNodeIndices; diff --git a/modules/angular2/src/core/render/dom/view/proto_view.ts b/modules/angular2/src/core/render/dom/view/proto_view.ts index 9c697379c75d2b..28e20971a21c33 100644 --- a/modules/angular2/src/core/render/dom/view/proto_view.ts +++ b/modules/angular2/src/core/render/dom/view/proto_view.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {DomElementBinder} from './element_binder'; import {RenderProtoViewRef, ViewType, ViewEncapsulation} from '../../api'; @@ -18,7 +18,7 @@ export class DomProtoViewRef extends RenderProtoViewRef { export class DomProtoView { static create(templateCloner: TemplateCloner, type: ViewType, rootElement: Element, viewEncapsulation: ViewEncapsulation, fragmentsRootNodeCount: number[], - rootTextNodeIndices: number[], elementBinders: List, + rootTextNodeIndices: number[], elementBinders: Array, hostAttributes: Map): DomProtoView { var boundTextNodeCount = rootTextNodeIndices.length; for (var i = 0; i < elementBinders.length; i++) { @@ -34,7 +34,7 @@ export class DomProtoView { // Note: fragments are separated by a comment node that is not counted in fragmentsRootNodeCount! constructor(public type: ViewType, public cloneableTemplate: Element | string, public encapsulation: ViewEncapsulation, - public elementBinders: List, + public elementBinders: Array, public hostAttributes: Map, public rootTextNodeIndices: number[], public boundTextNodeCount: number, public fragmentsRootNodeCount: number[], public isSingleElementFragment: boolean) {} diff --git a/modules/angular2/src/core/render/dom/view/proto_view_builder.ts b/modules/angular2/src/core/render/dom/view/proto_view_builder.ts index f9cb9cd3e8b235..2fb98cc2e75a23 100644 --- a/modules/angular2/src/core/render/dom/view/proto_view_builder.ts +++ b/modules/angular2/src/core/render/dom/view/proto_view_builder.ts @@ -4,7 +4,6 @@ import { MapWrapper, Set, SetWrapper, - List, StringMapWrapper } from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; @@ -39,7 +38,7 @@ import {EVENT_TARGET_SEPARATOR} from "../../event_config"; export class ProtoViewBuilder { variableBindings: Map = new Map(); - elements: List = []; + elements: Array = []; rootTextBindings: Map = new Map(); ngContentCount: number = 0; hostAttributes: Map = new Map(); @@ -153,11 +152,11 @@ export class ProtoViewBuilder { export class ElementBinderBuilder { parent: ElementBinderBuilder = null; distanceToParent: number = 0; - directives: List = []; + directives: Array = []; nestedProtoView: ProtoViewBuilder = null; propertyBindings: Map = new Map(); variableBindings: Map = new Map(); - eventBindings: List = []; + eventBindings: Array = []; eventBuilder: EventBuilder = new EventBuilder(); textBindings: Map = new Map(); readAttributes: Map = new Map(); @@ -233,9 +232,9 @@ export class DirectiveBuilder { // mapping from directive property name to AST for that directive propertyBindings: Map = new Map(); // property names used in the template - templatePropertyNames: List = []; + templatePropertyNames: Array = []; hostPropertyBindings: Map = new Map(); - eventBindings: List = []; + eventBindings: Array = []; eventBuilder: EventBuilder = new EventBuilder(); constructor(public directiveIndex: number) {} @@ -259,9 +258,9 @@ export class DirectiveBuilder { } class EventBuilder extends AstTransformer { - locals: List = []; - localEvents: List = []; - globalEvents: List = []; + locals: Array = []; + localEvents: Array = []; + globalEvents: Array = []; _implicitReceiver: AST = new ImplicitReceiver(); constructor() { super(); } @@ -303,19 +302,19 @@ class EventBuilder extends AstTransformer { } } - buildEventLocals(): List { return this.locals; } + buildEventLocals(): Array { return this.locals; } - buildLocalEvents(): List { return this.localEvents; } + buildLocalEvents(): Array { return this.localEvents; } - buildGlobalEvents(): List { return this.globalEvents; } + buildGlobalEvents(): Array { return this.globalEvents; } merge(eventBuilder: EventBuilder) { this._merge(this.localEvents, eventBuilder.localEvents); this._merge(this.globalEvents, eventBuilder.globalEvents); - ListWrapper.concat(this.locals, eventBuilder.locals); + this.locals.concat(eventBuilder.locals); } - _merge(host: List, tobeAdded: List) { + _merge(host: Array, tobeAdded: Array) { var names = []; for (var i = 0; i < host.length; i++) { names.push(host[i].fullName); @@ -336,7 +335,7 @@ const STYLE_PREFIX = 'style'; function buildElementPropertyBindings( schemaRegistry: ElementSchemaRegistry, protoElement: /*element*/ any, isNgComponent: boolean, bindingsInTemplate: Map, directiveTemplatePropertyNames: Set): - List { + Array { var propertyBindings = []; MapWrapper.forEach(bindingsInTemplate, (ast, propertyNameInTemplate) => { diff --git a/modules/angular2/src/core/render/dom/view/proto_view_merger.ts b/modules/angular2/src/core/render/dom/view/proto_view_merger.ts index 5fad74367c59c3..f9f4600cc5ef31 100644 --- a/modules/angular2/src/core/render/dom/view/proto_view_merger.ts +++ b/modules/angular2/src/core/render/dom/view/proto_view_merger.ts @@ -25,7 +25,7 @@ import { import {TemplateCloner} from '../template_cloner'; export function mergeProtoViewsRecursively(templateCloner: TemplateCloner, - protoViewRefs: List>): + protoViewRefs: Array>): RenderProtoViewMergeMapping { // clone var clonedProtoViews = []; @@ -77,7 +77,7 @@ export function mergeProtoViewsRecursively(templateCloner: TemplateCloner, } function cloneProtoViews( - templateCloner: TemplateCloner, protoViewRefs: List>, + templateCloner: TemplateCloner, protoViewRefs: Array>, targetClonedProtoViews: ClonedProtoView[], targetHostViewAndBinderIndices: number[][]) { var hostProtoView = resolveInternalDomProtoView(protoViewRefs[0]); var hostPvIdx = targetClonedProtoViews.length; diff --git a/modules/angular2/src/core/render/dom/view/view.ts b/modules/angular2/src/core/render/dom/view/view.ts index df70150f1331d5..7a8f38ad867820 100644 --- a/modules/angular2/src/core/render/dom/view/view.ts +++ b/modules/angular2/src/core/render/dom/view/view.ts @@ -1,11 +1,5 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import { - ListWrapper, - MapWrapper, - Map, - StringMapWrapper, - List -} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {isPresent, isBlank, BaseException, stringify} from 'angular2/src/core/facade/lang'; import {DomProtoView} from './proto_view'; @@ -27,9 +21,9 @@ export class DomViewRef extends RenderViewRef { export class DomView { hydrated: boolean = false; eventDispatcher: RenderEventDispatcher = null; - eventHandlerRemovers: List = []; + eventHandlerRemovers: Array = []; - constructor(public proto: DomProtoView, public boundTextNodes: List, + constructor(public proto: DomProtoView, public boundTextNodes: Array, public boundElements: Element[]) {} setElementProperty(elementIndex: number, propertyName: string, value: any) { @@ -65,7 +59,7 @@ export class DomView { } } - invokeElementMethod(elementIndex: number, methodName: string, args: List) { + invokeElementMethod(elementIndex: number, methodName: string, args: Array) { var element = this.boundElements[elementIndex]; DOM.invoke(element, methodName, args); } diff --git a/modules/angular2/src/core/render/dom/view/view_container.ts b/modules/angular2/src/core/render/dom/view/view_container.ts index de3b9735cd60df..55cd1fd15e8703 100644 --- a/modules/angular2/src/core/render/dom/view/view_container.ts +++ b/modules/angular2/src/core/render/dom/view/view_container.ts @@ -1,8 +1,8 @@ -import {ListWrapper, MapWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import * as viewModule from './view'; export class DomViewContainer { // The order in this list matches the DOM order. - views: List = []; + views: Array = []; } diff --git a/modules/angular2/src/core/render/xhr_mock.ts b/modules/angular2/src/core/render/xhr_mock.ts index 6099e96f29a38c..c3fa7b6ef152cb 100644 --- a/modules/angular2/src/core/render/xhr_mock.ts +++ b/modules/angular2/src/core/render/xhr_mock.ts @@ -1,12 +1,12 @@ import {XHR} from 'angular2/src/core/render/xhr'; -import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; import {isBlank, isPresent, normalizeBlank, BaseException} from 'angular2/src/core/facade/lang'; import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; export class MockXHR extends XHR { - private _expectations: List<_Expectation>; + private _expectations: Array<_Expectation>; private _definitions: Map; - private _requests: List<_PendingRequest>; + private _requests: Array<_PendingRequest>; constructor() { super(); diff --git a/modules/angular2/src/core/services/url_resolver.ts b/modules/angular2/src/core/services/url_resolver.ts index 7af5dcb7beeaa7..318a65b30833dd 100644 --- a/modules/angular2/src/core/services/url_resolver.ts +++ b/modules/angular2/src/core/services/url_resolver.ts @@ -200,7 +200,7 @@ enum _ComponentIndex { * on the browser's regular expression implementation. Never null, since * arbitrary strings may still look like path names. */ -function _split(uri: string): List { +function _split(uri: string): Array { return RegExpWrapper.firstMatch(_splitRe, uri); } @@ -255,7 +255,7 @@ function _removeDotSegments(path: string): string { * @param {Array.} parts * @return {string} */ -function _joinAndCanonicalizePath(parts: List): string { +function _joinAndCanonicalizePath(parts: Array): string { var path = parts[_ComponentIndex.Path]; path = isBlank(path) ? '' : _removeDotSegments(path); parts[_ComponentIndex.Path] = path; diff --git a/modules/angular2/src/core/testability/get_testability.ts b/modules/angular2/src/core/testability/get_testability.ts index ab98d257615379..dca2dfe4d5bae1 100644 --- a/modules/angular2/src/core/testability/get_testability.ts +++ b/modules/angular2/src/core/testability/get_testability.ts @@ -8,7 +8,7 @@ class PublicTestability { whenStable(callback: Function) { this._testability.whenStable(callback); } - findBindings(using: any, binding: string, exactMatch: boolean): List { + findBindings(using: any, binding: string, exactMatch: boolean): Array { return this._testability.findBindings(using, binding, exactMatch); } } @@ -24,7 +24,7 @@ export class GetTestability { } return new PublicTestability(testability); }; - global.getAllAngularTestabilities = function(): List { + global.getAllAngularTestabilities = function(): Array { var testabilities = registry.getAllTestabilities(); return testabilities.map((testability) => { return new PublicTestability(testability); }); }; diff --git a/modules/angular2/src/core/testability/testability.ts b/modules/angular2/src/core/testability/testability.ts index a8a73286967a89..7bff59b4c9a14d 100644 --- a/modules/angular2/src/core/testability/testability.ts +++ b/modules/angular2/src/core/testability/testability.ts @@ -1,6 +1,6 @@ import {Injectable} from 'angular2/di'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {Map, MapWrapper, List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {StringWrapper, isBlank, BaseException} from 'angular2/src/core/facade/lang'; import * as getTestabilityModule from './get_testability'; import {NgZone} from '../zone/ng_zone'; @@ -15,7 +15,7 @@ import {PromiseWrapper} from 'angular2/src/core/facade/async'; @Injectable() export class Testability { _pendingCount: number = 0; - _callbacks: List = []; + _callbacks: Array = []; _isAngularEventPending: boolean = false; constructor(public _ngZone: NgZone) { this._watchAngularEvents(_ngZone); } @@ -66,7 +66,7 @@ export class Testability { // check for stability. isAngularEventPending(): boolean { return this._isAngularEventPending; } - findBindings(using: any, binding: string, exactMatch: boolean): List { + findBindings(using: any, binding: string, exactMatch: boolean): Array { // TODO(juliemr): implement. return []; } @@ -82,7 +82,7 @@ export class TestabilityRegistry { this._applications.set(token, testability); } - getAllTestabilities(): List { return MapWrapper.values(this._applications); } + getAllTestabilities(): Array { return MapWrapper.values(this._applications); } findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability { if (elem == null) { diff --git a/modules/angular2/src/core/zone/ng_zone.ts b/modules/angular2/src/core/zone/ng_zone.ts index 261a01ecbcc839..068a2c887d8ec7 100644 --- a/modules/angular2/src/core/zone/ng_zone.ts +++ b/modules/angular2/src/core/zone/ng_zone.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {normalizeBlank, isPresent, global} from 'angular2/src/core/facade/lang'; import {wtfLeave, wtfCreateScope, WtfScopeFn} from '../profile/profile'; @@ -45,7 +45,7 @@ export class NgZone { _inVmTurnDone: boolean = false; - _pendingTimeouts: List = []; + _pendingTimeouts: Array = []; /** * Associates with this diff --git a/modules/angular2/src/forms/directives.ts b/modules/angular2/src/forms/directives.ts index 83c5dfe6511d07..94d2859dc7288a 100644 --- a/modules/angular2/src/forms/directives.ts +++ b/modules/angular2/src/forms/directives.ts @@ -35,7 +35,7 @@ export {NgValidator, NgRequiredValidator} from './directives/validators'; * * This is a shorthand for importing them each individually. */ -export const FORM_DIRECTIVES: List = CONST_EXPR([ +export const FORM_DIRECTIVES: Array = CONST_EXPR([ NgControlName, NgControlGroup, diff --git a/modules/angular2/src/forms/directives/control_container.ts b/modules/angular2/src/forms/directives/control_container.ts index eb1896b5c36d29..06b37492cfe928 100644 --- a/modules/angular2/src/forms/directives/control_container.ts +++ b/modules/angular2/src/forms/directives/control_container.ts @@ -1,6 +1,5 @@ import {Form} from './form_interface'; import {AbstractControlDirective} from './abstract_control_directive'; -import {List} from 'angular2/src/core/facade/collection'; /** * A directive that contains a group of [NgControl]. @@ -10,5 +9,5 @@ import {List} from 'angular2/src/core/facade/collection'; export class ControlContainer extends AbstractControlDirective { name: string; get formDirective(): Form { return null; } - get path(): List { return null; } + get path(): Array { return null; } } diff --git a/modules/angular2/src/forms/directives/ng_control.ts b/modules/angular2/src/forms/directives/ng_control.ts index 68b185bf3e5c02..025aab5b99b6b2 100644 --- a/modules/angular2/src/forms/directives/ng_control.ts +++ b/modules/angular2/src/forms/directives/ng_control.ts @@ -11,7 +11,7 @@ export class NgControl extends AbstractControlDirective { valueAccessor: ControlValueAccessor = null; get validator(): Function { return null; } - get path(): List { return null; } + get path(): Array { return null; } viewToModelUpdate(newValue: any): void {} } diff --git a/modules/angular2/src/forms/directives/ng_control_group.ts b/modules/angular2/src/forms/directives/ng_control_group.ts index 9b5e6c3001d247..2dca5110a72fbe 100644 --- a/modules/angular2/src/forms/directives/ng_control_group.ts +++ b/modules/angular2/src/forms/directives/ng_control_group.ts @@ -1,6 +1,6 @@ import {Directive, LifecycleEvent} from 'angular2/metadata'; import {Inject, Host, SkipSelf, forwardRef, Binding} from 'angular2/di'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {CONST_EXPR} from 'angular2/src/core/facade/lang'; import {ControlContainer} from './control_container'; @@ -68,7 +68,7 @@ export class NgControlGroup extends ControlContainer { get control(): ControlGroup { return this.formDirective.getControlGroup(this); } - get path(): List { return controlPath(this.name, this._parent); } + get path(): Array { return controlPath(this.name, this._parent); } get formDirective(): Form { return this._parent.formDirective; } } diff --git a/modules/angular2/src/forms/directives/ng_control_name.ts b/modules/angular2/src/forms/directives/ng_control_name.ts index 8dbc19e07a3e73..39e29fb1343a65 100644 --- a/modules/angular2/src/forms/directives/ng_control_name.ts +++ b/modules/angular2/src/forms/directives/ng_control_name.ts @@ -1,6 +1,6 @@ import {CONST_EXPR} from 'angular2/src/core/facade/lang'; import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {List, StringMap} from 'angular2/src/core/facade/collection'; +import {StringMap} from 'angular2/src/core/facade/collection'; import {QueryList} from 'angular2/core'; import {Query, Directive, LifecycleEvent} from 'angular2/metadata'; @@ -113,7 +113,7 @@ export class NgControlName extends NgControl { ObservableWrapper.callNext(this.update, newValue); } - get path(): List { return controlPath(this.name, this._parent); } + get path(): Array { return controlPath(this.name, this._parent); } get formDirective(): any { return this._parent.formDirective; } diff --git a/modules/angular2/src/forms/directives/ng_form.ts b/modules/angular2/src/forms/directives/ng_form.ts index d6fa27d6b79a07..75625812034e33 100644 --- a/modules/angular2/src/forms/directives/ng_form.ts +++ b/modules/angular2/src/forms/directives/ng_form.ts @@ -4,7 +4,7 @@ import { EventEmitter, PromiseCompleter } from 'angular2/src/core/facade/async'; -import {StringMapWrapper, List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/core/facade/lang'; import {Directive} from 'angular2/metadata'; import {forwardRef, Binding} from 'angular2/di'; @@ -72,7 +72,7 @@ export class NgForm extends ControlContainer implements Form { get control(): ControlGroup { return this.form; } - get path(): List { return []; } + get path(): Array { return []; } get controls(): StringMap { return this.form.controls; } @@ -133,7 +133,7 @@ export class NgForm extends ControlContainer implements Form { return false; } - _findContainer(path: List): ControlGroup { + _findContainer(path: Array): ControlGroup { ListWrapper.removeLast(path); return ListWrapper.isEmpty(path) ? this.form : this.form.find(path); } diff --git a/modules/angular2/src/forms/directives/ng_form_control.ts b/modules/angular2/src/forms/directives/ng_form_control.ts index e8d2930015c846..b12eedca2848de 100644 --- a/modules/angular2/src/forms/directives/ng_form_control.ts +++ b/modules/angular2/src/forms/directives/ng_form_control.ts @@ -91,7 +91,7 @@ export class NgFormControl extends NgControl { } } - get path(): List { return []; } + get path(): Array { return []; } get control(): Control { return this.form; } diff --git a/modules/angular2/src/forms/directives/ng_form_model.ts b/modules/angular2/src/forms/directives/ng_form_model.ts index 89a0824c89218b..c7aa8a0100d127 100644 --- a/modules/angular2/src/forms/directives/ng_form_model.ts +++ b/modules/angular2/src/forms/directives/ng_form_model.ts @@ -1,5 +1,5 @@ import {CONST_EXPR} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ObservableWrapper, EventEmitter} from 'angular2/src/core/facade/async'; import {Directive, LifecycleEvent} from 'angular2/metadata'; @@ -93,7 +93,7 @@ const formDirectiveBinding = }) export class NgFormModel extends ControlContainer implements Form { form: ControlGroup = null; - directives: List = []; + directives: Array = []; ngSubmit = new EventEmitter(); onChanges(_) { this._updateDomValue(); } @@ -102,7 +102,7 @@ export class NgFormModel extends ControlContainer implements Form { get control(): ControlGroup { return this.form; } - get path(): List { return []; } + get path(): Array { return []; } addControl(dir: NgControl): void { var c: any = this.form.find(dir.path); diff --git a/modules/angular2/src/forms/directives/ng_model.ts b/modules/angular2/src/forms/directives/ng_model.ts index f564deebc3113e..cae1848ff524cc 100644 --- a/modules/angular2/src/forms/directives/ng_model.ts +++ b/modules/angular2/src/forms/directives/ng_model.ts @@ -64,7 +64,7 @@ export class NgModel extends NgControl { get control(): Control { return this._control; } - get path(): List { return []; } + get path(): Array { return []; } get validator(): Function { return composeNgValidator(this.ngValidators); } diff --git a/modules/angular2/src/forms/form_builder.ts b/modules/angular2/src/forms/form_builder.ts index ccdcbce183ef71..0281cda0737aa6 100644 --- a/modules/angular2/src/forms/form_builder.ts +++ b/modules/angular2/src/forms/form_builder.ts @@ -1,5 +1,5 @@ import {Injectable} from 'angular2/di'; -import {StringMapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {isPresent, isArray} from 'angular2/src/core/facade/lang'; import * as modelModule from './model'; @@ -91,7 +91,7 @@ export class FormBuilder { } } - array(controlsConfig: List, validator: Function = null): modelModule.ControlArray { + array(controlsConfig: Array, validator: Function = null): modelModule.ControlArray { var controls = ListWrapper.map(controlsConfig, (c) => this._createControl(c)); if (isPresent(validator)) { return new modelModule.ControlArray(controls, validator); @@ -115,7 +115,7 @@ export class FormBuilder { return controlConfig; } else if (isArray(controlConfig)) { - var value = ListWrapper.get(controlConfig, 0); + var value = controlConfig[0]; var validator = controlConfig.length > 1 ? controlConfig[1] : null; return this.control(value, validator); diff --git a/modules/angular2/src/forms/model.ts b/modules/angular2/src/forms/model.ts index a3a742c57d4c0b..9b71f34bb9f861 100644 --- a/modules/angular2/src/forms/model.ts +++ b/modules/angular2/src/forms/model.ts @@ -1,6 +1,6 @@ import {StringWrapper, isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {Observable, EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {StringMap, StringMapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {StringMap, StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {Validators} from './validators'; /** @@ -17,14 +17,14 @@ export function isControl(c: Object): boolean { return c instanceof AbstractControl; } -function _find(c: AbstractControl, path: List| string) { +function _find(c: AbstractControl, path: Array| string) { if (isBlank(path)) return null; - if (!(path instanceof List)) { + if (!(path instanceof Array)) { path = StringWrapper.split(path, new RegExp("/")); } - if (path instanceof List && ListWrapper.isEmpty(path)) return null; + if (path instanceof Array && ListWrapper.isEmpty(path)) return null; - return ListWrapper.reduce(>path, (v, name) => { + return ListWrapper.reduce(>path, (v, name) => { if (v instanceof ControlGroup) { return isPresent(v.controls[name]) ? v.controls[name] : null; } else if (v instanceof ControlArray) { @@ -116,9 +116,9 @@ export class AbstractControl { } } - find(path: List| string): AbstractControl { return _find(this, path); } + find(path: Array| string): AbstractControl { return _find(this, path); } - getError(errorCode: string, path: List = null): any { + getError(errorCode: string, path: Array = null): any { var c = isPresent(path) && !ListWrapper.isEmpty(path) ? this.find(path) : this; if (isPresent(c) && isPresent(c._errors)) { return StringMapWrapper.get(c._errors, errorCode); @@ -127,7 +127,7 @@ export class AbstractControl { } } - hasError(errorCode: string, path: List = null): boolean { + hasError(errorCode: string, path: Array = null): boolean { return isPresent(this.getError(errorCode, path)); } @@ -183,8 +183,8 @@ export class ControlGroup extends AbstractControl { controls: StringMap; _optionals: StringMap; - constructor(controls: StringMap, - optionals: StringMap = null, + constructor(controls: StringMap, + optionals: StringMap = null, validator: Function = Validators.group) { super(validator); this.controls = controls; @@ -262,9 +262,9 @@ export class ControlGroup extends AbstractControl { * other controls, but is of fixed length. */ export class ControlArray extends AbstractControl { - controls: List; + controls: Array; - constructor(controls: List, validator: Function = Validators.array) { + constructor(controls: Array, validator: Function = Validators.array) { super(validator); this.controls = controls; diff --git a/modules/angular2/src/forms/validators.ts b/modules/angular2/src/forms/validators.ts index 418a72f682d216..55d62c7d314d6d 100644 --- a/modules/angular2/src/forms/validators.ts +++ b/modules/angular2/src/forms/validators.ts @@ -1,5 +1,5 @@ import {isBlank, isPresent} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import * as modelModule from './model'; @@ -19,7 +19,7 @@ export class Validators { static nullValidator(c: any): StringMap { return null; } - static compose(validators: List): Function { + static compose(validators: Array): Function { return function(c: modelModule.Control) { var res = ListWrapper.reduce(validators, (res, validator) => { var errors = validator(c); diff --git a/modules/angular2/src/http/headers.ts b/modules/angular2/src/http/headers.ts index f72ecf848f0fcb..f2268ba5d42359 100644 --- a/modules/angular2/src/http/headers.ts +++ b/modules/angular2/src/http/headers.ts @@ -8,7 +8,6 @@ import { } from 'angular2/src/core/facade/lang'; import { isListLikeIterable, - List, Map, MapWrapper, ListWrapper, @@ -21,7 +20,7 @@ import { * difference from the spec is the lack of an `entries` method. */ export class Headers { - _headersMap: Map>; + _headersMap: Map>; constructor(headers?: Headers | StringMap) { if (isBlank(headers)) { this._headersMap = new Map(); @@ -31,7 +30,7 @@ export class Headers { if (headers instanceof Headers) { this._headersMap = (headers)._headersMap; } else if (headers instanceof StringMap) { - this._headersMap = MapWrapper.createFromStringMap>(headers); + this._headersMap = MapWrapper.createFromStringMap>(headers); MapWrapper.forEach(this._headersMap, (v, k) => { if (!isListLikeIterable(v)) { var list = []; @@ -72,16 +71,16 @@ export class Headers { /** * Provides names of set headers */ - keys(): List { return MapWrapper.keys(this._headersMap); } + keys(): Array { return MapWrapper.keys(this._headersMap); } /** * Sets or overrides header value for given name. */ - set(header: string, value: string | List): void { + set(header: string, value: string | Array): void { var list = []; if (isListLikeIterable(value)) { - var pushValue = (>value).join(','); + var pushValue = (>value).join(','); list.push(pushValue); } else { list.push(value); @@ -93,7 +92,7 @@ export class Headers { /** * Returns values of all headers. */ - values(): List> { return MapWrapper.values(this._headersMap); } + values(): Array> { return MapWrapper.values(this._headersMap); } /** * Returns list of header values for a given name. diff --git a/modules/angular2/src/http/url_search_params.ts b/modules/angular2/src/http/url_search_params.ts index 3696d9a16779de..5ca70741a49162 100644 --- a/modules/angular2/src/http/url_search_params.ts +++ b/modules/angular2/src/http/url_search_params.ts @@ -2,19 +2,18 @@ import {CONST_EXPR, isPresent, isBlank, StringWrapper} from 'angular2/src/core/f import { Map, MapWrapper, - List, ListWrapper, isListLikeIterable } from 'angular2/src/core/facade/collection'; -function paramParser(rawParams: string = ''): Map> { - var map: Map> = new Map(); +function paramParser(rawParams: string = ''): Map> { + var map: Map> = new Map(); if (rawParams.length > 0) { - var params: List = StringWrapper.split(rawParams, new RegExp('&')); + var params: Array = StringWrapper.split(rawParams, new RegExp('&')); ListWrapper.forEach(params, (param: string) => { - var split: List = StringWrapper.split(param, new RegExp('=')); - var key = ListWrapper.get(split, 0); - var val = ListWrapper.get(split, 1); + var split: Array = StringWrapper.split(param, new RegExp('=')); + var key = split[0]; + var val = split[1]; var list = isPresent(map.get(key)) ? map.get(key) : []; list.push(val); map.set(key, list); @@ -35,7 +34,7 @@ export const URLSearchParamsUnionFixer: string = CONST_EXPR("UnionFixer"); * - replaceAll() */ export class URLSearchParams { - paramsMap: Map>; + paramsMap: Map>; constructor(public rawParams: string = '') { this.paramsMap = paramParser(rawParams); } clone(): URLSearchParams { @@ -55,7 +54,7 @@ export class URLSearchParams { } } - getAll(param: string): List { + getAll(param: string): Array { var mapParam = this.paramsMap.get(param); return isPresent(mapParam) ? mapParam : []; } diff --git a/modules/angular2/src/mock/location_mock.ts b/modules/angular2/src/mock/location_mock.ts index 0d38a928ecff86..64182a37b0b9ea 100644 --- a/modules/angular2/src/mock/location_mock.ts +++ b/modules/angular2/src/mock/location_mock.ts @@ -1,9 +1,9 @@ import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Location} from 'angular2/src/router/location'; export class SpyLocation implements Location { - urlChanges: List = []; + urlChanges: Array = []; _path: string = ''; _subject: EventEmitter = new EventEmitter(); _baseHref: string = ''; diff --git a/modules/angular2/src/mock/mock_location_strategy.ts b/modules/angular2/src/mock/mock_location_strategy.ts index 8387c60a21792d..8eff83c843eee9 100644 --- a/modules/angular2/src/mock/mock_location_strategy.ts +++ b/modules/angular2/src/mock/mock_location_strategy.ts @@ -1,5 +1,4 @@ import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; -import {List} from 'angular2/src/core/facade/collection'; import {LocationStrategy} from 'angular2/src/router/location_strategy'; @@ -7,7 +6,7 @@ export class MockLocationStrategy extends LocationStrategy { internalBaseHref: string = '/'; internalPath: string = '/'; internalTitle: string = ''; - urlChanges: List = []; + urlChanges: Array = []; _subject: EventEmitter = new EventEmitter(); constructor() { super(); } diff --git a/modules/angular2/src/router/instruction.ts b/modules/angular2/src/router/instruction.ts index a2a6525c5bf053..4be16eeca05275 100644 --- a/modules/angular2/src/router/instruction.ts +++ b/modules/angular2/src/router/instruction.ts @@ -3,7 +3,6 @@ import { MapWrapper, StringMap, StringMapWrapper, - List, ListWrapper } from 'angular2/src/core/facade/collection'; import {isPresent, isBlank, normalizeBlank, Type} from 'angular2/src/core/facade/lang'; @@ -42,7 +41,7 @@ export class Instruction { */ export class PrimaryInstruction { constructor(public component: ComponentInstruction, public child: PrimaryInstruction, - public auxUrls: List) {} + public auxUrls: Array) {} } export function stringifyInstruction(instruction: Instruction): string { @@ -87,7 +86,7 @@ function stringifyAux(instruction: Instruction): string { export class ComponentInstruction { reuse: boolean = false; - constructor(public urlPath: string, public urlParams: List, + constructor(public urlPath: string, public urlParams: Array, private _recognizer: PathRecognizer, public params: StringMap = null) {} get componentType() { return this._recognizer.handler.componentType; } diff --git a/modules/angular2/src/router/path_recognizer.ts b/modules/angular2/src/router/path_recognizer.ts index 63592d95268529..e0abc279dd67cc 100644 --- a/modules/angular2/src/router/path_recognizer.ts +++ b/modules/angular2/src/router/path_recognizer.ts @@ -12,7 +12,6 @@ import { MapWrapper, StringMap, StringMapWrapper, - List, ListWrapper } from 'angular2/src/core/facade/collection'; @@ -149,7 +148,7 @@ function parsePathString(route: string): StringMap { // this function is used to determine whether a route config path like `/foo/:id` collides with // `/foo/:name` -function pathDslHash(segments: List): string { +function pathDslHash(segments: Array): string { return segments.map((segment) => { if (segment instanceof StarSegment) { return '*'; @@ -164,7 +163,7 @@ function pathDslHash(segments: List): string { .join('/'); } -function splitBySlash(url: string): List { +function splitBySlash(url: string): Array { return url.split('/'); } @@ -183,12 +182,12 @@ function assertPath(path: string) { export class PathMatch { constructor(public instruction: ComponentInstruction, public remaining: Url, - public remainingAux: List) {} + public remainingAux: Array) {} } // represents something like '/foo/:bar' export class PathRecognizer { - private _segments: List; + private _segments: Array; specificity: number; terminal: boolean = true; hash: string; diff --git a/modules/angular2/src/router/pipeline.ts b/modules/angular2/src/router/pipeline.ts index 28c3f885963a49..70fb17184b405b 100644 --- a/modules/angular2/src/router/pipeline.ts +++ b/modules/angular2/src/router/pipeline.ts @@ -1,5 +1,5 @@ import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Instruction} from './instruction'; import {Injectable} from 'angular2/di'; @@ -9,7 +9,7 @@ import {Injectable} from 'angular2/di'; */ @Injectable() export class Pipeline { - steps: List; + steps: Array; constructor() { this.steps = [instruction => instruction.router.activateOutlets(instruction)]; } diff --git a/modules/angular2/src/router/route_config_decorator.ts b/modules/angular2/src/router/route_config_decorator.ts index 6d5a833498d87a..6d7d7c411b6721 100644 --- a/modules/angular2/src/router/route_config_decorator.ts +++ b/modules/angular2/src/router/route_config_decorator.ts @@ -1,7 +1,6 @@ import {RouteConfig as RouteConfigAnnotation, RouteDefinition} from './route_config_impl'; import {makeDecorator} from 'angular2/src/core/util/decorators'; -import {List} from 'angular2/src/core/facade/collection'; export {Route, Redirect, AuxRoute, AsyncRoute, RouteDefinition} from './route_config_impl'; -export var RouteConfig: (configs: List) => ClassDecorator = +export var RouteConfig: (configs: Array) => ClassDecorator = makeDecorator(RouteConfigAnnotation); diff --git a/modules/angular2/src/router/route_config_impl.ts b/modules/angular2/src/router/route_config_impl.ts index b828a0052d83ed..ae141d5531468c 100644 --- a/modules/angular2/src/router/route_config_impl.ts +++ b/modules/angular2/src/router/route_config_impl.ts @@ -1,5 +1,4 @@ import {CONST, Type} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; import {RouteDefinition} from './route_definition'; export {RouteDefinition} from './route_definition'; @@ -14,7 +13,7 @@ export {RouteDefinition} from './route_definition'; */ @CONST() export class RouteConfig { - constructor(public configs: List) {} + constructor(public configs: Array) {} } diff --git a/modules/angular2/src/router/route_recognizer.ts b/modules/angular2/src/router/route_recognizer.ts index b97ed4d3ecde90..279103aba71c9d 100644 --- a/modules/angular2/src/router/route_recognizer.ts +++ b/modules/angular2/src/router/route_recognizer.ts @@ -12,7 +12,6 @@ import { import { Map, MapWrapper, - List, ListWrapper, StringMap, StringMapWrapper @@ -37,10 +36,10 @@ export class RouteRecognizer { auxRoutes: Map = new Map(); // TODO: optimize this into a trie - matchers: List = []; + matchers: Array = []; // TODO: optimize this into a trie - redirects: List = []; + redirects: Array = []; config(config: RouteDefinition): boolean { var handler; @@ -83,7 +82,7 @@ export class RouteRecognizer { * Given a URL, returns a list of `RouteMatch`es, which are partial recognitions for some route. * */ - recognize(urlParse: Url): List { + recognize(urlParse: Url): Array { var solutions = []; urlParse = this._redirect(urlParse); @@ -131,8 +130,8 @@ export class RouteRecognizer { } export class Redirector { - segments: List = []; - toSegments: List = []; + segments: Array = []; + toSegments: Array = []; constructor(path: string, redirectTo: string) { if (path.startsWith('/')) { diff --git a/modules/angular2/src/router/route_registry.ts b/modules/angular2/src/router/route_registry.ts index 4ff02aa2d6b0a2..9961b263c67ecc 100644 --- a/modules/angular2/src/router/route_registry.ts +++ b/modules/angular2/src/router/route_registry.ts @@ -2,7 +2,6 @@ import {PathMatch} from './path_recognizer'; import {RouteRecognizer} from './route_recognizer'; import {Instruction, ComponentInstruction, PrimaryInstruction} from './instruction'; import { - List, ListWrapper, Map, MapWrapper, @@ -198,7 +197,7 @@ export class RouteRegistry { * Given a normalized list with component names and params like: `['user', {id: 3 }]` * generates a url with a leading slash relative to the provided `parentComponent`. */ - generate(linkParams: List, parentComponent: any): Instruction { + generate(linkParams: Array, parentComponent: any): Instruction { let segments = []; let componentCursor = parentComponent; @@ -283,7 +282,7 @@ export class RouteRegistry { /* * Given a list of instructions, returns the most specific instruction */ -function mostSpecific(instructions: List): PrimaryInstruction { +function mostSpecific(instructions: Array): PrimaryInstruction { return ListWrapper.maximum( instructions, (instruction: PrimaryInstruction) => instruction.component.specificity); } diff --git a/modules/angular2/src/router/router.ts b/modules/angular2/src/router/router.ts index b5157e50c16fb5..26b967a09e203b 100644 --- a/modules/angular2/src/router/router.ts +++ b/modules/angular2/src/router/router.ts @@ -8,7 +8,6 @@ import { Map, StringMapWrapper, MapWrapper, - List, ListWrapper } from 'angular2/src/core/facade/collection'; import { @@ -99,7 +98,7 @@ export class Router { * ]); * ``` */ - config(definitions: List): Promise { + config(definitions: Array): Promise { definitions.forEach( (routeDefinition) => { this.registry.config(this.hostComponent, routeDefinition); }); return this.renavigate(); @@ -168,7 +167,7 @@ export class Router { // we begin navigation. The method below simply traverses instructions and resolves any components // for which `componentType` is not present _settleInstruction(instruction: Instruction): Promise { - var unsettledInstructions: List> = []; + var unsettledInstructions: Array> = []; if (isBlank(instruction.component.componentType)) { unsettledInstructions.push(instruction.component.resolveComponentType()); } @@ -293,7 +292,7 @@ export class Router { * Generate a URL from a component name and optional map of parameters. The URL is relative to the * app's base href. */ - generate(linkParams: List): Instruction { + generate(linkParams: Array): Instruction { let normalizedLinkParams = splitAndFlattenLinkParams(linkParams); var first = ListWrapper.first(normalizedLinkParams); @@ -400,10 +399,10 @@ class ChildRouter extends Router { * Returns: ['', 'a', 'b', {c: 2}] */ var SLASH = new RegExp('/'); -function splitAndFlattenLinkParams(linkParams: List): List { +function splitAndFlattenLinkParams(linkParams: Array): Array { return ListWrapper.reduce(linkParams, (accumulation, item) => { if (isString(item)) { - return ListWrapper.concat(accumulation, StringWrapper.split(item, SLASH)); + return accumulation.concat(StringWrapper.split(item, SLASH)); } accumulation.push(item); return accumulation; diff --git a/modules/angular2/src/router/router_link.ts b/modules/angular2/src/router/router_link.ts index b3cae364c10116..6d2b06ff594187 100644 --- a/modules/angular2/src/router/router_link.ts +++ b/modules/angular2/src/router/router_link.ts @@ -1,5 +1,5 @@ import {Directive} from '../core/metadata'; -import {List, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {Router} from './router'; import {Location} from './location'; @@ -40,7 +40,7 @@ import {Instruction, stringifyInstruction} from './instruction'; host: {'(^click)': 'onClick()', '[attr.href]': 'visibleHref'} }) export class RouterLink { - private _routeParams: List; + private _routeParams: Array; // the url displayed on the anchor element. visibleHref: string; @@ -50,7 +50,7 @@ export class RouterLink { constructor(private _router: Router, private _location: Location) {} - set routeParams(changes: List) { + set routeParams(changes: Array) { this._routeParams = changes; this._navigationInstruction = this._router.generate(this._routeParams); diff --git a/modules/angular2/src/router/url_parser.ts b/modules/angular2/src/router/url_parser.ts index f8a39e7fa74f65..11ab035a286df0 100644 --- a/modules/angular2/src/router/url_parser.ts +++ b/modules/angular2/src/router/url_parser.ts @@ -1,4 +1,4 @@ -import {List, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { isPresent, isBlank, @@ -10,7 +10,7 @@ import { export class Url { constructor(public path: string, public child: Url = null, - public auxiliary: List = CONST_EXPR([]), + public auxiliary: Array = CONST_EXPR([]), public params: StringMap = null) {} toString(): string { @@ -37,7 +37,7 @@ export class Url { } export class RootUrl extends Url { - constructor(path: string, child: Url = null, auxiliary: List = CONST_EXPR([]), + constructor(path: string, child: Url = null, auxiliary: Array = CONST_EXPR([]), params: StringMap = null) { super(path, child, auxiliary, params); } @@ -57,7 +57,7 @@ export class RootUrl extends Url { } } -export function pathSegmentsToUrl(pathSegments: List): Url { +export function pathSegmentsToUrl(pathSegments: Array): Url { var url = new Url(pathSegments[pathSegments.length - 1]); for (var i = pathSegments.length - 2; i >= 0; i -= 1) { url = new Url(pathSegments[i], url); @@ -185,7 +185,7 @@ export class UrlParser { params[key] = value; } - parseAuxiliaryRoutes(): List { + parseAuxiliaryRoutes(): Array { var routes = []; this.capture('('); @@ -203,7 +203,7 @@ export class UrlParser { export var parser = new UrlParser(); -export function serializeParams(paramMap: StringMap): List { +export function serializeParams(paramMap: StringMap): Array { var params = []; if (isPresent(paramMap)) { StringMapWrapper.forEach(paramMap, (value, key) => { diff --git a/modules/angular2/src/test_lib/fake_async.ts b/modules/angular2/src/test_lib/fake_async.ts index c19b6e3d386b69..4b598d34bd75d6 100644 --- a/modules/angular2/src/test_lib/fake_async.ts +++ b/modules/angular2/src/test_lib/fake_async.ts @@ -5,9 +5,9 @@ import {ListWrapper} from 'angular2/src/core/facade/collection'; import {NgZoneZone} from 'angular2/src/core/zone/ng_zone'; var _scheduler; -var _microtasks: List = []; -var _pendingPeriodicTimers: List = []; -var _pendingTimers: List = []; +var _microtasks: Array = []; +var _pendingPeriodicTimers: Array = []; +var _pendingTimers: Array = []; var _error = null; interface FakeAsyncZone extends NgZoneZone { diff --git a/modules/angular2/src/test_lib/test_component_builder.ts b/modules/angular2/src/test_lib/test_component_builder.ts index 95c4ad2c1124c9..8379201d0d0f9b 100644 --- a/modules/angular2/src/test_lib/test_component_builder.ts +++ b/modules/angular2/src/test_lib/test_component_builder.ts @@ -2,7 +2,7 @@ import {Injector, bind, Injectable} from 'angular2/di'; import {Type, isPresent, BaseException, isBlank} from 'angular2/src/core/facade/lang'; import {Promise} from 'angular2/src/core/facade/async'; -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {ViewMetadata} from '../core/metadata'; diff --git a/modules/angular2/src/test_lib/test_injector.ts b/modules/angular2/src/test_lib/test_injector.ts index f1016062b4f329..0514e72052aa89 100644 --- a/modules/angular2/src/test_lib/test_injector.ts +++ b/modules/angular2/src/test_lib/test_injector.ts @@ -42,7 +42,7 @@ import {TestComponentBuilder} from './test_component_builder'; import {Injector} from 'angular2/di'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {FunctionWrapper, Type} from 'angular2/src/core/facade/lang'; import {AppViewPool, APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool'; @@ -156,7 +156,7 @@ function _getAppBindings() { ]; } -export function createTestInjector(bindings: List>): Injector { +export function createTestInjector(bindings: Array>): Injector { var rootInjector = Injector.resolveAndCreate(_getRootBindings()); return rootInjector.resolveAndCreateChild(ListWrapper.concat(_getAppBindings(), bindings)); } @@ -190,15 +190,15 @@ export function createTestInjector(bindings: List>): * @param {Function} fn * @return {FunctionWithParamTokens} */ -export function inject(tokens: List, fn: Function): FunctionWithParamTokens { +export function inject(tokens: Array, fn: Function): FunctionWithParamTokens { return new FunctionWithParamTokens(tokens, fn); } export class FunctionWithParamTokens { - _tokens: List; + _tokens: Array; _fn: Function; - constructor(tokens: List, fn: Function) { + constructor(tokens: Array, fn: Function) { this._tokens = tokens; this._fn = fn; } diff --git a/modules/angular2/src/test_lib/test_lib.ts b/modules/angular2/src/test_lib/test_lib.ts index 7119b08e584475..253d3796c7fd27 100644 --- a/modules/angular2/src/test_lib/test_lib.ts +++ b/modules/angular2/src/test_lib/test_lib.ts @@ -55,7 +55,7 @@ var inIt = false; var testBindings; class BeforeEachRunner { - _fns: List; + _fns: Array; _parent: BeforeEachRunner; constructor(parent: BeforeEachRunner) { this._fns = []; diff --git a/modules/angular2/src/test_lib/utils.ts b/modules/angular2/src/test_lib/utils.ts index 7a10fca7fdcb74..d6e42fdabe0c44 100644 --- a/modules/angular2/src/test_lib/utils.ts +++ b/modules/angular2/src/test_lib/utils.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import { isPresent, @@ -9,7 +9,7 @@ import { } from 'angular2/src/core/facade/lang'; export class Log { - _result: List; + _result: Array; constructor() { this._result = []; } diff --git a/modules/angular2/src/web_workers/shared/client_message_broker.ts b/modules/angular2/src/web_workers/shared/client_message_broker.ts index ede2897b4d333d..55b4052d52ac8e 100644 --- a/modules/angular2/src/web_workers/shared/client_message_broker.ts +++ b/modules/angular2/src/web_workers/shared/client_message_broker.ts @@ -132,5 +132,5 @@ export class FnArg { } export class UiArguments { - constructor(public method: string, public args?: List) {} + constructor(public method: string, public args?: Array) {} } diff --git a/modules/angular2/src/web_workers/shared/render_view_with_fragments_store.ts b/modules/angular2/src/web_workers/shared/render_view_with_fragments_store.ts index 7435c4b51f5be2..d0763fce895418 100644 --- a/modules/angular2/src/web_workers/shared/render_view_with_fragments_store.ts +++ b/modules/angular2/src/web_workers/shared/render_view_with_fragments_store.ts @@ -5,7 +5,7 @@ import { RenderViewWithFragments } from "angular2/src/core/render/api"; import {ON_WEB_WORKER} from "angular2/src/web_workers/shared/api"; -import {List, ListWrapper} from "angular2/src/core/facade/collection"; +import {ListWrapper} from "angular2/src/core/facade/collection"; @Injectable() export class RenderViewWithFragmentsStore { diff --git a/modules/angular2/src/web_workers/shared/serializer.ts b/modules/angular2/src/web_workers/shared/serializer.ts index 0dfc5ec66e985f..81cf09267ebad9 100644 --- a/modules/angular2/src/web_workers/shared/serializer.ts +++ b/modules/angular2/src/web_workers/shared/serializer.ts @@ -7,7 +7,6 @@ import { BaseException } from "angular2/src/core/facade/lang"; import { - List, ListWrapper, Map, StringMap, @@ -119,7 +118,7 @@ export class Serializer { return null; } if (isArray(map)) { - var obj: List = new List(); + var obj: Array = []; ListWrapper.forEach(map, (val) => { obj.push(this.deserialize(val, type, data)); }); return obj; } diff --git a/modules/angular2/src/web_workers/shared/service_message_broker.ts b/modules/angular2/src/web_workers/shared/service_message_broker.ts index a9472d8b129bdc..535faf8a6ff2c3 100644 --- a/modules/angular2/src/web_workers/shared/service_message_broker.ts +++ b/modules/angular2/src/web_workers/shared/service_message_broker.ts @@ -35,11 +35,11 @@ export class ServiceMessageBroker { ObservableWrapper.subscribe(source, (message) => this._handleMessage(message)); } - registerMethod(methodName: string, signature: List, method: Function, returnType?: Type): + registerMethod(methodName: string, signature: Array, method: Function, returnType?: Type): void { this._methods.set(methodName, (message: ReceivedMessage) => { var serializedArgs = message.args; - var deserializedArgs: List = ListWrapper.createFixedSize(signature.length); + var deserializedArgs: Array = ListWrapper.createFixedSize(signature.length); for (var i = 0; i < signature.length; i++) { var serializedArg = serializedArgs[i]; deserializedArgs[i] = this._serializer.deserialize(serializedArg, signature[i]); @@ -70,7 +70,7 @@ export class ServiceMessageBroker { export class ReceivedMessage { method: string; - args: List; + args: Array; id: string; type: string; diff --git a/modules/angular2/src/web_workers/ui/di_bindings.ts b/modules/angular2/src/web_workers/ui/di_bindings.ts index 4e15252c8eb0ae..33a508351eb9b9 100644 --- a/modules/angular2/src/web_workers/ui/di_bindings.ts +++ b/modules/angular2/src/web_workers/ui/di_bindings.ts @@ -2,7 +2,7 @@ // There should be a way to refactor application so that this file is unnecessary. See #3277 import {Injector, bind, Binding} from "angular2/di"; import {Reflector, reflector} from 'angular2/src/core/reflection/reflection'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import { Parser, Lexer, @@ -76,7 +76,7 @@ var _rootBindings = [bind(Reflector).toValue(reflector)]; // TODO: This code is nearly identitcal to core/application. There should be a way to only write it // once -function _injectorBindings(): List { +function _injectorBindings(): Array { var bestChangeDetection = new DynamicChangeDetection(); if (PreGeneratedChangeDetection.isSupported()) { bestChangeDetection = new PreGeneratedChangeDetection(); diff --git a/modules/angular2/src/web_workers/ui/event_serializer.ts b/modules/angular2/src/web_workers/ui/event_serializer.ts index 7d22567a94b866..3c637df3cef896 100644 --- a/modules/angular2/src/web_workers/ui/event_serializer.ts +++ b/modules/angular2/src/web_workers/ui/event_serializer.ts @@ -69,7 +69,7 @@ function addTarget(e: Event, serializedEvent: StringMap): StringMap return serializedEvent; } -function serializeEvent(e: any, properties: List): StringMap { +function serializeEvent(e: any, properties: Array): StringMap { var serialized = {}; for (var i = 0; i < properties.length; i++) { var prop = properties[i]; diff --git a/modules/angular2/src/web_workers/worker/application.ts b/modules/angular2/src/web_workers/worker/application.ts index c7ce0203435e8a..9890e636dbe4d1 100644 --- a/modules/angular2/src/web_workers/worker/application.ts +++ b/modules/angular2/src/web_workers/worker/application.ts @@ -27,7 +27,7 @@ var _postMessage: PostMessageInterface = postMessage; * See the bootstrap() docs for more details. */ export function bootstrapWebWorker( - appComponentType: Type, componentInjectableBindings: List> = null): + appComponentType: Type, componentInjectableBindings: Array> = null): Promise { var sink = new PostMessageBusSink({ postMessage: diff --git a/modules/angular2/src/web_workers/worker/application_common.ts b/modules/angular2/src/web_workers/worker/application_common.ts index eab810d0276cc3..01a8a1c475cb7b 100644 --- a/modules/angular2/src/web_workers/worker/application_common.ts +++ b/modules/angular2/src/web_workers/worker/application_common.ts @@ -29,7 +29,7 @@ import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; import {StyleUrlResolver} from 'angular2/src/core/render/dom/compiler/style_url_resolver'; import {PipeResolver} from 'angular2/src/core/compiler/pipe_resolver'; import {ViewResolver} from 'angular2/src/core/compiler/view_resolver'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper, PromiseCompleter} from 'angular2/src/core/facade/async'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle'; @@ -77,7 +77,7 @@ class PrintLogger { } function _injectorBindings(appComponentType, bus: MessageBus, initData: StringMap): - List> { + Array> { var bestChangeDetection = new DynamicChangeDetection(); if (PreGeneratedChangeDetection.isSupported()) { bestChangeDetection = new PreGeneratedChangeDetection(); @@ -141,7 +141,8 @@ function _injectorBindings(appComponentType, bus: MessageBus, initData: StringMa export function bootstrapWebWorkerCommon( appComponentType: Type, bus: MessageBus, - componentInjectableBindings: List> = null): Promise { + componentInjectableBindings: Array> = null): + Promise { var bootstrapProcess: PromiseCompleter = PromiseWrapper.completer(); var zone = new NgZone({enableLongStackTrace: assertionsEnabled()}); @@ -184,7 +185,7 @@ export function bootstrapWebWorkerCommon( return bootstrapProcess.promise; } -function _createAppInjector(appComponentType: Type, bindings: List>, +function _createAppInjector(appComponentType: Type, bindings: Array>, zone: NgZone, bus: MessageBus, initData: StringMap): Injector { if (isBlank(_rootInjector)) _rootInjector = Injector.resolveAndCreate(_rootBindings); diff --git a/modules/angular2/src/web_workers/worker/renderer.ts b/modules/angular2/src/web_workers/worker/renderer.ts index 59416f7606c7c9..4af45c9889a96a 100644 --- a/modules/angular2/src/web_workers/worker/renderer.ts +++ b/modules/angular2/src/web_workers/worker/renderer.ts @@ -42,7 +42,7 @@ export class WebWorkerCompiler implements RenderCompiler { * Creats a ProtoViewDto that contains a single nested component with the given componentId. */ compileHost(directiveMetadata: RenderDirectiveMetadata): Promise { - var fnArgs: List = [new FnArg(directiveMetadata, RenderDirectiveMetadata)]; + var fnArgs: Array = [new FnArg(directiveMetadata, RenderDirectiveMetadata)]; var args: UiArguments = new UiArguments("compileHost", fnArgs); return this._messageBroker.runOnUiThread(args, ProtoViewDto); } @@ -53,7 +53,7 @@ export class WebWorkerCompiler implements RenderCompiler { * but only the needed ones based on previous calls. */ compile(view: ViewDefinition): Promise { - var fnArgs: List = [new FnArg(view, ViewDefinition)]; + var fnArgs: Array = [new FnArg(view, ViewDefinition)]; var args: UiArguments = new UiArguments("compile", fnArgs); return this._messageBroker.runOnUiThread(args, ProtoViewDto); } @@ -64,12 +64,12 @@ export class WebWorkerCompiler implements RenderCompiler { * should be merged. * If the array contains other arrays, they will be merged before processing the parent array. * The array must contain an entry for every component and embedded ProtoView of the first entry. - * @param protoViewRefs List of ProtoViewRefs or nested + * @param protoViewRefs Array of ProtoViewRefs or nested * @return the merge result for every input array in depth first order. */ mergeProtoViewsRecursively( - protoViewRefs: List>): Promise { - var fnArgs: List = [new FnArg(protoViewRefs, RenderProtoViewRef)]; + protoViewRefs: Array>): Promise { + var fnArgs: Array = [new FnArg(protoViewRefs, RenderProtoViewRef)]; var args: UiArguments = new UiArguments("mergeProtoViewsRecursively", fnArgs); return this._messageBroker.runOnUiThread(args, RenderProtoViewMergeMapping); } @@ -114,7 +114,7 @@ export class WebWorkerRenderer implements Renderer { var renderViewWithFragments = this._renderViewStore.allocate(fragmentCount); var startIndex = ((renderViewWithFragments.viewRef)).refNumber; - var fnArgs: List = [ + var fnArgs: Array = [ new FnArg(protoViewRef, RenderProtoViewRef), new FnArg(fragmentCount, null), ]; @@ -254,7 +254,7 @@ export class WebWorkerRenderer implements Renderer { * Calls a method on an element. * Note: For now we're assuming that everything in the args list are primitive */ - invokeElementMethod(location: RenderElementRef, methodName: string, args: List) { + invokeElementMethod(location: RenderElementRef, methodName: string, args: Array) { var fnArgs = [ new FnArg(location, WebWorkerElementRef), new FnArg(methodName, null), diff --git a/modules/angular2/src/web_workers/worker/xhr_impl.ts b/modules/angular2/src/web_workers/worker/xhr_impl.ts index 4dcc4569a40430..f5dacaea0c7c7f 100644 --- a/modules/angular2/src/web_workers/worker/xhr_impl.ts +++ b/modules/angular2/src/web_workers/worker/xhr_impl.ts @@ -23,7 +23,7 @@ export class WebWorkerXHRImpl extends XHR { } get(url: string): Promise { - var fnArgs: List = [new FnArg(url, null)]; + var fnArgs: Array = [new FnArg(url, null)]; var args: UiArguments = new UiArguments("get", fnArgs); return this._messageBroker.runOnUiThread(args, String); } diff --git a/modules/angular2/test/core/change_detection/change_detector_config.ts b/modules/angular2/test/core/change_detection/change_detector_config.ts index f6f5f41089a765..a052e1c79ca671 100644 --- a/modules/angular2/test/core/change_detection/change_detector_config.ts +++ b/modules/angular2/test/core/change_detection/change_detector_config.ts @@ -26,12 +26,12 @@ function _getParser() { return _parser; } -function _createBindingRecords(expression: string): List { +function _createBindingRecords(expression: string): Array { var ast = _getParser().parseBinding(expression, 'location'); return [BindingRecord.createForElementProperty(ast, 0, PROP_NAME)]; } -function _createEventRecords(expression: string): List { +function _createEventRecords(expression: string): Array { var eq = expression.indexOf("="); var eventName = expression.substring(1, eq - 1); var exp = expression.substring(eq + 2, expression.length - 1); @@ -40,7 +40,7 @@ function _createEventRecords(expression: string): List { } function _createHostEventRecords(expression: string, directiveRecord: DirectiveRecord): - List { + Array { var parts = expression.split("="); var eventName = parts[0].substring(1, parts[0].length - 1); var exp = parts[1].substring(1, parts[1].length - 1); @@ -49,7 +49,7 @@ function _createHostEventRecords(expression: string, directiveRecord: DirectiveR return [BindingRecord.createForHostEvent(ast, eventName, directiveRecord)]; } -function _convertLocalsToVariableBindings(locals: Locals): List { +function _convertLocalsToVariableBindings(locals: Locals): Array { var variableBindings = []; var loc = locals; while (isPresent(loc) && isPresent(loc.current)) { @@ -142,17 +142,15 @@ export class TestDefinition { * Get all available ChangeDetectorDefinition objects. Used to pre-generate Dart * `ChangeDetector` classes. */ -export function getAllDefinitions(): List { +export function getAllDefinitions(): Array { var allDefs = _availableDefinitions; allDefs = ListWrapper.concat(allDefs, StringMapWrapper.keys(_ExpressionWithLocals.availableDefinitions)); - allDefs = - ListWrapper.concat(allDefs, StringMapWrapper.keys(_ExpressionWithMode.availableDefinitions)); - allDefs = - ListWrapper.concat(allDefs, StringMapWrapper.keys(_DirectiveUpdating.availableDefinitions)); - allDefs = ListWrapper.concat(allDefs, _availableEventDefinitions); - allDefs = ListWrapper.concat(allDefs, _availableHostEventDefinitions); - allDefs = ListWrapper.concat(allDefs, [ + allDefs = allDefs.concat(StringMapWrapper.keys(_ExpressionWithMode.availableDefinitions)); + allDefs = allDefs.concat(StringMapWrapper.keys(_DirectiveUpdating.availableDefinitions)); + allDefs = allDefs.concat(_availableEventDefinitions); + allDefs = allDefs.concat(_availableHostEventDefinitions); + allDefs = allDefs.concat([ "onPushObserveBinding", "onPushObserveComponent", "onPushObserveDirective", @@ -256,8 +254,8 @@ class _ExpressionWithMode { } class _DirectiveUpdating { - constructor(private _bindingRecords: List, - private _directiveRecords: List) {} + constructor(private _bindingRecords: Array, + private _directiveRecords: Array) {} createChangeDetectorDefinition(): ChangeDetectorDefinition { var strategy = null; @@ -279,7 +277,7 @@ class _DirectiveUpdating { (o, v) => (o).b = v, dirRecord); } - static basicRecords: List = [ + static basicRecords: Array = [ new DirectiveRecord({ directiveIndex: new DirectiveIndex(0, 0), callOnChanges: true, diff --git a/modules/angular2/test/core/change_detection/change_detector_spec.ts b/modules/angular2/test/core/change_detection/change_detector_spec.ts index 18161794f1861d..d5888b60d1069d 100644 --- a/modules/angular2/test/core/change_detection/change_detector_spec.ts +++ b/modules/angular2/test/core/change_detection/change_detector_spec.ts @@ -20,7 +20,7 @@ import { BaseException, FunctionWrapper } from 'angular2/src/core/facade/lang'; -import {List, ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import { ChangeDispatcher, @@ -1170,8 +1170,8 @@ class TestData { } class FakeDirectives { - constructor(public directives: List, - public detectors: List) {} + constructor(public directives: Array, + public detectors: Array) {} getDirectiveFor(di: DirectiveIndex) { return this.directives[di.directiveIndex]; } @@ -1181,7 +1181,7 @@ class FakeDirectives { class TestDispatcher implements ChangeDispatcher { log: string[]; debugLog: string[]; - loggedValues: List; + loggedValues: Array; afterContentCheckedCalled: boolean = false; constructor() { this.clear(); } diff --git a/modules/angular2/test/core/change_detection/differs/default_iterable_differ_spec.ts b/modules/angular2/test/core/change_detection/differs/default_iterable_differ_spec.ts index 1db5b8da30a254..0fc68e94e719e5 100644 --- a/modules/angular2/test/core/change_detection/differs/default_iterable_differ_spec.ts +++ b/modules/angular2/test/core/change_detection/differs/default_iterable_differ_spec.ts @@ -190,7 +190,7 @@ export function main() { var b = 'b'; var oo = 'oo'; - ListWrapper.set(l, 1, b + oo); + l[1] = b + oo; differ.check(l); expect(differ.toString()) .toEqual(iterableChangesAsString({collection: ['a', 'boo'], previous: ['a', 'boo']})); diff --git a/modules/angular2/test/core/change_detection/iterable.ts b/modules/angular2/test/core/change_detection/iterable.ts index 4d5eadf2cef338..95a96784fa11e5 100644 --- a/modules/angular2/test/core/change_detection/iterable.ts +++ b/modules/angular2/test/core/change_detection/iterable.ts @@ -1,7 +1,6 @@ -import {List} from 'angular2/src/core/facade/collection'; export class TestIterable { - list: List; + list: Array; constructor() { this.list = []; } [Symbol.iterator]() { return this.list[Symbol.iterator](); } diff --git a/modules/angular2/test/core/change_detection/parser/lexer_spec.ts b/modules/angular2/test/core/change_detection/parser/lexer_spec.ts index 490d1671f94d12..43112c3364f4c7 100644 --- a/modules/angular2/test/core/change_detection/parser/lexer_spec.ts +++ b/modules/angular2/test/core/change_detection/parser/lexer_spec.ts @@ -2,10 +2,10 @@ import {ddescribe, describe, it, expect} from 'angular2/test_lib'; import {Lexer, Token} from 'angular2/src/core/change_detection/parser/lexer'; -import {List, ListWrapper} from "angular2/src/core/facade/collection"; +import {ListWrapper} from "angular2/src/core/facade/collection"; import {StringWrapper} from "angular2/src/core/facade/lang"; -function lex(text: string): List { +function lex(text: string): Array { return new Lexer().tokenize(text); } @@ -53,13 +53,13 @@ export function main() { describe('lexer', function() { describe('token', function() { it('should tokenize a simple identifier', function() { - var tokens: List = lex("j"); + var tokens: Array = lex("j"); expect(tokens.length).toEqual(1); expectIdentifierToken(tokens[0], 0, 'j'); }); it('should tokenize a dotted identifier', function() { - var tokens: List = lex("j.k"); + var tokens: Array = lex("j.k"); expect(tokens.length).toEqual(3); expectIdentifierToken(tokens[0], 0, 'j'); expectCharacterToken(tokens[1], 1, '.'); @@ -67,20 +67,20 @@ export function main() { }); it('should tokenize an operator', function() { - var tokens: List = lex("j-k"); + var tokens: Array = lex("j-k"); expect(tokens.length).toEqual(3); expectOperatorToken(tokens[1], 1, '-'); }); it('should tokenize an indexed operator', function() { - var tokens: List = lex("j[k]"); + var tokens: Array = lex("j[k]"); expect(tokens.length).toEqual(4); expectCharacterToken(tokens[1], 1, "["); expectCharacterToken(tokens[3], 3, "]"); }); it('should tokenize numbers', function() { - var tokens: List = lex("88"); + var tokens: Array = lex("88"); expect(tokens.length).toEqual(1); expectNumberToken(tokens[0], 0, 88); }); @@ -95,7 +95,7 @@ export function main() { function() { expectStringToken(lex('"a\\""')[0], 0, 'a"'); }); it('should tokenize a string', function() { - var tokens: List = lex("j-a.bc[22]+1.3|f:'a\\\'c':\"d\\\"e\""); + var tokens: Array = lex("j-a.bc[22]+1.3|f:'a\\\'c':\"d\\\"e\""); expectIdentifierToken(tokens[0], 0, 'j'); expectOperatorToken(tokens[1], 1, '-'); expectIdentifierToken(tokens[2], 2, 'a'); @@ -115,39 +115,39 @@ export function main() { }); it('should tokenize undefined', function() { - var tokens: List = lex("undefined"); + var tokens: Array = lex("undefined"); expectKeywordToken(tokens[0], 0, "undefined"); expect(tokens[0].isKeywordUndefined()).toBe(true); }); it('should ignore whitespace', function() { - var tokens: List = lex("a \t \n \r b"); + var tokens: Array = lex("a \t \n \r b"); expectIdentifierToken(tokens[0], 0, 'a'); expectIdentifierToken(tokens[1], 8, 'b'); }); it('should tokenize quoted string', () => { var str = "['\\'', \"\\\"\"]"; - var tokens: List = lex(str); + var tokens: Array = lex(str); expectStringToken(tokens[1], 1, "'"); expectStringToken(tokens[3], 7, '"'); }); it('should tokenize escaped quoted string', () => { var str = '"\\"\\n\\f\\r\\t\\v\\u00A0"'; - var tokens: List = lex(str); + var tokens: Array = lex(str); expect(tokens.length).toEqual(1); expect(tokens[0].toString()).toEqual('"\n\f\r\t\v\u00A0'); }); it('should tokenize unicode', function() { - var tokens: List = lex('"\\u00A0"'); + var tokens: Array = lex('"\\u00A0"'); expect(tokens.length).toEqual(1); expect(tokens[0].toString()).toEqual('\u00a0'); }); it('should tokenize relation', function() { - var tokens: List = lex("! == != < > <= >= === !=="); + var tokens: Array = lex("! == != < > <= >= === !=="); expectOperatorToken(tokens[0], 0, '!'); expectOperatorToken(tokens[1], 2, '=='); expectOperatorToken(tokens[2], 5, '!='); @@ -160,7 +160,7 @@ export function main() { }); it('should tokenize statements', function() { - var tokens: List = lex("a;b;"); + var tokens: Array = lex("a;b;"); expectIdentifierToken(tokens[0], 0, 'a'); expectCharacterToken(tokens[1], 1, ';'); expectIdentifierToken(tokens[2], 2, 'b'); @@ -168,19 +168,19 @@ export function main() { }); it('should tokenize function invocation', function() { - var tokens: List = lex("a()"); + var tokens: Array = lex("a()"); expectIdentifierToken(tokens[0], 0, 'a'); expectCharacterToken(tokens[1], 1, '('); expectCharacterToken(tokens[2], 2, ')'); }); it('should tokenize simple method invocations', function() { - var tokens: List = lex("a.method()"); + var tokens: Array = lex("a.method()"); expectIdentifierToken(tokens[2], 2, 'method'); }); it('should tokenize method invocation', function() { - var tokens: List = lex("a.b.c (d) - e.f()"); + var tokens: Array = lex("a.b.c (d) - e.f()"); expectIdentifierToken(tokens[0], 0, 'a'); expectCharacterToken(tokens[1], 1, '.'); expectIdentifierToken(tokens[2], 2, 'b'); @@ -198,18 +198,18 @@ export function main() { }); it('should tokenize number', function() { - var tokens: List = lex("0.5"); + var tokens: Array = lex("0.5"); expectNumberToken(tokens[0], 0, 0.5); }); // NOTE(deboer): NOT A LEXER TEST // it('should tokenize negative number', () => { - // var tokens:List = lex("-0.5"); + // var tokens:Array = lex("-0.5"); // expectNumberToken(tokens[0], 0, -0.5); // }); it('should tokenize number with exponent', function() { - var tokens: List = lex("0.5E-10"); + var tokens: Array = lex("0.5E-10"); expect(tokens.length).toEqual(1); expectNumberToken(tokens[0], 0, 0.5E-10); tokens = lex("0.5E+10"); @@ -225,7 +225,7 @@ export function main() { }); it('should tokenize number starting with a dot', function() { - var tokens: List = lex(".5"); + var tokens: Array = lex(".5"); expectNumberToken(tokens[0], 0, 0.5); }); @@ -236,12 +236,12 @@ export function main() { }); it('should tokenize hash as operator', function() { - var tokens: List = lex("#"); + var tokens: Array = lex("#"); expectOperatorToken(tokens[0], 0, '#'); }); it('should tokenize ?. as operator', () => { - var tokens: List = lex('?.'); + var tokens: Array = lex('?.'); expectOperatorToken(tokens[0], 0, '?.'); }); diff --git a/modules/angular2/test/core/change_detection/util.ts b/modules/angular2/test/core/change_detection/util.ts index 2a0668ef75fe47..c69fe4ab8eea22 100644 --- a/modules/angular2/test/core/change_detection/util.ts +++ b/modules/angular2/test/core/change_detection/util.ts @@ -9,11 +9,11 @@ export function iterableChangesAsString({collection = CONST_EXPR([]), previous = } export function kvChangesAsString({map, previous, additions, changes, removals}: { - map?: List, - previous?: List, - additions?: List, - changes?: List, - removals?: List + map?: Array, + previous?: Array, + additions?: Array, + changes?: Array, + removals?: Array }): string { if (isBlank(map)) map = []; if (isBlank(previous)) previous = []; diff --git a/modules/angular2/test/core/compiler/compiler_spec.ts b/modules/angular2/test/core/compiler/compiler_spec.ts index c676bffcb1c592..fabfefc68b3d15 100644 --- a/modules/angular2/test/core/compiler/compiler_spec.ts +++ b/modules/angular2/test/core/compiler/compiler_spec.ts @@ -12,7 +12,6 @@ import { } from 'angular2/test_lib'; import {SpyRenderCompiler, SpyDirectiveResolver} from '../spies'; import { - List, ListWrapper, Map, MapWrapper, @@ -59,8 +58,8 @@ export function main() { cmpUrlMapper, rootProtoView; var renderCompileRequests: any[]; - function createCompiler(renderCompileResults: List>, - protoViewFactoryResults: List) { + function createCompiler(renderCompileResults: Array>, + protoViewFactoryResults: Array) { var urlResolver = new UrlResolver(); renderCompileRequests = []; renderCompileResults = ListWrapper.clone(renderCompileResults); @@ -87,7 +86,7 @@ export function main() { createRenderProtoView([createRenderComponentElementBinder(0)], ViewType.HOST)); }); renderCompiler.spy('mergeProtoViewsRecursively') - .andCallFake((protoViewRefs: List>) => { + .andCallFake((protoViewRefs: Array>) => { return PromiseWrapper.resolve(new RenderProtoViewMergeMapping( new MergedRenderProtoViewRef(protoViewRefs), 1, [], 0, [], [], [null])); }); @@ -722,15 +721,15 @@ class FakeViewResolver extends ViewResolver { } class FakeProtoViewFactory extends ProtoViewFactory { - requests: List>; + requests: Array>; - constructor(public results: List) { + constructor(public results: Array) { super(null); this.requests = []; } createAppProtoViews(componentBinding: DirectiveBinding, renderProtoView: ProtoViewDto, - directives: List, pipes: PipeBinding[]): AppProtoView[] { + directives: Array, pipes: PipeBinding[]): AppProtoView[] { this.requests.push([componentBinding, renderProtoView, directives, pipes]); return collectEmbeddedPvs(ListWrapper.removeAt(this.results, 0)); } diff --git a/modules/angular2/test/core/compiler/element_injector_spec.ts b/modules/angular2/test/core/compiler/element_injector_spec.ts index e2eb68c2f89318..20110a5009c4ba 100644 --- a/modules/angular2/test/core/compiler/element_injector_spec.ts +++ b/modules/angular2/test/core/compiler/element_injector_spec.ts @@ -20,7 +20,6 @@ import {isBlank, isPresent, stringify} from 'angular2/src/core/facade/lang'; import { ListWrapper, MapWrapper, - List, StringMapWrapper, iterateListLike } from 'angular2/src/core/facade/collection'; @@ -242,7 +241,7 @@ export function main() { return ProtoElementInjector.create(parent, index, directiveBinding, hasShadowRoot, distance, dirVariableBindings); } - function humanize(tree: TreeNode, names: List>) { + function humanize(tree: TreeNode, names: Array>) { var lookupName = (item) => ListWrapper.last(ListWrapper.find(names, (pair) => pair[0] === item)); @@ -277,8 +276,8 @@ export function main() { return child; } - function hostShadowInjectors(hostBindings: List, - shadowBindings: List, imperativelyCreatedInjector = null): ElementInjector { + function hostShadowInjectors(hostBindings: Array, + shadowBindings: Array, imperativelyCreatedInjector = null): ElementInjector { var protoHost = createPei(null, 0, hostBindings, 0, true); var host = protoHost.instantiate(null); host.hydrate(null, null, defaultPreBuiltObjects); @@ -1078,7 +1077,7 @@ export function main() { "one": null // element }); - var inj = injector(ListWrapper.concat(dirs, extraBindings), null, + var inj = injector(dirs.concat(extraBindings), null, false, preBuildObjects, null, dirVariableBindings); expect(inj.get(NeedsQueryByVarBindings).query.first).toBe(defaultPreBuiltObjects.elementRef); @@ -1093,7 +1092,7 @@ export function main() { "two": 1 // 1 is the index of NeedsDirective }); - var inj = injector(ListWrapper.concat(dirs, extraBindings), null, + var inj = injector(dirs.concat(extraBindings), null, false, preBuildObjects, null, dirVariableBindings); // NeedsQueryByVarBindings queries "one,two", so SimpleDirective should be before NeedsDirective diff --git a/modules/angular2/test/core/compiler/query_list_spec.ts b/modules/angular2/test/core/compiler/query_list_spec.ts index 5dfa2f198fbe5d..c3738dada6e8b2 100644 --- a/modules/angular2/test/core/compiler/query_list_spec.ts +++ b/modules/angular2/test/core/compiler/query_list_spec.ts @@ -1,6 +1,6 @@ import {describe, it, expect, beforeEach, ddescribe, iit, xit, el} from 'angular2/test_lib'; -import {List, MapWrapper, ListWrapper, iterateListLike} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper, iterateListLike} from 'angular2/src/core/facade/collection'; import {StringWrapper} from 'angular2/src/core/facade/lang'; import {QueryList} from 'angular2/src/core/compiler/query_list'; diff --git a/modules/angular2/test/core/debug/debug_element_spec.ts b/modules/angular2/test/core/debug/debug_element_spec.ts index c9daef8182a752..7cc3ddc99da39d 100644 --- a/modules/angular2/test/core/debug/debug_element_spec.ts +++ b/modules/angular2/test/core/debug/debug_element_spec.ts @@ -18,7 +18,7 @@ import { import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; import {Injectable} from 'angular2/di'; @@ -33,7 +33,7 @@ import {NgFor} from 'angular2/src/core/directives/ng_for'; @Injectable() class Logger { - log: List; + log: Array; constructor() { this.log = []; } @@ -119,7 +119,7 @@ class EventsComp { }) @Injectable() class UsingFor { - stuff: List; + stuff: Array; constructor() { this.stuff = ['one', 'two', 'three']; } } diff --git a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts index 013b408f57458e..e1a3a49e86fb57 100644 --- a/modules/angular2/test/core/directive_lifecycle_integration_spec.ts +++ b/modules/angular2/test/core/directive_lifecycle_integration_spec.ts @@ -60,7 +60,7 @@ export function main() { }) class LifecycleDir { field; - log: List; + log: Array; constructor() { this.log = []; } diff --git a/modules/angular2/test/core/directives/ng_class_spec.ts b/modules/angular2/test/core/directives/ng_class_spec.ts index e093e5f599dfb3..f5c5dc6d039f30 100644 --- a/modules/angular2/test/core/directives/ng_class_spec.ts +++ b/modules/angular2/test/core/directives/ng_class_spec.ts @@ -13,7 +13,7 @@ import { it, xit, } from 'angular2/test_lib'; -import {List, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {Component, View, NgFor, bind} from 'angular2/angular2'; import {NgClass} from 'angular2/src/core/directives/ng_class'; import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool'; @@ -172,7 +172,7 @@ export function main() { tcb.overrideTemplate(TestComponent, template) .createAsync(TestComponent) .then((rootTC) => { - var arrExpr: List = rootTC.componentInstance.arrExpr; + var arrExpr: Array = rootTC.componentInstance.arrExpr; detectChangesAndCheck(rootTC, 'ng-binding foo'); arrExpr.push('bar'); @@ -405,7 +405,7 @@ export function main() { class TestComponent { condition: boolean = true; items: any[]; - arrExpr: List = ['foo']; + arrExpr: Array = ['foo']; objExpr = {'foo': true, 'bar': false}; strExpr = 'foo'; } diff --git a/modules/angular2/test/core/facade/collection_spec.ts b/modules/angular2/test/core/facade/collection_spec.ts index 0ac6255e1e2eaa..4ab5b1c19e9c4b 100644 --- a/modules/angular2/test/core/facade/collection_spec.ts +++ b/modules/angular2/test/core/facade/collection_spec.ts @@ -1,7 +1,6 @@ import {describe, it, expect, beforeEach, ddescribe, iit, xit} from 'angular2/test_lib'; import { - List, ListWrapper, StringMap, StringMapWrapper, @@ -10,7 +9,7 @@ import { export function main() { describe('ListWrapper', () => { - var l: List; + var l: Array; describe('splice', () => { it('should remove sublist of given length and return it', () => { diff --git a/modules/angular2/test/core/reflection/reflector_spec.ts b/modules/angular2/test/core/reflection/reflector_spec.ts index a0df234d13ed87..7b2f47a0fe8940 100644 --- a/modules/angular2/test/core/reflection/reflector_spec.ts +++ b/modules/angular2/test/core/reflection/reflector_spec.ts @@ -2,7 +2,6 @@ import {describe, it, iit, ddescribe, expect, beforeEach} from 'angular2/test_li import {Reflector, ReflectionInfo} from 'angular2/src/core/reflection/reflection'; import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities'; import {ClassDecorator, ParamDecorator, classDecorator, paramDecorator} from './reflector_common'; -import {List} from 'angular2/src/core/facade/collection'; import {IS_DART} from '../../platform'; class AType { @@ -216,122 +215,122 @@ export function main() { class TestObjWith00Args { - args: List; + args: Array; constructor() { this.args = []; } } class TestObjWith01Args { - args: List; + args: Array; constructor(a1) { this.args = [a1]; } } class TestObjWith02Args { - args: List; + args: Array; constructor(a1, a2) { this.args = [a1, a2]; } } class TestObjWith03Args { - args: List; + args: Array; constructor(a1, a2, a3) { this.args = [a1, a2, a3]; } } class TestObjWith04Args { - args: List; + args: Array; constructor(a1, a2, a3, a4) { this.args = [a1, a2, a3, a4]; } } class TestObjWith05Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5) { this.args = [a1, a2, a3, a4, a5]; } } class TestObjWith06Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6) { this.args = [a1, a2, a3, a4, a5, a6]; } } class TestObjWith07Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7) { this.args = [a1, a2, a3, a4, a5, a6, a7]; } } class TestObjWith08Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8]; } } class TestObjWith09Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9]; } } class TestObjWith10Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]; } } class TestObjWith11Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11]; } } class TestObjWith12Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12]; } } class TestObjWith13Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13]; } } class TestObjWith14Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14]; } } class TestObjWith15Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15]; } } class TestObjWith16Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16]; } } class TestObjWith17Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17]; } } class TestObjWith18Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18) { this.args = [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18]; } } class TestObjWith19Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19) { this.args = @@ -340,7 +339,7 @@ class TestObjWith19Args { } class TestObjWith20Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) { this.args = @@ -349,7 +348,7 @@ class TestObjWith20Args { } class TestObjWith21Args { - args: List; + args: Array; constructor(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21) { this.args = [ diff --git a/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts b/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts index 123350c31fa35d..15146ef3b1156c 100644 --- a/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts +++ b/modules/angular2/test/core/render/dom/compiler/compiler_common_tests.ts @@ -12,7 +12,6 @@ import { import {DOM} from 'angular2/src/core/dom/dom_adapter'; import { - List, ListWrapper, Map, MapWrapper, @@ -296,15 +295,15 @@ function templateRoot(protoViewDto: ProtoViewDto): Element { } class MockStepFactory extends CompileStepFactory { - steps: List; - subTaskPromises: List>; + steps: Array; + subTaskPromises: Array>; viewDef: ViewDefinition; constructor(steps) { super(); this.steps = steps; } - createSteps(viewDef): List { + createSteps(viewDef): Array { this.viewDef = viewDef; return this.steps; } diff --git a/modules/angular2/test/core/render/dom/compiler/directive_parser_spec.ts b/modules/angular2/test/core/render/dom/compiler/directive_parser_spec.ts index 6c6af6b7782f3c..125c9648c102e2 100644 --- a/modules/angular2/test/core/render/dom/compiler/directive_parser_spec.ts +++ b/modules/angular2/test/core/render/dom/compiler/directive_parser_spec.ts @@ -49,7 +49,7 @@ export function main() { return new ViewDefinition({componentId: 'someComponent'}); } - function process(el, propertyBindings = null, directives = null): List { + function process(el, propertyBindings = null, directives = null): Array { var pipeline = createPipeline(propertyBindings, directives); return ListWrapper.map( pipeline.processElements(el, ViewType.COMPONENT, createViewDefinition()), diff --git a/modules/angular2/test/core/render/dom/compiler/pipeline_spec.ts b/modules/angular2/test/core/render/dom/compiler/pipeline_spec.ts index 9121499b9f1934..41e75fb4548c1e 100644 --- a/modules/angular2/test/core/render/dom/compiler/pipeline_spec.ts +++ b/modules/angular2/test/core/render/dom/compiler/pipeline_spec.ts @@ -1,5 +1,5 @@ import {describe, beforeEach, it, expect, iit, ddescribe, el} from 'angular2/test_lib'; -import {ListWrapper, List, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {isPresent, NumberWrapper, StringWrapper} from 'angular2/src/core/facade/lang'; diff --git a/modules/angular2/test/core/render/dom/compiler/property_binding_parser_spec.ts b/modules/angular2/test/core/render/dom/compiler/property_binding_parser_spec.ts index ad8e70d21201b6..71585a6622f3e9 100644 --- a/modules/angular2/test/core/render/dom/compiler/property_binding_parser_spec.ts +++ b/modules/angular2/test/core/render/dom/compiler/property_binding_parser_spec.ts @@ -26,7 +26,7 @@ export function main() { return new ViewDefinition({componentId: 'someComponent'}); } - function process(element, hasNestedProtoView = false): List { + function process(element, hasNestedProtoView = false): Array { return ListWrapper.map( createPipeline(hasNestedProtoView) .processElements(element, ViewType.COMPONENT, createViewDefinition()), diff --git a/modules/angular2/test/core/render/dom/compiler/selector_spec.ts b/modules/angular2/test/core/render/dom/compiler/selector_spec.ts index 48ae7a7666e3e7..d209303982674f 100644 --- a/modules/angular2/test/core/render/dom/compiler/selector_spec.ts +++ b/modules/angular2/test/core/render/dom/compiler/selector_spec.ts @@ -2,7 +2,7 @@ import {describe, it, expect, beforeEach, ddescribe, iit, xit, el} from 'angular import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {SelectorMatcher} from 'angular2/src/core/render/dom/compiler/selector'; import {CssSelector} from 'angular2/src/core/render/dom/compiler/selector'; -import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection'; export function main() { describe('SelectorMatcher', () => { diff --git a/modules/angular2/test/core/render/dom/dom_testbed.ts b/modules/angular2/test/core/render/dom/dom_testbed.ts index 0130d1b69a396d..fc05fe3dce4ba6 100644 --- a/modules/angular2/test/core/render/dom/dom_testbed.ts +++ b/modules/angular2/test/core/render/dom/dom_testbed.ts @@ -1,6 +1,6 @@ import {Inject, Injectable} from 'angular2/di'; import {isPresent} from 'angular2/src/core/facade/lang'; -import {MapWrapper, ListWrapper, List, Map} from 'angular2/src/core/facade/collection'; +import {MapWrapper, ListWrapper, Map} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; @@ -27,7 +27,7 @@ export class TestRootView { viewRef: RenderViewRef; fragments: RenderFragmentRef[]; hostElement: Element; - events: List>; + events: Array>; constructor(viewWithFragments: RenderViewWithFragments) { this.viewRef = viewWithFragments.viewRef; @@ -48,9 +48,9 @@ export function elRef(renderView: RenderViewRef, boundElementIndex: number) { export function rootNodes(view: RenderViewRef) {} class LoggingEventDispatcher implements RenderEventDispatcher { - log: List>; + log: Array>; - constructor(log: List>) { this.log = log; } + constructor(log: Array>) { this.log = log; } dispatchRenderEvent(elementIndex: number, eventName: string, locals: Map): boolean { this.log.push([elementIndex, eventName, locals]); @@ -83,7 +83,8 @@ export class DomTestbed { return PromiseWrapper.all(promises); } - merge(protoViews: List): Promise { + merge(protoViews: + Array): Promise { return this.compiler.mergeProtoViewsRecursively(collectMergeRenderProtoViewsRecurse( protoViews[0], ListWrapper.slice(protoViews, 1))); } @@ -114,8 +115,8 @@ export class DomTestbed { } function collectMergeRenderProtoViewsRecurse(current: ProtoViewDto, - components: List): - List> { + components: Array): + Array> { var result = [current.render]; current.elementBinders.forEach((elementBinder) => { if (isPresent(elementBinder.nestedProtoView)) { diff --git a/modules/angular2/test/core/render/dom/events/event_manager_spec.ts b/modules/angular2/test/core/render/dom/events/event_manager_spec.ts index b8767b3437d2b6..ecd93991cdc515 100644 --- a/modules/angular2/test/core/render/dom/events/event_manager_spec.ts +++ b/modules/angular2/test/core/render/dom/events/event_manager_spec.ts @@ -15,7 +15,7 @@ import { DomEventsPlugin } from 'angular2/src/core/render/dom/events/event_manager'; import {NgZone} from 'angular2/src/core/zone/ng_zone'; -import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; export function main() { @@ -120,10 +120,10 @@ export function main() { } class FakeEventManagerPlugin extends EventManagerPlugin { - _supports: List; + _supports: Array; _nonBubbleEventHandlers: Map; _bubbleEventHandlers: Map; - constructor(supports: List) { + constructor(supports: Array) { super(); this._supports = supports; this._nonBubbleEventHandlers = new Map(); diff --git a/modules/angular2/test/router/integration/lifecycle_hook_spec.ts b/modules/angular2/test/router/integration/lifecycle_hook_spec.ts index 311de3b928ac4a..46672db7e1a065 100644 --- a/modules/angular2/test/router/integration/lifecycle_hook_spec.ts +++ b/modules/angular2/test/router/integration/lifecycle_hook_spec.ts @@ -52,7 +52,7 @@ import {ComponentInstruction} from 'angular2/src/router/instruction'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; var cmpInstanceCount; -var log: List; +var log: Array; var eventBus: EventEmitter; var completer: PromiseCompleter; diff --git a/modules/angular2/test/router/integration/outlet_spec.ts b/modules/angular2/test/router/integration/outlet_spec.ts index 4252ccb7eca575..f7437db2fba4a2 100644 --- a/modules/angular2/test/router/integration/outlet_spec.ts +++ b/modules/angular2/test/router/integration/outlet_spec.ts @@ -37,7 +37,7 @@ import {RouteRegistry} from 'angular2/src/router/route_registry'; import {DirectiveResolver} from 'angular2/src/core/compiler/directive_resolver'; var cmpInstanceCount; -var log: List; +var log: Array; export function main() { describe('Outlet Directive', () => { diff --git a/modules/angular2/test/web_workers/shared/mock_event_emitter.ts b/modules/angular2/test/web_workers/shared/mock_event_emitter.ts index e0c8c1778442fc..ec8931018ed644 100644 --- a/modules/angular2/test/web_workers/shared/mock_event_emitter.ts +++ b/modules/angular2/test/web_workers/shared/mock_event_emitter.ts @@ -3,7 +3,7 @@ import * as Rx from 'rx'; import {ListWrapper} from 'angular2/src/core/facade/collection'; export class MockEventEmitter extends EventEmitter { - private _nextFns: List = []; + private _nextFns: Array = []; constructor() { super(); } diff --git a/modules/angular2/test/web_workers/shared/render_view_with_fragments_store_spec.ts b/modules/angular2/test/web_workers/shared/render_view_with_fragments_store_spec.ts index fad2db235caf26..ee11de4e365c85 100644 --- a/modules/angular2/test/web_workers/shared/render_view_with_fragments_store_spec.ts +++ b/modules/angular2/test/web_workers/shared/render_view_with_fragments_store_spec.ts @@ -9,7 +9,7 @@ import { WebWorkerRenderViewRef, WebWorkerRenderFragmentRef } from "angular2/src/web_workers/shared/render_view_with_fragments_store"; -import {List, ListWrapper} from "angular2/src/core/facade/collection"; +import {ListWrapper} from "angular2/src/core/facade/collection"; export function main() { describe("RenderViewWithFragmentsStore", () => { @@ -23,8 +23,8 @@ export function main() { var viewRef: WebWorkerRenderViewRef = view.viewRef; expect(viewRef.refNumber).toEqual(0); - var fragmentRefs: List = - >view.fragmentRefs; + var fragmentRefs: Array = + >view.fragmentRefs; expect(fragmentRefs.length).toEqual(10); for (var i = 0; i < fragmentRefs.length; i++) { diff --git a/modules/angular2/traceur-runtime.d.ts b/modules/angular2/traceur-runtime.d.ts index 8f78106a742d37..7e6cbe526c77bd 100644 --- a/modules/angular2/traceur-runtime.d.ts +++ b/modules/angular2/traceur-runtime.d.ts @@ -53,8 +53,8 @@ interface Map { clear(): void; delete (key: K): boolean; forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - keys(): List; - values(): List; + keys(): Array; + values(): Array; get(key: K): V; has(key: K): boolean; set(key: K, value: V): Map; @@ -65,7 +65,7 @@ declare var Map: { new(): Map; // alexeagle: PATCHED new(m: Map): Map; - new(l: List): Map; + new(l: Array): Map; prototype: Map; }; @@ -82,7 +82,7 @@ declare var Set: { new(): Set; // alexeagle PATCHED new(s: Set): Set; - new(l: List): Set; + new(l: Array): Set; prototype: Set; }; diff --git a/modules/angular2_material/src/components/grid_list/grid_list.ts b/modules/angular2_material/src/components/grid_list/grid_list.ts index 1f5c1ecea77cc2..0035d96c5ce4bb 100644 --- a/modules/angular2_material/src/components/grid_list/grid_list.ts +++ b/modules/angular2_material/src/components/grid_list/grid_list.ts @@ -35,8 +35,8 @@ class RowHeightMode { encapsulation: ViewEncapsulation.NONE }) export class MdGridList { - /** List of tiles that are being rendered. */ - tiles: List; + /** Array of tiles that are being rendered. */ + tiles: Array; /** Number of columns being rendered. */ _cols: number; @@ -302,7 +302,7 @@ export class MdGridTile { */ class TileCoordinator { // Tracking array (see class description). - tracker: List; + tracker: Array; // Index at which the search for the next gap will start. columnIndex: number; @@ -311,9 +311,9 @@ class TileCoordinator { rowIndex: number; // The computed (row, col) position of each tile (the output). - positions: List; + positions: Array; - constructor(numColumns: number, tiles: List) { + constructor(numColumns: number, tiles: Array) { this.columnIndex = 0; this.rowIndex = 0; diff --git a/modules/angular2_material/src/components/radio/radio_button.ts b/modules/angular2_material/src/components/radio/radio_button.ts index 12e78c05c75f41..3073798eb0dfd5 100644 --- a/modules/angular2_material/src/components/radio/radio_button.ts +++ b/modules/angular2_material/src/components/radio/radio_button.ts @@ -59,8 +59,8 @@ export class MdRadioGroup { /** Dispatcher for coordinating radio unique-selection by name. */ radioDispatcher: MdRadioDispatcher; - /** List of child radio buttons. */ - radios_: List; + /** Array of child radio buttons. */ + radios_: Array; activedescendant: any; diff --git a/modules/angular2_material/src/components/radio/radio_dispatcher.ts b/modules/angular2_material/src/components/radio/radio_dispatcher.ts index 8834b513489376..1019308718d383 100644 --- a/modules/angular2_material/src/components/radio/radio_dispatcher.ts +++ b/modules/angular2_material/src/components/radio/radio_dispatcher.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; /** * Class for radio buttons to coordinate unique selection based on name. @@ -6,7 +6,7 @@ import {List, ListWrapper} from 'angular2/src/core/facade/collection'; */ export class MdRadioDispatcher { // TODO(jelbourn): Change this to TypeScript syntax when supported. - listeners_: List; + listeners_: Array; constructor() { this.listeners_ = []; diff --git a/modules/benchmarks/src/compiler/compiler_benchmark.ts b/modules/benchmarks/src/compiler/compiler_benchmark.ts index 10cf72a7710c6f..9392f6bbe6d4cf 100644 --- a/modules/benchmarks/src/compiler/compiler_benchmark.ts +++ b/modules/benchmarks/src/compiler/compiler_benchmark.ts @@ -1,6 +1,6 @@ import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; import {PromiseWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection'; import {DateWrapper, Type, print} from 'angular2/src/core/facade/lang'; import { @@ -107,7 +107,7 @@ class MultipleViewResolver extends ViewResolver { _multiple: number; _cache: Map; - constructor(multiple: number, components: List) { + constructor(multiple: number, components: Array) { super(); this._multiple = multiple; this._cache = new Map(); diff --git a/modules/benchmarks/src/costs/index.ts b/modules/benchmarks/src/costs/index.ts index 3eeddbe39bd096..d5aca4ac1b33f5 100644 --- a/modules/benchmarks/src/costs/index.ts +++ b/modules/benchmarks/src/costs/index.ts @@ -7,7 +7,7 @@ import { View } from 'angular2/bootstrap'; import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util'; import {NgIf, NgFor} from 'angular2/directives'; @@ -83,7 +83,7 @@ class DynamicDummy { ` }) class AppComponent { - list: List; + list: Array; testingPlainComponents: boolean; testingWithDirectives: boolean; testingDynamicComponents: boolean; diff --git a/modules/benchmarks/src/naive_infinite_scroll/app.ts b/modules/benchmarks/src/naive_infinite_scroll/app.ts index fe5d45aacbfd99..fe1aff344be26d 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/app.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/app.ts @@ -1,7 +1,7 @@ import {isPresent} from 'angular2/src/core/facade/lang'; import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util'; import {TimerWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {ScrollAreaComponent} from './scroll_area'; import {NgIf, NgFor} from 'angular2/directives'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; @@ -25,7 +25,7 @@ import {Component, Directive, View} from 'angular2/angular2'; ` }) export class App { - scrollAreas: List; + scrollAreas: Array; iterationCount: number; scrollIncrement: number; diff --git a/modules/benchmarks/src/naive_infinite_scroll/cells.ts b/modules/benchmarks/src/naive_infinite_scroll/cells.ts index f038a457502812..8397654c75e640 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/cells.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/cells.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, Map} from 'angular2/src/core/facade/collection'; +import {ListWrapper, Map} from 'angular2/src/core/facade/collection'; import {Company, Opportunity, Offering, Account, CustomDate, STATUS_LIST} from './common'; import {NgFor} from 'angular2/directives'; @@ -52,7 +52,7 @@ export class Stage { }) export class StageButtonsComponent extends HasStyle { _offering: Offering; - stages: List; + stages: Array; get offering(): Offering { return this._offering; } diff --git a/modules/benchmarks/src/naive_infinite_scroll/index.ts b/modules/benchmarks/src/naive_infinite_scroll/index.ts index 29e5a7df747c68..767d2784de8df7 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/index.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/index.ts @@ -9,6 +9,6 @@ export function main() { bootstrap(App, createBindings()); } -function createBindings(): List { +function createBindings(): Array { return [bind(APP_VIEW_POOL_CAPACITY).toValue(100000)]; } diff --git a/modules/benchmarks/src/naive_infinite_scroll/random_data.ts b/modules/benchmarks/src/naive_infinite_scroll/random_data.ts index f65d97e9acbf3e..e46f00e9b8f476 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/random_data.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/random_data.ts @@ -1,5 +1,5 @@ import {StringWrapper} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import { CustomDate, Offering, @@ -10,7 +10,7 @@ import { AAT_STATUS_LIST } from './common'; -export function generateOfferings(count: number): List { +export function generateOfferings(count: number): Array { var res = []; for (var i = 0; i < count; i++) { res.push(generateOffering(i)); diff --git a/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts b/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts index 631db4de4b2fa9..d5d56ac826d31e 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts +++ b/modules/benchmarks/src/naive_infinite_scroll/scroll_area.ts @@ -38,8 +38,8 @@ import {NgFor} from 'angular2/directives'; ` }) export class ScrollAreaComponent { - _fullList: List; - visibleItems: List; + _fullList: Array; + visibleItems: Array; viewPortHeight: number; paddingDiv; diff --git a/modules/benchmarks/src/static_tree/tree_benchmark.ts b/modules/benchmarks/src/static_tree/tree_benchmark.ts index 6dccedba961a01..cc4f8dc634bbd3 100644 --- a/modules/benchmarks/src/static_tree/tree_benchmark.ts +++ b/modules/benchmarks/src/static_tree/tree_benchmark.ts @@ -11,7 +11,6 @@ import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle'; import {reflector} from 'angular2/src/core/reflection/reflection'; import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {List} from 'angular2/src/core/facade/collection'; import {window, document, gc} from 'angular2/src/core/facade/browser'; import { getIntParameter, @@ -25,7 +24,7 @@ import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool'; import {bind, Binding} from 'angular2/di'; -function createBindings(): List { +function createBindings(): Array { var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 0; return [bind(APP_VIEW_POOL_CAPACITY).toValue(viewCacheCapacity)]; } diff --git a/modules/benchmarks/src/tree/tree_benchmark.ts b/modules/benchmarks/src/tree/tree_benchmark.ts index 061adba94baf64..55017bd1f359fe 100644 --- a/modules/benchmarks/src/tree/tree_benchmark.ts +++ b/modules/benchmarks/src/tree/tree_benchmark.ts @@ -10,7 +10,6 @@ import { import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle'; import {DOM} from 'angular2/src/core/dom/dom_adapter'; import {isPresent} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; import {window, document, gc} from 'angular2/src/core/facade/browser'; import { getIntParameter, @@ -24,7 +23,7 @@ import {BrowserDomAdapter} from 'angular2/src/core/dom/browser_adapter'; import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool'; import {bind, Binding} from 'angular2/di'; -function createBindings(): List { +function createBindings(): Array { var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 1; return [bind(APP_VIEW_POOL_CAPACITY).toValue(viewCacheCapacity)]; } diff --git a/modules/benchpress/src/firefox_extension/lib/main.ts b/modules/benchpress/src/firefox_extension/lib/main.ts index 0c811cebf4cdfc..725677208d4f08 100644 --- a/modules/benchpress/src/firefox_extension/lib/main.ts +++ b/modules/benchpress/src/firefox_extension/lib/main.ts @@ -6,7 +6,7 @@ var ParserUtil = require('./parser_util'); class Profiler { private _profiler; - private _markerEvents: List; + private _markerEvents: Array; private _profilerStartTime: number; constructor() { this._profiler = Cc['@mozilla.org/tools/profiler;1'].getService(Ci.nsIProfiler); } @@ -27,7 +27,7 @@ class Profiler { return perfEvents; } - _mergeMarkerEvents(perfEvents: List): List { + _mergeMarkerEvents(perfEvents: Array): Array { this._markerEvents.forEach(function(markerEvent) { perfEvents.push(markerEvent); }); return perfEvents; } diff --git a/modules/benchpress/src/firefox_extension/lib/parser_util.ts b/modules/benchpress/src/firefox_extension/lib/parser_util.ts index ff7d7d9918e64f..5497cf65f6f9d2 100644 --- a/modules/benchpress/src/firefox_extension/lib/parser_util.ts +++ b/modules/benchpress/src/firefox_extension/lib/parser_util.ts @@ -5,7 +5,7 @@ * @return {Array} An array of recognized events that are captured * within the perf profile. */ -export function convertPerfProfileToEvents(perfProfile: any): List { +export function convertPerfProfileToEvents(perfProfile: any): Array { var inProgressEvents = new Map(); // map from event name to start time var finishedEvents = []; // Array finished events var addFinishedEvent = function(eventName, startTime, endTime) { diff --git a/modules/benchpress/src/metric/multi_metric.ts b/modules/benchpress/src/metric/multi_metric.ts index 07126bd61d7be5..bc883780f3cbda 100644 --- a/modules/benchpress/src/metric/multi_metric.ts +++ b/modules/benchpress/src/metric/multi_metric.ts @@ -1,11 +1,11 @@ import {bind, Binding, Injector, OpaqueToken} from 'angular2/di'; -import {List, ListWrapper, StringMapWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMapWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Metric} from '../metric'; export class MultiMetric extends Metric { - static createBindings(childTokens): List { + static createBindings(childTokens): Array { return [ bind(_CHILDREN) .toFactory( @@ -15,7 +15,7 @@ export class MultiMetric extends Metric { ]; } - constructor(private _metrics: List) { super(); } + constructor(private _metrics: Array) { super(); } /** * Starts measuring @@ -52,4 +52,4 @@ function mergeStringMaps(maps): Object { return result; } -var _CHILDREN = new OpaqueToken('MultiMetric.children'); \ No newline at end of file +var _CHILDREN = new OpaqueToken('MultiMetric.children'); diff --git a/modules/benchpress/src/metric/perflog_metric.ts b/modules/benchpress/src/metric/perflog_metric.ts index c348bb2c00f183..8a33bfec35af0b 100644 --- a/modules/benchpress/src/metric/perflog_metric.ts +++ b/modules/benchpress/src/metric/perflog_metric.ts @@ -20,11 +20,11 @@ import {Options} from '../common_options'; */ export class PerflogMetric extends Metric { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } // TODO(tbosch): use static values when our transpiler supports them static get SET_TIMEOUT(): OpaqueToken { return _SET_TIMEOUT; } - private _remainingEvents: List>; + private _remainingEvents: Array>; private _measureCount: number; _perfLogFeatures: PerfLogFeatures; @@ -171,7 +171,7 @@ export class PerflogMetric extends Metric { } } - _aggregateEvents(events: List>, markName): StringMap { + _aggregateEvents(events: Array>, markName): StringMap { var result = {'scriptTime': 0, 'pureScriptTime': 0}; if (this._perfLogFeatures.gc) { result['gcTime'] = 0; @@ -310,7 +310,7 @@ export class PerflogMetric extends Metric { _addFrameMetrics(result: StringMap, frameTimes: any[]) { result['frameTime.mean'] = ListWrapper.reduce(frameTimes, (a, b) => a + b, 0) / frameTimes.length; - var firstFrame = ListWrapper.get(frameTimes, 0); + var firstFrame = frameTimes[0]; result['frameTime.worst'] = ListWrapper.reduce(frameTimes, (a, b) => a > b ? a : b, firstFrame); result['frameTime.best'] = ListWrapper.reduce(frameTimes, (a, b) => a < b ? a : b, firstFrame); result['frameTime.smooth'] = diff --git a/modules/benchpress/src/reporter.ts b/modules/benchpress/src/reporter.ts index b2a779cfd44f29..b87777597b8bb6 100644 --- a/modules/benchpress/src/reporter.ts +++ b/modules/benchpress/src/reporter.ts @@ -2,7 +2,6 @@ import {bind, Binding} from 'angular2/di'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang'; import {MeasureValues} from './measure_values'; -import {List} from 'angular2/src/core/facade/collection'; /** * A reporter reports measure values and the valid sample. @@ -15,8 +14,8 @@ export class Reporter { reportMeasureValues(values: MeasureValues): Promise { throw new BaseException('NYI'); } - reportSample(completeSample: List, - validSample: List): Promise { + reportSample(completeSample: Array, + validSample: Array): Promise { throw new BaseException('NYI'); } } diff --git a/modules/benchpress/src/reporter/console_reporter.ts b/modules/benchpress/src/reporter/console_reporter.ts index 546f5e34bd7b72..54c8a62f6d363d 100644 --- a/modules/benchpress/src/reporter/console_reporter.ts +++ b/modules/benchpress/src/reporter/console_reporter.ts @@ -1,5 +1,5 @@ import {print, isPresent, isBlank, NumberWrapper} from 'angular2/src/core/facade/lang'; -import {StringMapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Math} from 'angular2/src/core/facade/math'; import {bind, Binding, OpaqueToken} from 'angular2/di'; @@ -18,7 +18,7 @@ export class ConsoleReporter extends Reporter { // TODO(tbosch): use static values when our transpiler supports them static get COLUMN_WIDTH(): OpaqueToken { return _COLUMN_WIDTH; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } static _lpad(value, columnWidth, fill = ' ') { @@ -38,7 +38,7 @@ export class ConsoleReporter extends Reporter { return props; } - private _metricNames: List; + private _metricNames: Array; constructor(private _columnWidth: number, sampleDescription, private _print: Function) { super(); @@ -69,8 +69,8 @@ export class ConsoleReporter extends Reporter { return PromiseWrapper.resolve(null); } - reportSample(completeSample: List, - validSample: List): Promise { + reportSample(completeSample: Array, + validSample: Array): Promise { this._printStringRow(this._metricNames.map((_) => ''), '='); this._printStringRow(ListWrapper.map(this._metricNames, (metricName) => { var sample = diff --git a/modules/benchpress/src/reporter/json_file_reporter.ts b/modules/benchpress/src/reporter/json_file_reporter.ts index e549fb2fbd41e8..c224f425a22285 100644 --- a/modules/benchpress/src/reporter/json_file_reporter.ts +++ b/modules/benchpress/src/reporter/json_file_reporter.ts @@ -1,5 +1,4 @@ import {DateWrapper, isPresent, isBlank, Json} from 'angular2/src/core/facade/lang'; -import {List} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {bind, Binding, OpaqueToken} from 'angular2/di'; @@ -16,7 +15,7 @@ export class JsonFileReporter extends Reporter { // TODO(tbosch): use static values when our transpiler supports them static get PATH(): OpaqueToken { return _PATH; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } _writeFile: Function; _path: string; @@ -35,8 +34,8 @@ export class JsonFileReporter extends Reporter { return PromiseWrapper.resolve(null); } - reportSample(completeSample: List, - validSample: List): Promise { + reportSample(completeSample: Array, + validSample: Array): Promise { var content = Json.stringify({ 'description': this._description, 'completeSample': completeSample, diff --git a/modules/benchpress/src/reporter/multi_reporter.ts b/modules/benchpress/src/reporter/multi_reporter.ts index 77fd5d7057465e..f7a5f5ca26032f 100644 --- a/modules/benchpress/src/reporter/multi_reporter.ts +++ b/modules/benchpress/src/reporter/multi_reporter.ts @@ -1,12 +1,12 @@ import {bind, Binding, Injector, OpaqueToken} from 'angular2/di'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {MeasureValues} from '../measure_values'; import {Reporter} from '../reporter'; export class MultiReporter extends Reporter { - static createBindings(childTokens: List): List { + static createBindings(childTokens: Array): Array { return [ bind(_CHILDREN) .toFactory( @@ -16,20 +16,20 @@ export class MultiReporter extends Reporter { ]; } - _reporters: List; + _reporters: Array; constructor(reporters) { super(); this._reporters = reporters; } - reportMeasureValues(values: MeasureValues): Promise> { + reportMeasureValues(values: MeasureValues): Promise> { return PromiseWrapper.all( ListWrapper.map(this._reporters, (reporter) => reporter.reportMeasureValues(values))); } - reportSample(completeSample: List, - validSample: List): Promise> { + reportSample(completeSample: Array, + validSample: Array): Promise> { return PromiseWrapper.all(ListWrapper.map( this._reporters, (reporter) => reporter.reportSample(completeSample, validSample))); } diff --git a/modules/benchpress/src/runner.ts b/modules/benchpress/src/runner.ts index 1f1a5d7578d615..c98c3387b4a575 100644 --- a/modules/benchpress/src/runner.ts +++ b/modules/benchpress/src/runner.ts @@ -1,6 +1,6 @@ import {Injector, bind, Binding} from 'angular2/di'; import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; import {Sampler, SampleState} from './sampler'; @@ -26,8 +26,8 @@ import {Options} from './common_options'; * It provides defaults, creates the injector and calls the sampler. */ export class Runner { - private _defaultBindings: List; - constructor(defaultBindings: List = null) { + private _defaultBindings: Array; + constructor(defaultBindings: Array = null) { if (isBlank(defaultBindings)) { defaultBindings = []; } diff --git a/modules/benchpress/src/sample_description.ts b/modules/benchpress/src/sample_description.ts index fc04d433115d9c..0abeb65a2f7a95 100644 --- a/modules/benchpress/src/sample_description.ts +++ b/modules/benchpress/src/sample_description.ts @@ -1,4 +1,4 @@ -import {StringMapWrapper, ListWrapper, List, StringMap} from 'angular2/src/core/facade/collection'; +import {StringMapWrapper, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {bind, Binding, OpaqueToken} from 'angular2/di'; import {Validator} from './validator'; import {Metric} from './metric'; @@ -9,10 +9,10 @@ import {Options} from './common_options'; */ export class SampleDescription { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } description: StringMap; - constructor(public id: string, descriptions: List>, + constructor(public id: string, descriptions: Array>, public metrics: StringMap) { this.description = {}; ListWrapper.forEach(descriptions, (description) => { diff --git a/modules/benchpress/src/sampler.ts b/modules/benchpress/src/sampler.ts index 23fac334f19b09..68607fad487d5d 100644 --- a/modules/benchpress/src/sampler.ts +++ b/modules/benchpress/src/sampler.ts @@ -1,6 +1,6 @@ import {isPresent, isBlank, Date, DateWrapper} from 'angular2/src/core/facade/lang'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {StringMapWrapper, StringMap, List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {StringMapWrapper, StringMap, ListWrapper} from 'angular2/src/core/facade/collection'; import {bind, Binding, OpaqueToken} from 'angular2/di'; import {Metric} from './metric'; @@ -21,7 +21,7 @@ import {MeasureValues} from './measure_values'; */ export class Sampler { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } _driver: WebDriverAdapter; _metric: Metric; @@ -80,7 +80,7 @@ export class Sampler { _report(state: SampleState, metricValues: StringMap): Promise { var measureValues = new MeasureValues(state.completeSample.length, this._now(), metricValues); - var completeSample = ListWrapper.concat(state.completeSample, [measureValues]); + var completeSample = state.completeSample.concat([measureValues]); var validSample = this._validator.validate(completeSample); var resultPromise = this._reporter.reportMeasureValues(measureValues); if (isPresent(validSample)) { @@ -92,7 +92,7 @@ export class Sampler { } export class SampleState { - constructor(public completeSample: List, public validSample: List) {} + constructor(public completeSample: Array, public validSample: Array) {} } var _BINDINGS = [ diff --git a/modules/benchpress/src/statistic.ts b/modules/benchpress/src/statistic.ts index c1fc69b016a4cd..9e726e47a8bf33 100644 --- a/modules/benchpress/src/statistic.ts +++ b/modules/benchpress/src/statistic.ts @@ -1,5 +1,5 @@ import {Math} from 'angular2/src/core/facade/math'; -import {ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; export class Statistic { static calculateCoefficientOfVariation(sample, mean) { @@ -20,7 +20,7 @@ export class Statistic { return deviation; } - static calculateRegressionSlope(xValues: List, xMean: number, yValues: List, + static calculateRegressionSlope(xValues: Array, xMean: number, yValues: Array, yMean: number) { // See http://en.wikipedia.org/wiki/Simple_linear_regression var dividendSum = 0; diff --git a/modules/benchpress/src/validator.ts b/modules/benchpress/src/validator.ts index 3c2213173ebb13..3f6d9e0a156d0a 100644 --- a/modules/benchpress/src/validator.ts +++ b/modules/benchpress/src/validator.ts @@ -1,5 +1,5 @@ import {bind, Binding} from 'angular2/di'; -import {List, StringMap} from 'angular2/src/core/facade/collection'; +import {StringMap} from 'angular2/src/core/facade/collection'; import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang'; import {MeasureValues} from './measure_values'; @@ -18,7 +18,7 @@ export class Validator { /** * Calculates a valid sample out of the complete sample */ - validate(completeSample: List): List { + validate(completeSample: Array): Array { throw new BaseException('NYI'); } diff --git a/modules/benchpress/src/validator/regression_slope_validator.ts b/modules/benchpress/src/validator/regression_slope_validator.ts index ac247922c8a07f..9e3121a59976b4 100644 --- a/modules/benchpress/src/validator/regression_slope_validator.ts +++ b/modules/benchpress/src/validator/regression_slope_validator.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {bind, Binding, OpaqueToken} from 'angular2/di'; import {Validator} from '../validator'; @@ -15,7 +15,7 @@ export class RegressionSlopeValidator extends Validator { // TODO(tbosch): use static values when our transpiler supports them static get METRIC(): OpaqueToken { return _METRIC; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } _sampleSize: number; _metric: string; @@ -30,7 +30,7 @@ export class RegressionSlopeValidator extends Validator { return {'sampleSize': this._sampleSize, 'regressionSlopeMetric': this._metric}; } - validate(completeSample: List): List { + validate(completeSample: Array): Array { if (completeSample.length >= this._sampleSize) { var latestSample = ListWrapper.slice(completeSample, completeSample.length - this._sampleSize, completeSample.length); diff --git a/modules/benchpress/src/validator/size_validator.ts b/modules/benchpress/src/validator/size_validator.ts index a06285bb3ceeca..cd3b1d2cac7e64 100644 --- a/modules/benchpress/src/validator/size_validator.ts +++ b/modules/benchpress/src/validator/size_validator.ts @@ -1,4 +1,4 @@ -import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {bind, Binding, OpaqueToken} from 'angular2/di'; import {Validator} from '../validator'; @@ -9,7 +9,7 @@ import {MeasureValues} from '../measure_values'; */ export class SizeValidator extends Validator { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } // TODO(tbosch): use static values when our transpiler supports them static get SAMPLE_SIZE() { return _SAMPLE_SIZE; } @@ -22,7 +22,7 @@ export class SizeValidator extends Validator { describe(): StringMap { return {'sampleSize': this._sampleSize}; } - validate(completeSample: List): List { + validate(completeSample: Array): Array { if (completeSample.length >= this._sampleSize) { return ListWrapper.slice(completeSample, completeSample.length - this._sampleSize, completeSample.length); diff --git a/modules/benchpress/src/web_driver_adapter.ts b/modules/benchpress/src/web_driver_adapter.ts index e04cbc2ee78d64..609205228d410f 100644 --- a/modules/benchpress/src/web_driver_adapter.ts +++ b/modules/benchpress/src/web_driver_adapter.ts @@ -1,7 +1,7 @@ import {bind, Binding} from 'angular2/di'; import {Promise} from 'angular2/src/core/facade/async'; import {BaseException, ABSTRACT} from 'angular2/src/core/facade/lang'; -import {List, Map} from 'angular2/src/core/facade/collection'; +import {Map} from 'angular2/src/core/facade/collection'; /** * A WebDriverAdapter bridges API differences between different WebDriver clients, @@ -18,5 +18,5 @@ export class WebDriverAdapter { executeScript(script: string): Promise { throw new BaseException('NYI'); } executeAsyncScript(script: string): Promise { throw new BaseException('NYI'); } capabilities(): Promise> { throw new BaseException('NYI'); } - logs(type: string): Promise> { throw new BaseException('NYI'); } + logs(type: string): Promise> { throw new BaseException('NYI'); } } diff --git a/modules/benchpress/src/web_driver_extension.ts b/modules/benchpress/src/web_driver_extension.ts index ea82171541aa0d..ee5ee49324ca8a 100644 --- a/modules/benchpress/src/web_driver_extension.ts +++ b/modules/benchpress/src/web_driver_extension.ts @@ -2,7 +2,7 @@ import {bind, Binding, Injector, OpaqueToken} from 'angular2/di'; import {BaseException, ABSTRACT, isBlank, isPresent} from 'angular2/src/core/facade/lang'; import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async'; -import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {Options} from './common_options'; @@ -13,7 +13,7 @@ import {Options} from './common_options'; */ @ABSTRACT() export class WebDriverExtension { - static bindTo(childTokens): List { + static bindTo(childTokens): Array { var res = [ bind(_CHILDREN) .toFactory( @@ -57,7 +57,7 @@ export class WebDriverExtension { * Based on [Chrome Trace Event *Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit) **/ - readPerfLog(): Promise> { throw new BaseException('NYI'); } + readPerfLog(): Promise> { throw new BaseException('NYI'); } perfLogFeatures(): PerfLogFeatures { throw new BaseException('NYI'); } diff --git a/modules/benchpress/src/webdriver/chrome_driver_extension.ts b/modules/benchpress/src/webdriver/chrome_driver_extension.ts index a153fcf1b4e285..a4c28f2038c3b0 100644 --- a/modules/benchpress/src/webdriver/chrome_driver_extension.ts +++ b/modules/benchpress/src/webdriver/chrome_driver_extension.ts @@ -23,7 +23,7 @@ import {Promise} from 'angular2/src/core/facade/async'; */ export class ChromeDriverExtension extends WebDriverExtension { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } constructor(private _driver: WebDriverAdapter) { super(); } @@ -63,8 +63,8 @@ export class ChromeDriverExtension extends WebDriverExtension { }); } - _convertPerfRecordsToEvents(chromeEvents: List>, - normalizedEvents: List> = null) { + _convertPerfRecordsToEvents(chromeEvents: Array>, + normalizedEvents: Array> = null) { if (isBlank(normalizedEvents)) { normalizedEvents = []; } diff --git a/modules/benchpress/src/webdriver/firefox_driver_extension.ts b/modules/benchpress/src/webdriver/firefox_driver_extension.ts index f37df77db39b13..cec5aff0b240d8 100644 --- a/modules/benchpress/src/webdriver/firefox_driver_extension.ts +++ b/modules/benchpress/src/webdriver/firefox_driver_extension.ts @@ -5,7 +5,7 @@ import {WebDriverAdapter} from '../web_driver_adapter'; import {Promise} from 'angular2/src/core/facade/async'; export class FirefoxDriverExtension extends WebDriverExtension { - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } private _profilerStarted: boolean; diff --git a/modules/benchpress/src/webdriver/ios_driver_extension.ts b/modules/benchpress/src/webdriver/ios_driver_extension.ts index 7411d58bcfb801..156e5c2d75ada4 100644 --- a/modules/benchpress/src/webdriver/ios_driver_extension.ts +++ b/modules/benchpress/src/webdriver/ios_driver_extension.ts @@ -15,7 +15,7 @@ import {Promise} from 'angular2/src/core/facade/async'; export class IOsDriverExtension extends WebDriverExtension { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): List { return _BINDINGS; } + static get BINDINGS(): Array { return _BINDINGS; } constructor(private _driver: WebDriverAdapter) { super(); } diff --git a/modules/benchpress/src/webdriver/selenium_webdriver_adapter.ts b/modules/benchpress/src/webdriver/selenium_webdriver_adapter.ts index 4e398a779652a6..37cd606fab61ec 100644 --- a/modules/benchpress/src/webdriver/selenium_webdriver_adapter.ts +++ b/modules/benchpress/src/webdriver/selenium_webdriver_adapter.ts @@ -8,7 +8,7 @@ import * as webdriver from 'selenium-webdriver'; * Adapter for the selenium-webdriver. */ export class SeleniumWebDriverAdapter extends WebDriverAdapter { - static get PROTRACTOR_BINDINGS(): List { return _PROTRACTOR_BINDINGS; } + static get PROTRACTOR_BINDINGS(): Array { return _PROTRACTOR_BINDINGS; } constructor(private _driver: any) { super(); } diff --git a/modules/benchpress/test/metric/multi_metric_spec.ts b/modules/benchpress/test/metric/multi_metric_spec.ts index 8f2c323e6732d8..8940dd9be3f69a 100644 --- a/modules/benchpress/test/metric/multi_metric_spec.ts +++ b/modules/benchpress/test/metric/multi_metric_spec.ts @@ -11,7 +11,7 @@ import { xit, } from 'angular2/test_lib'; -import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {Metric, MultiMetric, bind, Injector} from 'benchpress/common'; diff --git a/modules/benchpress/test/metric/perflog_metric_spec.ts b/modules/benchpress/test/metric/perflog_metric_spec.ts index 02d76eae4a229c..7a572b2c59c254 100644 --- a/modules/benchpress/test/metric/perflog_metric_spec.ts +++ b/modules/benchpress/test/metric/perflog_metric_spec.ts @@ -11,7 +11,7 @@ import { xit, } from 'angular2/test_lib'; -import {List, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; @@ -641,7 +641,7 @@ export function main() { } class MockDriverExtension extends WebDriverExtension { - constructor(private _perfLogs: List, private _commandLog: List, + constructor(private _perfLogs: Array, private _commandLog: Array, private _perfLogFeatures: PerfLogFeatures) { super(); } diff --git a/modules/benchpress/test/reporter/console_reporter_spec.ts b/modules/benchpress/test/reporter/console_reporter_spec.ts index e2a73e147eca9f..0d750de20e51ed 100644 --- a/modules/benchpress/test/reporter/console_reporter_spec.ts +++ b/modules/benchpress/test/reporter/console_reporter_spec.ts @@ -1,7 +1,7 @@ import {describe, ddescribe, it, iit, xit, expect, beforeEach, afterEach} from 'angular2/test_lib'; import {isBlank, isPresent, Date, DateWrapper} from 'angular2/src/core/facade/lang'; -import {List, ListWrapper} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import { SampleState, diff --git a/modules/benchpress/test/reporter/multi_reporter_spec.ts b/modules/benchpress/test/reporter/multi_reporter_spec.ts index 3caaaae01c9a38..4234e65c214aee 100644 --- a/modules/benchpress/test/reporter/multi_reporter_spec.ts +++ b/modules/benchpress/test/reporter/multi_reporter_spec.ts @@ -11,7 +11,7 @@ import { xit, } from 'angular2/test_lib'; -import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; +import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import {DateWrapper} from 'angular2/src/core/facade/lang'; @@ -69,8 +69,8 @@ class MockReporter extends Reporter { return PromiseWrapper.resolve({'id': this._id, 'values': values}); } - reportSample(completeSample: List, - validSample: List): Promise> { + reportSample(completeSample: Array, + validSample: Array): Promise> { return PromiseWrapper.resolve( {'id': this._id, 'completeSample': completeSample, 'validSample': validSample}); } diff --git a/modules/benchpress/test/sampler_spec.ts b/modules/benchpress/test/sampler_spec.ts index b15c0f267bab8e..aadc28923289bd 100644 --- a/modules/benchpress/test/sampler_spec.ts +++ b/modules/benchpress/test/sampler_spec.ts @@ -19,7 +19,7 @@ import { Date, DateWrapper } from 'angular2/src/core/facade/lang'; -import {ListWrapper, List} from 'angular2/src/core/facade/collection'; +import {ListWrapper} from 'angular2/src/core/facade/collection'; import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; import { @@ -251,7 +251,7 @@ function createCountingMetric(log = null) { } class MockDriverAdapter extends WebDriverAdapter { - private _log: List; + private _log: Array; private _waitFor: Function; constructor(log = null, waitFor = null) { super(); @@ -272,7 +272,7 @@ class MockDriverAdapter extends WebDriverAdapter { class MockValidator extends Validator { - private _log: List; + private _log: Array; constructor(log = null, private _validate: Function = null) { super(); if (isBlank(log)) { @@ -280,7 +280,7 @@ class MockValidator extends Validator { } this._log = log; } - validate(completeSample: List): List { + validate(completeSample: Array): Array { var stableSample = isPresent(this._validate) ? this._validate(completeSample) : completeSample; this._log.push(['validate', completeSample, stableSample]); return stableSample; @@ -288,7 +288,7 @@ class MockValidator extends Validator { } class MockMetric extends Metric { - private _log: List; + private _log: Array; constructor(log = null, private _endMeasure: Function = null) { super(); if (isBlank(log)) { @@ -308,7 +308,7 @@ class MockMetric extends Metric { } class MockReporter extends Reporter { - _log: List; + _log: Array; constructor(log = null) { super(); if (isBlank(log)) { diff --git a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts index 4924213ab65876..c8ce594d897117 100644 --- a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts @@ -302,7 +302,8 @@ export function main() { } class MockDriverAdapter extends WebDriverAdapter { - constructor(private _log: List, private _events: List, private _messageMethod: string) { + constructor(private _log: Array, private _events: Array, + private _messageMethod: string) { super(); } diff --git a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts index 852c88cfd1f11e..a629d06eb1cb09 100644 --- a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts @@ -192,7 +192,7 @@ function internalScriptRecord(startTime, endTime) { } class MockDriverAdapter extends WebDriverAdapter { - constructor(private _log: List, private _perfRecords: List) { super(); } + constructor(private _log: Array, private _perfRecords: Array) { super(); } executeScript(script) { this._log.push(['executeScript', script]); diff --git a/modules/examples/src/material/button/index.ts b/modules/examples/src/material/button/index.ts index 2fe9a9f4d83dd0..82e70e40cd50cd 100644 --- a/modules/examples/src/material/button/index.ts +++ b/modules/examples/src/material/button/index.ts @@ -16,7 +16,7 @@ class DemoApp { previousClick: string; action: string; clickCount: number; - items: List; + items: Array; constructor() { this.previousClick = 'Nothing'; diff --git a/modules/examples/src/model_driven_forms/index.ts b/modules/examples/src/model_driven_forms/index.ts index 96a556393348f4..c3d46916468a4e 100644 --- a/modules/examples/src/model_driven_forms/index.ts +++ b/modules/examples/src/model_driven_forms/index.ts @@ -39,7 +39,7 @@ function creditCardValidator(c): StringMap { class ShowError { formDir; controlPath: string; - errorTypes: List; + errorTypes: Array; constructor(@Host() formDir: NgFormModel) { this.formDir = formDir; } diff --git a/modules/examples/src/person_management/index.ts b/modules/examples/src/person_management/index.ts index a4fc646a94d6b3..a176954ed622ed 100644 --- a/modules/examples/src/person_management/index.ts +++ b/modules/examples/src/person_management/index.ts @@ -197,7 +197,7 @@ class PersonsComponent { @View({ template: ` - + diff --git a/modules/examples/src/routing/inbox-app.ts b/modules/examples/src/routing/inbox-app.ts index 16fb696cdbd17d..02c33b6a29a061 100644 --- a/modules/examples/src/routing/inbox-app.ts +++ b/modules/examples/src/routing/inbox-app.ts @@ -105,7 +105,7 @@ class InboxDetailCmp { @Component({selector: 'inbox'}) @View({templateUrl: "inbox.html", directives: [NgFor, RouterLink]}) class InboxCmp { - items: List = []; + items: Array = []; ready: boolean = false; constructor(public router: Router, db: DbService) { @@ -120,7 +120,7 @@ class InboxCmp { @Component({selector: 'drafts'}) @View({templateUrl: "drafts.html", directives: [NgFor, RouterLink]}) class DraftsCmp { - items: List = []; + items: Array = []; ready: boolean = false; constructor(public router: Router, db: DbService) { diff --git a/modules/examples/src/template_driven_forms/index.ts b/modules/examples/src/template_driven_forms/index.ts index be612199118a14..85c73d747bc8b2 100644 --- a/modules/examples/src/template_driven_forms/index.ts +++ b/modules/examples/src/template_driven_forms/index.ts @@ -73,7 +73,7 @@ class CreditCardValidator { class ShowError { formDir; controlPath: string; - errorTypes: List; + errorTypes: Array; constructor(@Host() formDir: NgForm) { this.formDir = formDir; } diff --git a/modules/examples/src/todo/services/TodoStore.ts b/modules/examples/src/todo/services/TodoStore.ts index 585277d18abc72..29a851b4166877 100644 --- a/modules/examples/src/todo/services/TodoStore.ts +++ b/modules/examples/src/todo/services/TodoStore.ts @@ -24,7 +24,7 @@ export class TodoFactory { // Store manages any generic item that inherits from KeyModel @Injectable() export class Store { - list: List = []; + list: Array = []; add(record: KeyModel): void { this.list.push(record); } diff --git a/modules/examples/src/web_workers/images/services/bitmap.ts b/modules/examples/src/web_workers/images/services/bitmap.ts index f0bbecf492a4e9..670ebc308a5cc9 100644 --- a/modules/examples/src/web_workers/images/services/bitmap.ts +++ b/modules/examples/src/web_workers/images/services/bitmap.ts @@ -63,7 +63,7 @@ export class BitmapService { return imageData; } - private _swap(data: List, index1: number, index2: number) { + private _swap(data: Array, index1: number, index2: number) { var temp = data[index1]; data[index1] = data[index2]; data[index2] = temp; diff --git a/modules/examples/src/web_workers/todo/services/TodoStore.ts b/modules/examples/src/web_workers/todo/services/TodoStore.ts index 04d3f1c646f98d..c92e22e6170103 100644 --- a/modules/examples/src/web_workers/todo/services/TodoStore.ts +++ b/modules/examples/src/web_workers/todo/services/TodoStore.ts @@ -28,7 +28,7 @@ export class TodoFactory { // Store manages any generic item that inherits from KeyModel @Injectable() export class Store { - list: List = []; + list: Array = []; add(record: KeyModel): void { this.list.push(record); } diff --git a/modules/rtts_assert/test/rtts_assert_spec.ts b/modules/rtts_assert/test/rtts_assert_spec.ts index 93a76a3e4f866e..ece7808ed34748 100644 --- a/modules/rtts_assert/test/rtts_assert_spec.ts +++ b/modules/rtts_assert/test/rtts_assert_spec.ts @@ -1,7 +1,6 @@ // # Assert.js // A run-time type assertion library for JavaScript. Designed to be used with // [Traceur](https://github.com/google/traceur-compiler). -import {} from '../../angular2/src/test_lib/e2e_util'; import {assert} from '../rtts_assert'; // - [Basic Type Check](#basic-type-check)