Resolved more circular dependencies. Installed acorn-walk and imported it in RamCalculations using ES6 modules. Fixed bugs in stock market rework

This commit is contained in:
danielyxie
2019-05-06 18:01:06 -07:00
parent 8a5b6f6cbc
commit cdb5dfec62
34 changed files with 7246 additions and 305 deletions
+2 -6
View File
@@ -231,7 +231,7 @@ export class BaseServer {
if (fn === this.scripts[i].filename) {
let script = this.scripts[i];
script.code = code;
script.updateRamUsage();
script.updateRamUsage(this.scripts);
script.module = "";
ret.overwritten = true;
ret.success = true;
@@ -240,11 +240,7 @@ export class BaseServer {
}
//Otherwise, create a new script
const newScript = new Script();
newScript.filename = fn;
newScript.code = code;
newScript.updateRamUsage();
newScript.server = this.ip;
const newScript = new Script(fn, code, this.ip, this.scripts);
this.scripts.push(newScript);
ret.success = true;
return ret;