diff options
Diffstat (limited to 'WebCore/bindings/js/ScriptCallStack.cpp')
-rw-r--r-- | WebCore/bindings/js/ScriptCallStack.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/WebCore/bindings/js/ScriptCallStack.cpp b/WebCore/bindings/js/ScriptCallStack.cpp index c9bb8b0..de61b07 100644 --- a/WebCore/bindings/js/ScriptCallStack.cpp +++ b/WebCore/bindings/js/ScriptCallStack.cpp @@ -91,11 +91,21 @@ void ScriptCallStack::initialize() if (!m_caller || m_initialized) return; - JSValue func = m_exec->interpreter()->retrieveCaller(m_exec, m_caller); - while (!func.isNull()) { - JSFunction* jsFunction = asFunction(func); - m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), UString(), 0, 0, 0)); - func = m_exec->interpreter()->retrieveCaller(m_exec, jsFunction); + int signedLineNumber; + intptr_t sourceID; + UString urlString; + JSValue function; + // callFrame must exist if m_caller is not null. + CallFrame* callFrame = m_exec->callerFrame(); + while (true) { + ASSERT(callFrame); + m_exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function); + if (!function) + break; + JSFunction* jsFunction = asFunction(function); + unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0; + m_frames.append(ScriptCallFrame(jsFunction->name(m_exec), urlString, lineNumber, m_exec, 0)); + callFrame = callFrame->callerFrame(); } m_initialized = true; } |