|
jshost
jshost executable
jshost executablehome > JSLibs > jshost - Descriptionjshost ( javascript host ) is a small executable file that run javascript programs. The main features are:
The binary executable file is less than 60KB LoadModule is enough, everything else can be added using dynamic loadable modules. Command line options
Compile-only. The script is compiled but not executed. This is useful to detect syntax errors. Run in unsafe-mode that is a kind of 'release mode'. In unsafe-mode, any runtime checks is avoid and warnings are not reported. This mode allow a better execution speed. Specifies the maximum memory usage of the script in megabytes. Specifies the number of allocated megabytes after which garbage collection is run. This is the frequency (in seconds) at witch the GarbageCollector may be launched (0 for disabled). This is a temporary option that allow to select function name naming. 0:default, 1:lowerCamelCase, 2:UpperCamelCase Exit code
If this last expression is a positive integer, its value is returned, in any other case, 0 is returned.
Global functions
Loads and initialize the specified module. Do not provide the file extension in moduleFileName. Global properties
The command-line arguments (given after command line options).
Is true if a break signal (ctrl-c, ...) has been sent to jshost. This event can be reset. Configuration objectjshost create a global _configuration object to provide other modules some useful informations like stdout access and unsafeMode flag. RemarksGenerated filename extensions are
Modules entry points signature are
Exemple (win32)extern "C" __declspec(dllexport) JSBool ModuleInit(JSContext *cx, JSObject *obj) {
InitFileClass(cx, obj);
InitDirectoryClass(cx, obj);
InitSocketClass(cx, obj);
InitErrorClass(cx, obj);
InitGlobal(cx, obj);
return JS_TRUE;
}
== Embedding JS scripts in your jshost binary ==
This can only be done at jshost compilation time.
# Checkout [http://code.google.com/p/jslibs/source/checkout jslibs sources]
# Save your embbeded script in the file _jslibs/src/jshost/embeddedBootstrapScript.js_
# [jslibsBuild Compile jslibs] (or only jshost if jslibs has already been compiled once)
|
Sign in to add a comment

Print( 'Unsafe mode: '+(underscore)configuration.unsafeMode, '\n' ); P.S. Submit eliminates real undescores(?)
I think undescores are used in wiki markups for italic. You can escape them using the back quote: `_`configuration