chore: kill ListWrapper.create() and .push().
These wrappers are not natively understood by ts2dart. Removing them will improve Dart2JS compilation due to fewer megamorphic calls to List functions. It also makes Angular code more succinct and improves type safety in Angular due to better type inference of the Array component type. This change exposed several bugs in Angular.
This commit is contained in:
@ -10,7 +10,7 @@ export class DummyBrowserLocation extends SpyObject {
|
||||
internalBaseHref: string = '/';
|
||||
internalPath: string = '/';
|
||||
internalTitle: string = '';
|
||||
urlChanges: List<string> = ListWrapper.create();
|
||||
urlChanges: List<string> = [];
|
||||
_subject: EventEmitter = new EventEmitter();
|
||||
constructor() { super(); }
|
||||
|
||||
@ -28,7 +28,7 @@ export class DummyBrowserLocation extends SpyObject {
|
||||
pushState(ctx: any, title: string, url: string): void {
|
||||
this.internalTitle = title;
|
||||
this.internalPath = url;
|
||||
ListWrapper.push(this.urlChanges, url);
|
||||
this.urlChanges.push(url);
|
||||
}
|
||||
|
||||
forward(): void { throw new BaseException('Not implemented yet!'); }
|
||||
|
@ -17,7 +17,7 @@ export class SpyLocation extends SpyObject {
|
||||
constructor() {
|
||||
super();
|
||||
this._path = '/';
|
||||
this.urlChanges = ListWrapper.create();
|
||||
this.urlChanges = [];
|
||||
this._subject = new EventEmitter();
|
||||
this._baseHref = '';
|
||||
}
|
||||
@ -38,7 +38,7 @@ export class SpyLocation extends SpyObject {
|
||||
return;
|
||||
}
|
||||
this._path = url;
|
||||
ListWrapper.push(this.urlChanges, url);
|
||||
this.urlChanges.push(url);
|
||||
}
|
||||
|
||||
forward() {
|
||||
|
Reference in New Issue
Block a user