This exception is only thrown when using ScriptAny.checkValue. If checkValue is used to check arguments, the host
application running a script should catch this exception in addition to catching ScriptRuntimeException and
ScriptCompileException. Otherwise it makes sense to just use toValue after checking the type field of the ScriptAny
and setting the NativeFunctionError flag appropriately then returning ScriptAny.UNDEFINED.
This exception is only thrown when using ScriptAny.checkValue. If checkValue is used to check arguments, the host application running a script should catch this exception in addition to catching ScriptRuntimeException and ScriptCompileException. Otherwise it makes sense to just use toValue after checking the type field of the ScriptAny and setting the NativeFunctionError flag appropriately then returning ScriptAny.UNDEFINED.