Netscript reimplementation

This commit is contained in:
MrNuggelz
2017-06-28 11:47:42 +02:00
parent 38e1c77c5c
commit 0e14fe1632
9 changed files with 4482 additions and 1719 deletions
+6 -2
View File
@@ -1,8 +1,12 @@
/* Environment
* NetScript program environment
*/
function Environment(parent) {
this.vars = Object.create(parent ? parent.vars : null);
function Environment(workerScript,parent) {
if (parent){
this.vars = parent.vars;
} else {
this.vars = NetscriptFunctions(workerScript);
}
this.parent = parent;
this.stopFlag = false;
}