michael@0: // Map.clear is unaffected by deleting/monkeypatching Map.prototype.{delete,iterator}. michael@0: michael@0: var data = [["a", 1], ["b", 2]]; michael@0: var m1 = Map(data), m2 = Map(data); michael@0: michael@0: delete Map.prototype.delete; michael@0: delete Map.prototype.iterator; michael@0: m1.clear(); michael@0: assertEq(m1.size, 0); michael@0: michael@0: Map.prototype.delete = function () { throw "FAIL"; }; michael@0: Map.prototype.iterator = function () { throw "FAIL"; }; michael@0: m2.clear(); michael@0: assertEq(m2.size, 0);