Closed hamarb123 closed 3 years ago
Depending on how old your version of the code is, there should be a CompiledEval
class too. It's essentially identical to CompiledScript
except it returns a value.
Thank you! I didn't see it since it doesn't have a method on ScriptEngine
like CompiledScript
does.
Hi, @paulbartrum, I'm using the Nuget package, and it doesn't seem to have a CompiledEval
class.
You're right; I uploaded a new version to Nuget for you (version 3.2) :-)
Thank you!
Hi, I was wondering how I can get the return value of the evaluation of a
CompiledScript
class. I noticed that it usesGlobalMethodGenerator
, which supports a return value, but is internal, and its return value seems to just be discarded in theCompiledScript.Execute(ScriptEngine engine)
method. I was wondering if you could update the library to include variants ofEvaluate
inCompiledScript
like in theScriptEngine
class since it seems like it would require no internal changes and seems like a logical extension to me. The reason I want this is because I'm going to likely be evaluating the same script a lot of times in the same engine with possibly different global states, and want the return value, so rather than just callingScriptEngine.Evaluate(string)
every time, I'd like to cache the compilation. Thank you!