pub fn eval_source(arg: Option<&Value>, direct: bool) -> Result<Value, String>Expand description
eval(src). direct selects the scope the source runs in: a DIRECT eval —
the literal eval(...) call form — evaluates in the CALLER’s scope, every
other route to the same function value is an INDIRECT eval and evaluates in
the global scope (ECMA-262 19.2.1.1 PerformEval). The two are told apart in
host::call_named, which ops::CALL reaches and ops::CALL_VALUE/APPLY
do not.
A non-string argument is returned unchanged (19.2.1.1 step 2).