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 ac852a7684..a797e973a3 100644 --- a/modules/angular2/src/core/change_detection/codegen_name_util.ts +++ b/modules/angular2/src/core/change_detection/codegen_name_util.ts @@ -109,8 +109,8 @@ export class CodegenNameUtil { } } var assignmentsCode = - ListWrapper.isEmpty(assignments) ? '' : `${ListWrapper.join(assignments, '=')} = false;`; - return `var ${ListWrapper.join(declarations, ',')};${assignmentsCode}`; + ListWrapper.isEmpty(assignments) ? '' : `${assignments.join('=')} = false;`; + return `var ${declarations.join(',')};${assignmentsCode}`; } /** @@ -169,20 +169,16 @@ export class CodegenNameUtil { // At least one assignment. fields.push(`${this._utilName}.uninitialized;`); - return ListWrapper.join(fields, ' = '); + return fields.join(' = '); } /** * Generates statements destroying all pipe variables. */ genPipeOnDestroy(): string { - return ListWrapper.join( - ListWrapper.map( - ListWrapper.filter(this._records, (r) => { return r.isPipeRecord(); }), - (r) => { - return `${this._utilName}.callPipeOnDestroy(${this.getPipeName(r.selfIndex)});`; - }), - '\n'); + return ListWrapper.filter(this._records, (r) => { return r.isPipeRecord(); }) + .map(r => `${this._utilName}.callPipeOnDestroy(${this.getPipeName(r.selfIndex)});`) + .join('\n'); } getPipeName(idx: number): string { 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 9ead718fc5..fdc45213d5 100644 --- a/modules/angular2/src/core/change_detection/proto_change_detector.ts +++ b/modules/angular2/src/core/change_detection/proto_change_detector.ts @@ -314,8 +314,7 @@ function _arrayFn(length: number): Function { } function _mapPrimitiveName(keys: any[]) { - var stringifiedKeys = - ListWrapper.join(ListWrapper.map(keys, (k) => isString(k) ? `"${k}"` : `${k}`), ", "); + var stringifiedKeys = keys.map(k => isString(k) ? `"${k}"` : `${k}`).join(', '); return `mapFn([${stringifiedKeys}])`; } diff --git a/modules/angular2/src/core/compiler/xhr_mock.ts b/modules/angular2/src/core/compiler/xhr_mock.ts index 33d1ac9f09..dd67bc19a8 100644 --- a/modules/angular2/src/core/compiler/xhr_mock.ts +++ b/modules/angular2/src/core/compiler/xhr_mock.ts @@ -5,15 +5,9 @@ import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptio import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/core/facade/async'; export class MockXHR extends XHR { - private _expectations: _Expectation[]; + private _expectations: _Expectation[] = []; private _definitions = new Map(); - private _requests: _PendingRequest[]; - - constructor() { - super(); - this._expectations = []; - this._requests = []; - } + private _requests: _PendingRequest[] = []; get(url: string): Promise { var request = new _PendingRequest(url); @@ -50,7 +44,7 @@ export class MockXHR extends XHR { urls.push(expectation.url); } - throw new BaseException(`Unsatisfied requests: ${ListWrapper.join(urls, ', ')}`); + throw new BaseException(`Unsatisfied requests: ${urls.join(', ')}`); } private _processRequest(request: _PendingRequest) { 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 42ed16944d..c520cadc1f 100644 --- a/modules/angular2/src/core/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/core/debug/debug_element_view_listener.ts @@ -20,7 +20,7 @@ var _nextId = 0; function _setElementId(element, indices: number[]) { if (isPresent(element)) { - DOM.setData(element, NG_ID_PROPERTY, ListWrapper.join(indices, NG_ID_SEPARATOR)); + DOM.setData(element, NG_ID_PROPERTY, indices.join(NG_ID_SEPARATOR)); } } diff --git a/modules/angular2/src/core/dom/parse5_adapter.ts b/modules/angular2/src/core/dom/parse5_adapter.ts index 09df09e961..57e1e2e5c0 100644 --- a/modules/angular2/src/core/dom/parse5_adapter.ts +++ b/modules/angular2/src/core/dom/parse5_adapter.ts @@ -356,7 +356,7 @@ export class Parse5DomAdapter extends DomAdapter { var index = classList.indexOf(classname); if (index == -1) { classList.push(classname); - element.attribs["class"] = element.className = ListWrapper.join(classList, " "); + element.attribs["class"] = element.className = classList.join(" "); } } removeClass(element, classname: string) { @@ -364,7 +364,7 @@ export class Parse5DomAdapter extends DomAdapter { var index = classList.indexOf(classname); if (index > -1) { classList.splice(index, 1); - element.attribs["class"] = element.className = ListWrapper.join(classList, " "); + element.attribs["class"] = element.className = classList.join(" "); } } hasClass(element, classname: string): boolean { diff --git a/modules/angular2/src/core/facade/collection.dart b/modules/angular2/src/core/facade/collection.dart index 9f566806bf..af6ddea0d6 100644 --- a/modules/angular2/src/core/facade/collection.dart +++ b/modules/angular2/src/core/facade/collection.dart @@ -167,7 +167,6 @@ class ListWrapper { l.clear(); } - static String join(List l, String s) => l.join(s); static bool isEmpty(Iterable list) => list.isEmpty; static void fill(List l, value, [int start = 0, int end]) { l.fillRange(_startOffset(l, start), _endOffset(l, end), value); diff --git a/modules/angular2/src/core/facade/collection.ts b/modules/angular2/src/core/facade/collection.ts index 632612bfad..f26145c119 100644 --- a/modules/angular2/src/core/facade/collection.ts +++ b/modules/angular2/src/core/facade/collection.ts @@ -245,7 +245,6 @@ export class ListWrapper { return false; } static clear(list: any[]) { list.length = 0; } - static join(list: any[], s: string): string { return list.join(s); } static isEmpty(list: any[]): boolean { return list.length == 0; } static fill(list: any[], value: any, start: number = 0, end: number = null) { list.fill(value, start, end === null ? list.length : end); diff --git a/modules/angular2/src/core/forms/directives/shared.ts b/modules/angular2/src/core/forms/directives/shared.ts index 8c28c5a060..7d577e7bfe 100644 --- a/modules/angular2/src/core/forms/directives/shared.ts +++ b/modules/angular2/src/core/forms/directives/shared.ts @@ -42,7 +42,7 @@ export function setUpControl(control: Control, dir: NgControl): void { } function _throwError(dir: NgControl, message: string): void { - var path = ListWrapper.join(dir.path, " -> "); + var path = dir.path.join(" -> "); throw new BaseException(`${message} '${path}'`); } diff --git a/modules/angular2/src/http/url_search_params.ts b/modules/angular2/src/http/url_search_params.ts index 1a998c2e9b..e020fb8bc2 100644 --- a/modules/angular2/src/http/url_search_params.ts +++ b/modules/angular2/src/http/url_search_params.ts @@ -130,7 +130,7 @@ export class URLSearchParams { MapWrapper.forEach(this.paramsMap, (values, k) => { ListWrapper.forEach(values, v => { paramsList.push(k + '=' + v); }); }); - return ListWrapper.join(paramsList, '&'); + return paramsList.join('&'); } delete (param: string): void { MapWrapper.delete(this.paramsMap, param); } diff --git a/modules/angular2/src/test_lib/utils.ts b/modules/angular2/src/test_lib/utils.ts index 90085ad8d9..78907b5537 100644 --- a/modules/angular2/src/test_lib/utils.ts +++ b/modules/angular2/src/test_lib/utils.ts @@ -21,7 +21,7 @@ export class Log { clear(): void { this._result = []; } - result(): string { return ListWrapper.join(this._result, "; "); } + result(): string { return this._result.join("; "); } }