Skip to content

Commit 9413620

Browse files
committed
feat: remove MapWrapper.clear().
It's the same in Dart and JavaScript.
1 parent dfd3091 commit 9413620

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

modules/angular2/src/change_detection/pipes/iterable_changes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ class _DuplicateMap {
621621

622622
get isEmpty(): boolean { return MapWrapper.size(this.map) === 0; }
623623

624-
clear() { MapWrapper.clear(this.map); }
624+
clear() { this.map.clear(); }
625625

626626
toString(): string { return '_DuplicateMap(' + stringify(this.map) + ')'; }
627627
}

modules/angular2/src/core/compiler/compiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class CompilerCache {
5252
}
5353

5454
clear(): void {
55-
MapWrapper.clear(this._cache);
56-
MapWrapper.clear(this._hostCache);
55+
this._cache.clear();
56+
this._hostCache.clear();
5757
}
5858
}
5959

modules/angular2/src/facade/collection.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ class MapWrapper {
4343
static void delete(Map m, k) {
4444
m.remove(k);
4545
}
46-
static void clear(Map m) {
47-
m.clear();
48-
}
4946
static void clearValues(Map m) {
5047
for (var k in m.keys) {
5148
m[k] = null;

modules/angular2/src/facade/collection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export class MapWrapper {
6767
static forEach<K, V>(m: Map<K, V>, fn: /*(V, K) => void*/ Function) { m.forEach(<any>fn); }
6868
static size(m: Map<any, any>) { return m.size; }
6969
static delete<K>(m: Map<K, any>, k: K) { m.delete(k); }
70-
static clear(m: Map<any, any>) { m.clear(); }
7170
static clearValues(m: Map<any, any>) { _clearValues(m); }
7271
static iterable(m) { return m; }
7372
static keys<K>(m: Map<K, any>): List<K> { return m.keys(); }

modules/angular2/src/render/dom/shadow_dom/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export function shimCssForComponent(cssText: string, componentId: string): strin
6060

6161
// Reset the caches - used for tests only
6262
export function resetShadowDomCache() {
63-
MapWrapper.clear(_componentUIDs);
63+
_componentUIDs.clear();
6464
_nextComponentUID = 0;
65-
MapWrapper.clear(_sharedStyleTexts);
65+
_sharedStyleTexts.clear();
6666
_lastInsertedStyleEl = null;
6767
}

modules/angular2/test/change_detection/pipes/keyvalue_changes_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function main() {
9898
.toEqual(kvChangesAsString(
9999
{map: ['a', 'd'], previous: ['a', 'b[BB->null]', 'd'], removals: ['b[BB->null]']}));
100100

101-
MapWrapper.clear(m);
101+
m.clear();
102102
changes.check(m);
103103
expect(changes.toString())
104104
.toEqual(kvChangesAsString(

0 commit comments

Comments
 (0)