michael@0: try{} catch (x) {} michael@0: michael@0: var callStack = []; michael@0: function currentFunc() { michael@0: return callStack[0]; michael@0: } michael@0: function reportFailure () { michael@0: var funcName = currentFunc(); michael@0: // play with the result to cause a SEGV. michael@0: var prefix = (funcName) ? funcName : ""; michael@0: // Use OSR to compile the function at the end of the first run. michael@0: for (var i=0; i < 50; i++) ; michael@0: } michael@0: michael@0: callStack[0] = 'test'; michael@0: // Run and compile with a string as result of currentFunc. michael@0: reportFailure(); michael@0: callStack[0] = undefined; michael@0: // Use previously compiled code with the string assumption. michael@0: reportFailure();