Constructs a new ScriptFunction out of a native D function.
Constructs a new ScriptFunction out of a native D delegate.
Constructor for functions created from compilation of statements.
Undocumented in source.
Undocumented in source.
The type of function held by the object
Property argNames. Note: native functions do not have this.
Binds a specific "this" to be used no matter what. Internal users of ScriptFunction such as mildew.vm.virtualmachine.VirtualMachine must manually check the boundThis property and set this up. Unbinding is done by passing UNDEFINED as the parameter.
bound this property. change with bind()
Property get closure
Property set closure
Compiled form (raw ubyte array)
ct property (currently null and unused)
ct property (settable but does nothing yet)
Generic copying for all functions
Method to copy fresh compiled functions with the correct environment
Returns the name of the function
Sets the function name
Property isClass
isGenerator property. used by various pieces
get the delegate only if it is one
get the native function ONLY if it is one
Compares two ScriptFunctions
Tests two ScriptFunctions for equality
Property statementNodes
Generates a hash from a ScriptFunction
Returns a string representing the type and name.
Returns the type of function stored, such as native function, delegate, or script function
Check if an object is an instance of a "class" constructor
name property
getters property
setters property
prototype property
prototype property (setter)
This property provides direct access to the dictionary
Add a getter. Getters should be added to a constructor function's "prototype" field
Add a setter. Setters should be added to a constructor function's "prototype" field
Looks up a field through the prototype chain. Note that this does not call any getters because it is not possible to pass an Environment to opIndex.
Shorthand for lookupField.
Comparison operator
opEquals
toHash
Assigns a field to the current object. This does not call any setters.
Determines if there is a getter for a given property
Determines if there is a setter for a given property
Find a getter in the prototype chain
Find a setter in the prototype chain
Shorthand for assignField
Returns a property descriptor without searching the prototype chain. The object returned is an object possibly containing get, set, or value fields.
Get all fields and properties for this object without searching the prototype chain.
Tests whether or not a property or field exists in this object without searching the __proto__ chain.
If a native object was stored inside this ScriptObject, it can be retrieved with this function. Note that one must always check that the return value isn't null because all functions can be called with invalid "this" objects using Function.prototype.call.
Native object can also be written because this is how binding works. Constructors receive a premade ScriptObject as the "this" with the name and prototype already set. Native D constructor functions have to set this property.
Returns a string with JSON like formatting representing the object's key-value pairs as well as any nested objects. In the future this will be replaced and an explicit function call will be required to print this detailed information.
The dictionary of key-value pairs
The lookup table for getters
The lookup table for setters
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.