Function declaration string for eval

....
param = param.replace(re, "\\n"); // replace "\n" to "\\n"
var code_string = "function(scenario)\{\
    var MEM = scenario.Mem;\
    var Call = scenario._getvalue_from_c2fn;\
    return "+param+"\
    }";
_thisArg = this;
var fn = eval("("+code_string+")");
param = fn(this);
....

Reference


The variable space will be cleaned in this eval , in CocoonJS exporter.

No comments:

Post a Comment