Revert "Gang rework"

This commit is contained in:
danielyxie
2018-10-23 13:47:00 -05:00
committed by GitHub
parent 25bbccca88
commit be0a08d70c
41 changed files with 1690 additions and 171071 deletions
+2 -12
View File
@@ -14,6 +14,7 @@ import {NetscriptPort} from "./NetscriptPort";
import {AllServers} from "./Server";
import {Settings} from "./Settings";
//TODO Maybe escodegen might be better?
import {generate} from 'escodegen';
import {parse, Node} from "../utils/acorn";
@@ -137,18 +138,7 @@ function startNetscript2Script(workerScript) {
throw workerScript;
}
runningFn = propName;
// If the function throws an error, clear the runningFn flag first, and then re-throw it
// This allows people to properly catch errors thrown by NS functions without getting
// the concurrent call error above
let result;
try {
result = f(...args);
} catch(e) {
runningFn = null;
throw(e);
}
let result = f(...args);
if (result && result.finally !== undefined) {
return result.finally(function () {
runningFn = null;