report runtime process aborts correctly (#5285)
authorAlex Lam S.L <alexlamsl@gmail.com>
Tue, 11 Jan 2022 01:12:01 +0000 (01:12 +0000)
committerGitHub <noreply@github.com>
Tue, 11 Jan 2022 01:12:01 +0000 (09:12 +0800)
test/sandbox.js

index f4a19bb..25e69e1 100644 (file)
@@ -300,7 +300,7 @@ function run_code_exec(code, toplevel, timeout) {
             details = vm.runInNewContext("(" + details + ")");
         } catch (e) {}
     } else if (!match) {
-        new Error("Script execution aborted.");
+        return new Error("Script execution aborted.");
     }
     if (!match) return details;
     var ex = new global[match[1]](match[2]);