The C-level API
385
JSBool JS_ExecuteScript()
Usage
JS_ExecuteScript (JSContext *cx, JSObject *obj, unsigned short *script,
unsigned int sz, jsval *rval)
Description
Method; compiles and executes a JavaScript string. If the script generates a return value, it returns
in
*rval
.
Arguments
JSContext
*cx
,
JSObject
*obj
,
unsigned short *script
,
unsigned int
sz
,
jsval
*rval
•
The
cx
argument is the opaque
JSContext
pointer that passes to the JavaScript function.
•
The
obj
argument is a pointer to the object in whose context the script executes. While the
script is running, the
this
keyword is equal to this object. Usually this is the
JSObject
pointer
that passes to the JavaScript function.
•
The
script
argument is a string that contains JavaScript code. If the string size is not specified
(see the
sz
argument), the string must be null-terminated.
•
The
sz
argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated
string is computed automatically.
•
The
rval
argument is a pointer to a single
jsval
structure. The function’s return value is
stored in
*rval
.
Returns
A Boolean value:
JS_TRUE
indicates success;
JS_FALSE
indicates failure.
Содержание FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY
Страница 1: ...Flash JavaScript Dictionary ...
Страница 16: ...16 Contents ...
Страница 40: ...40 Chapter 2 Top level functions ...
Страница 368: ...368 Chapter 3 Objects ...
Страница 386: ...386 Chapter 4 C Level Extensibility ...