Added stuff to Script queue functionality..it's gonna get deleted anyways so w.e

This commit is contained in:
Daniel Xie 2016-11-25 16:08:04 -06:00
parent 00f8a31246
commit 320526ebb3
2 changed files with 5 additions and 1 deletions

@ -2,7 +2,6 @@
* Evaluates the Abstract Syntax Tree for Netscript * Evaluates the Abstract Syntax Tree for Netscript
* generated by the Parser class * generated by the Parser class
*/ */
function evaluate(exp, env) { function evaluate(exp, env) {
switch (exp.type) { switch (exp.type) {
case "num": case "num":

@ -112,6 +112,11 @@ Script.prototype.saveScript = function() {
} }
} }
Script.prototype.queueEvaluate = function(exp, env) {
var fooObj = functionObject(evaluate, this, [exp, env]);
this.functionQueue.push(fooObj);
}
/* Wrapper object that wraps a function with its arguments. /* Wrapper object that wraps a function with its arguments.
* These objects are pushed onto a Script object's function queue. * These objects are pushed onto a Script object's function queue.
* The functions can be called with the standard () operator * The functions can be called with the standard () operator