AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Entry:     JS_DecompileScript (Function)
Summary:     Creates the source code of a script from a script's compiled form.
Syntax:
JSString * JS_DecompileScript(JSContext *cx, JSScript *script,
const char *name, uintN indent);

     Argument     Type     Description
     cx     JSContext *     Pointer to a JS context.
                 
     script     JSScript *     Script to decompile.
                 
     name     const char *     Name to assign to the decompiled script.
                 
     indent     uintN     Number of spaces to use for indented code.
                 
Description:
JS_DecompileScript creates the source code version of a script from a script's compiled form, scriptname is the name you assign to the text version of the script; it is used only for debugging the source code version produced by this function.

If successful, JS_DecompileScript returns a string containing the source code of the script. Otherwise, it returns NULL. The source code generated by this function is accurate but lacks function declarations. In order to make it suitable for recompiling, you must edit the code to add the function declarations, or call JS_DecompileFunction on a compiled version of each function to generate the function declarations.


See also:
JS_CompileFile
JS_CompileScript
JS_DecompileFunction
JS_DestroyScript
JS_EvaluateScript
JS_ExecuteScript

[sh-index] Back to list of manuals