diff --git a/libraries/script-engine/src/ScriptManager.h b/libraries/script-engine/src/ScriptManager.h index db65e9fdfd..b777eb90e2 100644 --- a/libraries/script-engine/src/ScriptManager.h +++ b/libraries/script-engine/src/ScriptManager.h @@ -669,6 +669,15 @@ public: void removeAllEventHandlers(const EntityItemID& entityID); + /** + * @brief Return value of the script that finished running + * + * This should only be used after the script terminates. + * + * @return ScriptValue + */ + ScriptValue getReturnValue() const { return _returnValue; } + /**jsdoc * Gets the URL for an asset in an external resource bucket. (The location where the bucket is hosted may change over time * but this method will return the asset's current URL.) diff --git a/tests/script-engine/src/ScriptEngineTests.cpp b/tests/script-engine/src/ScriptEngineTests.cpp index 2d04788a90..7c70bf8da5 100644 --- a/tests/script-engine/src/ScriptEngineTests.cpp +++ b/tests/script-engine/src/ScriptEngineTests.cpp @@ -69,29 +69,6 @@ void ScriptEngineTests::initTestCase() { }); - QSharedPointer ac = DependencyManager::get(); - QVERIFY(!ac.isNull()); - - connect(ac.get(), &ScriptEngines::scriptLoadError, [](const QString& filename, const QString& error){ - qWarning() << "Failed to load script" << filename << ":" << error; - }); - - connect(ac.get(), &ScriptEngines::printedMessage, [](const QString& message, const QString& engineName){ - qDebug() << "Printed message from engine" << engineName << ": " << message; - }); - - connect(ac.get(), &ScriptEngines::infoMessage, [](const QString& message, const QString& engineName){ - qInfo() << "Info message from engine" << engineName << ": " << message; - }); - - connect(ac.get(), &ScriptEngines::warningMessage, [](const QString& message, const QString& engineName){ - qWarning() << "Warning from engine" << engineName << ": " << message; - }); - - connect(ac.get(), &ScriptEngines::errorMessage, [](const QString& message, const QString& engineName){ - qCritical() << "Error from engine" << engineName << ": " << message; - }); - } void ScriptEngineTests::scriptTest() {