mildew.types.func

This module implements the ScriptFunction class, which holds script defined functions as well as native D functions or delegates with the correct signature.

Members

Aliases

NativeDelegate
alias NativeDelegate = ScriptAny delegate(Context, ScriptAny* thisObj, ScriptAny[] args, ref NativeFunctionError)

native delegate signature to be usable by scripting language

NativeFunction
alias NativeFunction = ScriptAny function(Context, ScriptAny* thisObj, ScriptAny[] args, ref NativeFunctionError)

native function signature to be usable by scripting language

Classes

ScriptFunction
class ScriptFunction

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.

Enums

NativeFunctionError
enum NativeFunctionError

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.

Meta