| // Map constructor with adder change. |
| var originalAdder = Map.prototype.set; |
| Map.prototype.set = function (key, value) { |
| return originalAdder.call(this, key, value); |
| var map = new Map(values); |
| throw "Error: bad map size " + map.size; |
| if (counter !== values.length) |
| throw "Error: bad counter " + counter; |
| Map.prototype.set = function () { |
| throw new Error("adder called"); |
| var map = new Map([ [0, 0] ]); |
| throw "Error: error not thrown"; |
| if (String(error) !== "Error: adder called") |
| throw "Error: bad error " + String(error); |