]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/weak-map-constructor-adder.js
67034bc7a6a0bb2c5bac4da24a764c577fdabab0
1 // WeakMap constructor with adder change.
3 var originalAdder
= WeakMap
.prototype.set;
6 WeakMap
.prototype.set = function (key
, value
) {
8 return originalAdder
.call(this, key
, value
);
14 var obj3
= new Date();
15 var obj4
= new Error();
31 var map
= new WeakMap(values
);
32 if (counter
!== values
.length
)
33 throw "Error: bad counter " + counter
;
35 WeakMap
.prototype.set = function () {
36 throw new Error("adder called");
39 var map
= new WeakMap();
40 var map
= new WeakMap([]);
43 var map
= new WeakMap([ [0, 0] ]);
48 throw "Error: error not thrown";
49 if (String(error
) !== "Error: adder called")
50 throw "Error: bad error " + String(error
);