michael@0: // first build a big honkin' string michael@0: str = "a"; michael@0: for (var i = 0; i < 20; ++i) michael@0: str = str + str; michael@0: str.indexOf('a'); michael@0: michael@0: var f; michael@0: f = makeFinalizeObserver(); michael@0: assertEq(finalizeCount(), 0); michael@0: michael@0: // Create another observer to make sure that we overwrite all conservative michael@0: // roots for the previous one and can observer the GC. michael@0: f = makeFinalizeObserver(); michael@0: michael@0: // if the assert fails, add more iterations michael@0: for (var i = 0; i < 80; ++i) michael@0: str.replace(/(a)/, '$1'); michael@0: //assertEq(finalizeCount(), 1);