summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testStringBufferMallocAccounting.js
blob: e016f3b6bc60baacdf047a32daa6c07b9273cb0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// first build a big honkin' string
str = "a";
for (var i = 0; i < 20; ++i)
    str = str + str;
str.indexOf('a');

var f;
f = makeFinalizeObserver();
assertEq(finalizeCount(), 0);

// Create another observer to make sure that we overwrite all conservative
// roots for the previous one and can observer the GC.
f = makeFinalizeObserver();

// if the assert fails, add more iterations
for (var i = 0; i < 80; ++i)
    str.replace(/(a)/, '$1');
//assertEq(finalizeCount(), 1);