michael@0: // Complicated whitebox test for bug 487845. michael@0: function testGlobalShapeChangeAfterDeepBail() { michael@0: function f(name) { michael@0: this[name] = 1; // may change global shape michael@0: for (var i = 0; i < 4; i++) michael@0: ; // MonitorLoopEdge eventually triggers assertion michael@0: } michael@0: michael@0: // When i==3, deep-bail, then change global shape enough times to exhaust michael@0: // the array of GlobalStates. michael@0: var arr = [[], [], [], ["bug0", "bug1", "bug2", "bug3", "bug4"]]; michael@0: for (var i = 0; i < arr.length; i++) michael@0: arr[i].forEach(f); michael@0: } michael@0: testGlobalShapeChangeAfterDeepBail();