(function(JSUS) {
function EVAL(){}; |
|
¶ EVAL.evalAllows to execute the eval function within a given context. If no context is passed a reference, Params
str
string
The command to executes
context
object
Optional. The context of execution. Defaults,
this
Returns
mixed
The return value of the executed commands
See
eval
See
JSON.parse
|
EVAL.eval = function(str, context) {
var func;
if (!str) return;
context = context || this; |
Eval must be called indirectly i.e. eval.call is not possible |
func = function(str) { |
TODO: Filter str |
return eval(str);
}
return func.call(context, str);
};
JSUS.extend(EVAL);
})('undefined' !== typeof JSUS ? JSUS : module.parent.exports.JSUS);
|