MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / call

Method call

app/src/DataModel/Scripting/JsWatchdog.cpp:97–115  ·  view source on GitHub ↗

* @brief Calls fn(args) under the watchdog with no explicit `this`. */

Source from the content-addressed store, hash-verified

95 * @brief Calls fn(args) under the watchdog with no explicit `this`.
96 */
97QJSValue DataModel::JsWatchdog::call(QJSValue& fn, const QJSValueList& args)
98{
99 Q_ASSERT(fn.isCallable());
100 Q_ASSERT(m_engine != nullptr);
101
102 m_lastTimedOut = false;
103 arm();
104 const auto result = fn.call(args);
105 disarm();
106
107 if (m_engine->isInterrupted()) [[unlikely]] {
108 m_engine->setInterrupted(false);
109 m_lastTimedOut = true;
110 qWarning().noquote() << "[JsWatchdog]" << (m_tag.isEmpty() ? QStringLiteral("script") : m_tag)
111 << "timed out after" << m_budgetMs << "ms -- interrupted";
112 }
113
114 return result;
115}
116
117/**
118 * @brief Calls fn.callWithInstance(thisObj, args) under the watchdog.

Callers 15

jquery.jsFile · 0.45
wFunction · 0.45
jFunction · 0.45
IFunction · 0.45
eFunction · 0.45
aFunction · 0.45
$Function · 0.45
SeFunction · 0.45
HeFunction · 0.45
MeFunction · 0.45
utFunction · 0.45
ltFunction · 0.45

Calls 1

isEmptyMethod · 0.80

Tested by 1

evaluateMethod · 0.36