1 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
2 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
6 function makeClosure() {
7 var v1
, v2
, v3
, v4
, v5
, v6
, v7
, v8
, v9
, v10
; // Make a lot of potentially captured variables.
8 return function (){ return v1
; }; // But only capture one in optimizing compiles.
11 for (var i
= 0; i
< 100; ++i
) {
12 closures
.push(makeClosure());
16 makeClosure(); // Force recompilation.
18 // At this point, we should have 100 activations that captured 1 variable
19 // but think they captured 10. If so, GC should make them crash.
20 if (window
.GCController
)
21 GCController
.collect();
23 for (var i
= 0; i
< 10000; ++i
)
29 InspectorTest
.startDebuggerTest(function () {
30 InspectorTest
.evaluateInPage("tryCrash()");
31 InspectorTest
.completeDebuggerTest();
35 window
.onload
= runTest
;
39 Tests for a crash caused by inaccurate Activation records.
40 <rdar://problem/
8525907> Crash in debugger beneath MarkStack::drain @ me.com, ibm.com