Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ariya/phantomjs
...
head fork: istvan-antal/phantomjs
compare: addons
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
36 src/qt/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp
@@ -324,7 +324,7 @@ void QWebPagePrivateDebugger::reportError(const JSC::JSValue& exception)
JSC::ExecState* exec = frame->dynamicGlobalObject()->globalExec();
JSC::UString message = exception.toString(exec);
-
+
QString qmessage = QString::fromUtf8(message.utf8().data());
QList<QWebPage::JavaScriptFrame> qbacktrace;
@@ -333,6 +333,8 @@ void QWebPagePrivateDebugger::reportError(const JSC::JSValue& exception)
QString file;
int line;
QString function;
+
+ qbacktrace << QWebPage::JavaScriptFrame(s_file, s_line, s_function);
while (frame) {
provider = reinterpret_cast<JSC::SourceProvider*>(frame->sourceID());
@@ -351,6 +353,7 @@ void QWebPagePrivateDebugger::reportError(const JSC::JSValue& exception)
void QWebPagePrivateDebugger::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineNumber)
{
+ s_line = lineNumber;
stepOver(frame, sourceID, lineNumber);
}
@@ -389,28 +392,51 @@ void QWebPagePrivateDebugger::stepIn(const JSC::DebuggerCallFrame& frame, intptr
{
m_callFrame = WebCore::JavaScriptCallFrame::create(frame, m_callFrame, sourceID, textPosition(lineNumber));
m_stackDepth++;
+
+ JSC::SourceProvider* provider;
+ provider = reinterpret_cast<JSC::SourceProvider*>(m_callFrame->sourceID());
+ s_line = m_callFrame->line();
+ s_file = QString::fromUtf8(provider->url().utf8().data());
+ s_function = QString::fromUtf8(m_callFrame->functionName().utf8().data());
}
void QWebPagePrivateDebugger::stepOver(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineNumber)
{
+ if (m_stackDepth) {
+ JSC::SourceProvider* provider;
+ provider = reinterpret_cast<JSC::SourceProvider*>(m_callFrame->sourceID());
+ s_line = m_callFrame->line();
+ s_file = QString::fromUtf8(provider->url().utf8().data());
+ s_function = QString::fromUtf8(m_callFrame->functionName().utf8().data());
+ }
+
+ s_line = lineNumber;
m_callFrame->update(frame, sourceID, textPosition(lineNumber));
}
void QWebPagePrivateDebugger::stepOut(const JSC::DebuggerCallFrame& frame)
-{
+{
+ /*if (m_stackDepth) {
+ JSC::SourceProvider* provider;
+ provider = reinterpret_cast<JSC::SourceProvider*>(m_callFrame->sourceID());
+ s_line = m_callFrame->line();
+ s_file = QString::fromUtf8(provider->url().utf8().data());
+ s_function = QString::fromUtf8(m_callFrame->functionName().utf8().data());
+ }*/
+
m_callFrame = m_callFrame->caller();
m_stackDepth--;
-
+
// Sometimes an exception can occur without didExecuteProgram() firing.
// For example when a setTimeout callback fires. So if the stack is empty
// and there is still an exception present, we report it.
if (m_stackDepth == 0) {
JSC::JSValue exception = frame.exception();
-
+
if (exception) {
reportError(exception);
}
- }
+ }
}
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
View
4 src/qt/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage_p.h
@@ -119,6 +119,10 @@ class QWebPagePrivateDebugger : public JSC::Debugger {
RefPtr<WebCore::JavaScriptCallFrame> m_exceptionFrame;
int m_stackDepth;
QWebPage* m_webPage;
+
+ QString s_file;
+ int s_line;
+ QString s_function;
};
class QWebPagePrivate {

No commit comments for this range

Something went wrong with that request. Please try again.