2 "Test method-check related bugs"
7 // This test yields PASS, if malloc does not reuse the memory address for the structure of String prototype
10 String
.prototype.a = function() { }
11 String
.prototype.b = function() { }
13 if (window
.GCController
)
14 GCController
.collect();
16 // The following 3 lines cause gc() flush on a Debian
17 // Linux machine, but there is no garantee, it works on
18 // any other computer. (Not even another Debian Linux)
19 // If func2() is not called or a much bigger or lower
20 // value than 5000 is chosen, the crash won't happen
22 for (var i
= 0; i
< 5000; ++i
)
27 for (var i
= 0; i
< 5; ++i
)
34 // Test that method caching correctly invalidates (doesn't incorrectly continue to call a previously cached function).
40 function addOneHundred()
45 makeCall: function(callback
)
47 this.callback
= callback
;
51 for (var i
=0; i
<100; ++i
)
52 totalizer
.makeCall(addOne
);
53 totalizer
.makeCall(addOneHundred
);
54 shouldBe('total', '200');
56 // Check that we don't assert when method_check is applied to a non-JSFunction
57 for (var i
= 0; i
< 10000; i
++)