refactor(MapWrapper): drop delete(), get(), forEach() and size
Closes #4618
This commit is contained in:
@ -83,7 +83,7 @@ export class CodegenNameUtil {
|
||||
getLocalName(idx: number): string { return `l_${this._sanitizedNames[idx]}`; }
|
||||
|
||||
getEventLocalName(eb: EventBinding, idx: number): string {
|
||||
return `l_${MapWrapper.get(this._sanitizedEventNames, eb)[idx]}`;
|
||||
return `l_${this._sanitizedEventNames.get(eb)[idx]}`;
|
||||
}
|
||||
|
||||
getChangeName(idx: number): string { return `c_${this._sanitizedNames[idx]}`; }
|
||||
@ -118,7 +118,7 @@ export class CodegenNameUtil {
|
||||
*/
|
||||
genInitEventLocals(): string {
|
||||
var res = [`${this.getLocalName(CONTEXT_INDEX)} = ${this.getFieldName(CONTEXT_INDEX)}`];
|
||||
MapWrapper.forEach(this._sanitizedEventNames, (names, eb) => {
|
||||
this._sanitizedEventNames.forEach((names, eb) => {
|
||||
for (var i = 0; i < names.length; ++i) {
|
||||
if (i !== CONTEXT_INDEX) {
|
||||
res.push(`${this.getEventLocalName(eb, i)}`);
|
||||
|
@ -608,12 +608,12 @@ class _DuplicateMap {
|
||||
var recordList: _DuplicateItemRecordList = this.map.get(key);
|
||||
// Remove the list of duplicates when it gets empty
|
||||
if (recordList.remove(record)) {
|
||||
MapWrapper.delete(this.map, key);
|
||||
this.map.delete(key);
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
get isEmpty(): boolean { return MapWrapper.size(this.map) === 0; }
|
||||
get isEmpty(): boolean { return this.map.size === 0; }
|
||||
|
||||
clear() { this.map.clear(); }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {ListWrapper, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {stringify, looseIdentical, isJsObject, CONST, isBlank} from 'angular2/src/core/facade/lang';
|
||||
import {BaseException} from 'angular2/src/core/facade/exceptions';
|
||||
import {ChangeDetectorRef} from '../change_detector_ref';
|
||||
@ -197,7 +197,7 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer {
|
||||
for (var rec: KVChangeRecord = this._removalsHead; rec !== null; rec = rec._nextRemoved) {
|
||||
rec.previousValue = rec.currentValue;
|
||||
rec.currentValue = null;
|
||||
MapWrapper.delete(this._records, rec.key);
|
||||
this._records.delete(rec.key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer {
|
||||
|
||||
_forEach(obj, fn: Function) {
|
||||
if (obj instanceof Map) {
|
||||
MapWrapper.forEach(obj, fn);
|
||||
(<Map<any, any>>obj).forEach(<any>fn);
|
||||
} else {
|
||||
StringMapWrapper.forEach(obj, fn);
|
||||
}
|
||||
|
Reference in New Issue
Block a user