Skip to content

Commit

Permalink
feat(MapPolyfill): implement clear interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Feb 10, 2016
1 parent 66678aa commit e3fbd05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/util/MapPolyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ export class MapPolyfill {
return true;
}

forEach(cb: Function, thisArg: any) {
clear(): void {
this._keys.length = 0;
this._values.length = 0;
this.size = 0;
}

forEach(cb: Function, thisArg: any): void {
for (let i = 0; i < this.size; i++) {
cb.call(thisArg, this._values[i], this._keys[i]);
}
Expand Down

0 comments on commit e3fbd05

Please sign in to comment.