mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
Revert "Gang rework"
This commit is contained in:
+2
-12
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user