Description
JS_CompileFunction compiles a function from a text string, bytes , and associated it with a JS object, obj .name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to an array of names to assign each argument. The number of argument names should match the number of arguments specified in nargs .
bytes is the string containing the text of the function. length indicates the size of the text version of the function in bytes.
filename is the name of the file (or URL) containing the function. This information in messages if an error occurs during compilation. Similarly, lineno is used to report the line number of the function or file where an error occurred during compilation.
If a function compiles successfully, JS_CompileFunction returns a pointer to the function. Otherwise JS_CompileFunction returns NULL .
|