mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
Refactor for ... in loops
This commit is contained in:
@@ -116,7 +116,7 @@ function startNetscript2Script(player: IPlayer, workerScript: WorkerScript): Pro
|
||||
};
|
||||
}
|
||||
|
||||
for (const prop in workerScript.env.vars) {
|
||||
for (const prop of Object.keys(workerScript.env.vars)) {
|
||||
if (typeof workerScript.env.vars[prop] !== "function") continue;
|
||||
workerScript.env.vars[prop] = wrap(prop, workerScript.env.vars[prop]);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ function startNetscript1Script(workerScript: WorkerScript): Promise<WorkerScript
|
||||
const interpreterInitialization = function (int: any, scope: any): void {
|
||||
//Add the Netscript environment
|
||||
const ns = NetscriptFunctions(workerScript);
|
||||
for (const name in ns) {
|
||||
for (const name of Object.keys(ns)) {
|
||||
const entry = ns[name];
|
||||
if (typeof entry === "function") {
|
||||
//Async functions need to be wrapped. See JS-Interpreter documentation
|
||||
|
||||
Reference in New Issue
Block a user