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