Constructor
new L3D.Script()
Properties
= null
Used to globalally catch errors in scripts
= true
If true, script errors will be printed to the console.
Methods
static applyToConstructor(constructor, argArray, methods)
Given a constructor, it attaches several global arguments and methods
constructor |
* | |
argArray |
* | |
methods |
* |
static cleanCode(code)
Remove comments and trims empty lines
code |
* |
static computeLineFromError(error)
In case of error inside the scripts, tries to determine the error line (not as easy as it seems). Doesnt work in all cases.
error |
* |
static expandCode(code)
Adds some extra features to JS like:
- the use of private or public in variables.
code |
* |
static showCodeInConsole(code, errorLine)
Dumps all the code to the console
code |
* | |
errorLine |
* |
callMethod(name, argv, expandParameters, parentObject)
Execute a method with the given name and arguments.
name |
* | |
argv |
* | must be an array with parameters, unless skip_expand is true |
expandParameters |
* | |
parentObject |
* |
compile(argVars, saveContextVars)
Compiles the string, trys to keep the current state
argVars |
Object | |
saveContextVars |
* |
hasMethod(name) → bool
Does this script contains this method?
name |
String | The name of the method. |
- bool
True if the script has the method.