mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
add try-catch around script.main business
This commit is contained in:
@ -90,10 +90,14 @@ public class QJavaScriptExecutor implements QCodeExecutor
|
|||||||
{
|
{
|
||||||
%s
|
%s
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if(script && script.main)
|
if(script && script.main)
|
||||||
{
|
{
|
||||||
return (script.main());
|
return (script.main());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(e) { }
|
||||||
})();
|
})();
|
||||||
""".formatted(code);
|
""".formatted(code);
|
||||||
|
|
||||||
|
@ -108,16 +108,11 @@ class ExecuteCodeActionTest
|
|||||||
{
|
{
|
||||||
OneTestOutput oneTestOutput = testOne(4, """
|
OneTestOutput oneTestOutput = testOne(4, """
|
||||||
var script = (function (exports) {
|
var script = (function (exports) {
|
||||||
|
function main() {
|
||||||
function cooling() {
|
|
||||||
output.setD(7);
|
output.setD(7);
|
||||||
return (output);
|
return (output);
|
||||||
}
|
}
|
||||||
|
exports.main = main;
|
||||||
cooling();
|
|
||||||
|
|
||||||
exports.cooling = cooling;
|
|
||||||
|
|
||||||
return exports;
|
return exports;
|
||||||
})({});
|
})({});
|
||||||
""");
|
""");
|
||||||
|
Reference in New Issue
Block a user