native delegate signature to be usable by scripting language
native function signature to be usable by scripting language
This class encapsulates all types of script functions including native D functions and delegates. A native function must first be wrapped in this class before it can be given to a ScriptAny assignment. When an object is created with "new FunctionName()" its __proto__ is assigned to the function's "prototype" field. This allows OOP in the scripting language and is analogous to JavaScript.
When a native function or delegate encounters an error with the arguments sent, the last reference parameter should be set to the appropriate enum value. A specific exception can be thrown by setting the flag to RETURN_VALUE_IS_EXCEPTION and returning a string.
This module implements the ScriptFunction class, which holds script defined functions as well as native D functions or delegates with the correct signature.