refactor(ListWrapper): drop forEach and removeLast

Closes #4584
This commit is contained in:
Victor Berchet
2015-10-07 09:09:43 -07:00
parent 4ed642f921
commit aee176115b
35 changed files with 71 additions and 104 deletions

View File

@ -139,8 +139,7 @@ export class CssSelector {
res += ']';
}
}
ListWrapper.forEach(this.notSelectors,
(notSelector) => { res += ":not(" + notSelector.toString() + ")"; });
this.notSelectors.forEach(notSelector => res += `:not(${notSelector})`);
return res;
}
}

View File

@ -213,7 +213,7 @@ function _removeDotSegments(path: string): string {
var trailingSlash = path[path.length - 1] === '/' ? '/' : '';
var segments = path.split('/');
var out = [];
var out: string[] = [];
var up = 0;
for (var pos = 0; pos < segments.length; pos++) {
var segment = segments[pos];
@ -223,7 +223,7 @@ function _removeDotSegments(path: string): string {
break;
case '..':
if (out.length > 0) {
ListWrapper.removeAt(out, out.length - 1);
out.pop();
} else {
up++;
}
@ -235,7 +235,7 @@ function _removeDotSegments(path: string): string {
if (leadingSlash == '') {
while (up-- > 0) {
ListWrapper.insert(out, 0, '..');
out.unshift('..');
}
if (out.length === 0) out.push('.');

View File

@ -28,8 +28,7 @@ export class MockXHR extends XHR {
}
do {
var request = ListWrapper.removeAt(this._requests, 0);
this._processRequest(request);
this._processRequest(this._requests.shift());
} while (this._requests.length > 0);
this.verifyNoOustandingExpectations();