ADC Home > Reference Library > Reference > Carbon > Internet & Web > JavaScriptCore Framework Reference
|
JSBase.h |
Includes: | <stdbool.h> |
JSCheckScriptSyntax |
Checks for syntax errors in a string of JavaScript.
bool JSCheckScriptSyntax( JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef *exception);
ctx
script
sourceURL
startingLineNumber
exception
true if the script is syntactically correct, otherwise false.
JSEvaluateScript |
Evaluates a string of JavaScript.
JSValueRef JSEvaluateScript( JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef *exception);
ctx
script
thisObject
sourceURL
startingLineNumber
exception
The JSValue that results from evaluating script, or NULL if an exception is thrown.
JSGarbageCollect |
Performs a JavaScript garbage collection.
void JSGarbageCollect( JSContextRef ctx);
ctx
JavaScript values that are on the machine stack, in a register,
protected by JSValueProtect, set as the global object of an execution context,
or reachable from any such value will not be collected.
During JavaScript execution, you are not required to call this function; the
JavaScript engine will garbage collect as needed. One place you may want to call
this function, however, is after releasing the last reference to a JSGlobalContextRef.
At that point, a garbage collection can free the objects still referenced by the
JSGlobalContextRef's global object, along with the global object itself.
JSClassRef |
typedef struct OpaqueJSClass* JSClassRef;
A JavaScript class. Used with JSObjectMake to construct objects with custom behavior.
JSContextRef |
typedef const struct OpaqueJSContext* JSContextRef;
A JavaScript execution context. Holds the global object and other execution state.
JSGlobalContextRef |
typedef struct OpaqueJSContext* JSGlobalContextRef;
A global JavaScript execution context. A JSGlobalContext is a JSContext.
JSObjectRef |
typedef struct OpaqueJSValue* JSObjectRef;
A JavaScript object. A JSObject is a JSValue.
JSPropertyNameAccumulatorRef |
typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef;
An ordered set used to collect the names of a JavaScript object's properties.
JSPropertyNameArrayRef |
typedef struct OpaqueJSPropertyNameArray* JSPropertyNameArrayRef;
An array of JavaScript property names.
JSStringRef |
typedef struct OpaqueJSString* JSStringRef;
A UTF16 character buffer. The fundamental string representation in JavaScript.
JSValueRef |
typedef const struct OpaqueJSValue* JSValueRef;
A JavaScript value. The base type for all JavaScript values, and polymorphic functions on them.
|