Packageweavejs.core
Classpublic class LinkableFunction
InheritanceLinkableFunction Inheritance LinkableString Inheritance LinkableVariable Inheritance CallbackCollection Inheritance Object

LinkableFunction allows a function to be defined by a String that can use macros defined in the static macros hash map. Libraries listed in macroLibraries variable will be included when compiling the function.



Public Properties
 PropertyDefined By
 InheritedcallbacksAreDelayed : Boolean
[read-only]
CallbackCollection
  debug : Boolean = false
[static] Debug mode.
LinkableFunction
 Inherited_linkableObject : ILinkableObject
CallbackCollection
 Inheritedlocked : Boolean
[read-only] This is set to true when lock() is called.
LinkableVariable
 Inheritedstate : Object
LinkableVariable
 InheritedtriggerCounter : uint
[read-only]
CallbackCollection
 Inheritedvalue : String
LinkableString
 InheritedwasDisposed : Boolean
[read-only] This flag becomes true after dispose() is called.
CallbackCollection
Protected Properties
 PropertyDefined By
 Inherited_bypassDiff : Boolean = true
If true, session states will be altered to bypass the diff calculation on DynamicState Arrays.
LinkableVariable
 Inherited_locked : Boolean = false
This is set to true when lock() is called.
LinkableVariable
 Inherited_preCallback : Function = null
This is the function that gets called immediately before every callback.
CallbackCollection
 Inherited_primitiveType : Boolean = false
This is true if the _sessionStateType is a primitive type.
LinkableVariable
 Inherited_sessionStateExternal : * = undefined
Available externally via getSessionState()
LinkableVariable
 Inherited_sessionStateInternal : * = undefined
Cannot be modified externally because it is not returned by getSessionState()
LinkableVariable
 Inherited_sessionStateType : Class = null
Type restriction passed in to the constructor.
LinkableVariable
 Inherited_sessionStateWasSet : Boolean = false
This is true if the session state has been set at least once.
LinkableVariable
 Inherited_verifier : Function = null
This function is used to prevent the session state from having unwanted values.
LinkableVariable
Public Methods
 MethodDefined By
  
LinkableFunction(defaultValue:String = null, ignoreRuntimeErrors:Boolean = false, paramNames:Array = null)
LinkableFunction
 Inherited
addDisposeCallback(relevantContext:Object, callback:Function, allowDelay:Boolean = false):void
CallbackCollection
 Inherited
addGroupedCallback(relevantContext:Object, groupedCallback:Function, triggerCallbackNow:Boolean = false, delayWhileBusy:Boolean = true):void
CallbackCollection
 Inherited
addImmediateCallback(relevantContext:Object, callback:Function, runCallbackNow:Boolean = false, alwaysCallLast:Boolean = false):void
CallbackCollection
  
apply(thisArg:* = null, argArray:Array = null):*
This will evaluate the function with the specified parameters.
LinkableFunction
  
call(thisArg:* = null, ... args):*
This will evaluate the function with the specified parameters.
LinkableFunction
 Inherited
CallbackCollection
 Inherited
This function may be called to detect change to a non-primitive session state in case it has been modified externally.
LinkableVariable
 Inherited
dispose():void
[override]
LinkableVariable
 Inherited
LinkableVariable
 Inherited
The type restriction passed in to the constructor.
LinkableVariable
 Inherited
lock():void
Call this function when you do not want to allow any more changes to the value of this sessioned property.
LinkableVariable
 Inherited
removeCallback(relevantContext:Object, callback:Function):void
CallbackCollection
 Inherited
CallbackCollection
 Inherited
setSessionState(value:Object):void
[override]
LinkableString
 Inherited
CallbackCollection
  
validate():void
This will attempt to compile the function.
LinkableFunction
 Inherited
verifyValue(value:Object):Boolean
This function will verify if a given value is a valid session state for this linkable variable.
LinkableVariable
Protected Methods
 MethodDefined By
 Inherited
_runCallbacksImmediately(... preCallbackParams):void
This function runs callbacks immediately, ignoring any delays.
CallbackCollection
 Inherited
sessionStateEquals(otherSessionState:*):Boolean
This function is used in setSessionState() to determine if the value has changed or not.
LinkableVariable
Public Constants
 ConstantDefined By
 InheritedDEFAULT_TRIGGER_COUNT : uint = 1
[static] This is the default value of triggerCounter.
CallbackCollection
 InheritedSTACK_TRACE_TRIGGER : String = This is the stack trace from when the callbacks were last triggered.
[static]
CallbackCollection
Property Detail
debugproperty
public static var debug:Boolean = false

Debug mode.

Constructor Detail
LinkableFunction()Constructor
public function LinkableFunction(defaultValue:String = null, ignoreRuntimeErrors:Boolean = false, paramNames:Array = null)

Parameters
defaultValue:String (default = null) — The default function definition.
 
ignoreRuntimeErrors:Boolean (default = false) — If this is true, errors thrown during evaluation of the function will be caught and values of undefined will be returned.
 
paramNames:Array (default = null) — When true, variable lookups will be evaluated as if the function were in the scope of the thisArg passed to the apply() function.
Method Detail
apply()method
public function apply(thisArg:* = null, argArray:Array = null):*

This will evaluate the function with the specified parameters.

Parameters

thisArg:* (default = null) — The value of 'this' to be used when evaluating the function.
 
argArray:Array (default = null) — An Array of arguments to be passed to the compiled function.

Returns
* — The result of evaluating the function.
call()method 
public function call(thisArg:* = null, ... args):*

This will evaluate the function with the specified parameters.

Parameters

thisArg:* (default = null) — The value of 'this' to be used when evaluating the function.
 
... args — Arguments to be passed to the compiled function.

Returns
* — The result of evaluating the function.
validate()method 
public function validate():void

This will attempt to compile the function. An Error will be thrown if this fails.