Skip to content

Commit

Permalink
Report JavaScript errors from Qt signals and slots
Browse files Browse the repository at this point in the history
Issue: #12973
Upstream issue: https://bugreports.qt.io/browse/QTBUG-37899
  • Loading branch information
vitallium committed Mar 11, 2016
1 parent 6cf54a3 commit 683923f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Source/WebCore/bridge/qt/qt_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1577,16 +1577,12 @@ void QtConnectionObject::execute(void** argv)
args[i] = convertQVariantToValue(m_context, m_rootObject, QVariant(argType, argv[i+1]), ignoredException);
}

JSObjectCallAsFunction(m_context, m_receiverFunction, m_receiver, argc, args.data(), 0);
}

bool QtConnectionObject::match(JSContextRef context, QObject* sender, int signalIndex, JSObjectRef receiver, JSObjectRef receiverFunction)
{
if (sender != parent() || signalIndex != m_signalIndex)
return false;
JSValueRef* ignoredException = 0;
const bool receiverMatch = (!receiver && !m_receiver) || (receiver && m_receiver && JSValueIsEqual(context, receiver, m_receiver, ignoredException));
return receiverMatch && JSValueIsEqual(context, receiverFunction, m_receiverFunction, ignoredException);
JSValueRef call_exception = 0;
ExecState* exec = toJS(m_context);
JSObjectCallAsFunction(m_context, m_receiverFunction, m_receiver, argc, args.data(), &call_exception);
if (call_exception) {
WebCore::reportException(exec, toJS(exec, call_exception));
}
}

} }

2 comments on commit 683923f

@zackw
Copy link

@zackw zackw commented on 683923f Mar 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit seems to have broken the build, by eliminating QtConnectionObject::match, which is still needed (and declared). Merge botch?

(also there was another hunk in the upstream change, that doesn't seem to have been incorporated)

@vitallium
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn. My bad.

What about another hunk?

Please sign in to comment.