feat: remove MapWrapper.clear().
It's the same in Dart and JavaScript.
This commit is contained in:
		
							parent
							
								
									dfd30910aa
								
							
						
					
					
						commit
						941362014b
					
				| @ -621,7 +621,7 @@ class _DuplicateMap { | ||||
| 
 | ||||
|   get isEmpty(): boolean { return MapWrapper.size(this.map) === 0; } | ||||
| 
 | ||||
|   clear() { MapWrapper.clear(this.map); } | ||||
|   clear() { this.map.clear(); } | ||||
| 
 | ||||
|   toString(): string { return '_DuplicateMap(' + stringify(this.map) + ')'; } | ||||
| } | ||||
|  | ||||
| @ -52,8 +52,8 @@ export class CompilerCache { | ||||
|   } | ||||
| 
 | ||||
|   clear(): void { | ||||
|     MapWrapper.clear(this._cache); | ||||
|     MapWrapper.clear(this._hostCache); | ||||
|     this._cache.clear(); | ||||
|     this._hostCache.clear(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -43,9 +43,6 @@ class MapWrapper { | ||||
|   static void delete(Map m, k) { | ||||
|     m.remove(k); | ||||
|   } | ||||
|   static void clear(Map m) { | ||||
|     m.clear(); | ||||
|   } | ||||
|   static void clearValues(Map m) { | ||||
|     for (var k in m.keys) { | ||||
|       m[k] = null; | ||||
|  | ||||
| @ -67,7 +67,6 @@ export class MapWrapper { | ||||
|   static forEach<K, V>(m: Map<K, V>, fn: /*(V, K) => void*/ Function) { m.forEach(<any>fn); } | ||||
|   static size(m: Map<any, any>) { return m.size; } | ||||
|   static delete<K>(m: Map<K, any>, k: K) { m.delete(k); } | ||||
|   static clear(m: Map<any, any>) { m.clear(); } | ||||
|   static clearValues(m: Map<any, any>) { _clearValues(m); } | ||||
|   static iterable(m) { return m; } | ||||
|   static keys<K>(m: Map<K, any>): List<K> { return m.keys(); } | ||||
|  | ||||
| @ -60,8 +60,8 @@ export function shimCssForComponent(cssText: string, componentId: string): strin | ||||
| 
 | ||||
| // Reset the caches - used for tests only
 | ||||
| export function resetShadowDomCache() { | ||||
|   MapWrapper.clear(_componentUIDs); | ||||
|   _componentUIDs.clear(); | ||||
|   _nextComponentUID = 0; | ||||
|   MapWrapper.clear(_sharedStyleTexts); | ||||
|   _sharedStyleTexts.clear(); | ||||
|   _lastInsertedStyleEl = null; | ||||
| } | ||||
|  | ||||
| @ -98,7 +98,7 @@ export function main() { | ||||
|             .toEqual(kvChangesAsString( | ||||
|                 {map: ['a', 'd'], previous: ['a', 'b[BB->null]', 'd'], removals: ['b[BB->null]']})); | ||||
| 
 | ||||
|         MapWrapper.clear(m); | ||||
|         m.clear(); | ||||
|         changes.check(m); | ||||
|         expect(changes.toString()) | ||||
|             .toEqual(kvChangesAsString( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user