back to wxjs 

wxjs

generated from ../src/engine/engine.cpp

wxjs is the global object of the JavaScript runtime. Each script is run with its own global object named script. This is done to make sure that variables don't polute the global object. The global object of the runtime can be reached by using 'wxjs' like in 'wxjs.print'. The script global object contains properties like 'root'.

Constants

Methods

exit

exit()
 

Exit the script

include

include(File, 
        Encoding = UTF-8) : Script
 
Name Type Default Description
File String The name of the file that contains the script
Encoding String UTF-8
include(Obj, 
        File, 
        Encoding = UTF-8)
 
Name Type Default Description
Obj Object Functions and variables are attached to this object
File String The name of the file that contains the script
Encoding String UTF-8

Executes the given script. It returns the SpiderMonkey build-in Script object. All local values defined in the script are properties of this script object. Variables that are defined without the 'var' keyword, are defined on the global object.
When the filename is relative, the file will be searched in the path of the current executed script.

namespace

namespace(Name)
 
Name Type Default Description
Name String A namespace

This method provides a way of using namespaces in JavaScript. A namespace is actually a simple Object instance. An hierarchy is defined using the dot in the names. For example: db.client will define the 'db' namespace and 'client' as the child namespace of 'db'. Be careful in the names used, because reserved keywords are not allowed.

print

print()
 

Use this function to print information to stdout. An example:


    var i = 1;
    print("Test: ", i);
   



SourceForge.net Logo Support This Project

Table of Contents

Methods

exit
include
namespace
print


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.