Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test that attempts to reproduce issue #1

  • Loading branch information...
commit c959ef7301e52644eb2445ebbf89783ac202c392 1 parent 93085ee
@eriwen authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/es6-map-shim-test.js
View
8 spec/es6-map-shim-test.js
@@ -286,6 +286,14 @@ describe('es6-map-shim', function() {
expect(function(){ iterator.next() }).toThrow(new Error('Stop Iteration'));
});
+ it('should handle delete while iterating gracefully', function() {
+ var map = new Map([['foo', 'bar'], [1, 2], ['last', 42]]);
+ var iterator = map.iterator();
+ expect(iterator.next()).toEqual(['foo', 'bar']);
+ expect(map.delete(1)).toBe(true);
+ expect(iterator.next()).toEqual(['last', 42]);
+ });
+
it('should return itself', function() {
var map = new Map([['foo', 'bar'], [undefined, 42]]);
var iterator = map.iterator();
Please sign in to comment.
Something went wrong with that request. Please try again.