|
Ultralight C API 1.4.0
|
Functions | |
| JS_EXPORT JSValueRef | JSEvaluateScript (JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef *exception) |
| Evaluates a string of JavaScript. | |
| JS_EXPORT bool | JSCheckScriptSyntax (JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef *exception) |
| Checks for syntax errors in a string of JavaScript. | |
| JS_EXPORT void | JSGarbageCollect (JSContextRef ctx) |
| Performs a JavaScript garbage collection. | |
Macros | |
| #define | __has_declspec_attribute(x) |
| #define | JS_EXPORT |
| #define | JSC_OBJC_API_ENABLED 0 |
Typedefs | |
| typedef const struct OpaqueJSContextGroup * | JSContextGroupRef |
| typedef const struct OpaqueJSContext * | JSContextRef |
| typedef struct OpaqueJSContext * | JSGlobalContextRef |
| typedef struct OpaqueJSString * | JSStringRef |
| typedef struct OpaqueJSClass * | JSClassRef |
| typedef struct OpaqueJSPropertyNameArray * | JSPropertyNameArrayRef |
| typedef struct OpaqueJSPropertyNameAccumulator * | JSPropertyNameAccumulatorRef |
| typedef void(*) | JSTypedArrayBytesDeallocator(void *bytes, void *deallocatorContext) |
| typedef const struct OpaqueJSValue * | JSValueRef |
| typedef struct OpaqueJSValue * | JSObjectRef |
| JS_EXPORT bool JSCheckScriptSyntax | ( | JSContextRef | ctx, |
| JSStringRef | script, | ||
| JSStringRef | sourceURL, | ||
| int | startingLineNumber, | ||
| JSValueRef * | exception ) |
Checks for syntax errors in a string of JavaScript.
| ctx | The execution context to use. |
| script | A JSString containing the script to check for syntax errors. |
| sourceURL | A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. |
| startingLineNumber | An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. |
| exception | A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception. |
| JS_EXPORT JSValueRef JSEvaluateScript | ( | JSContextRef | ctx, |
| JSStringRef | script, | ||
| JSObjectRef | thisObject, | ||
| JSStringRef | sourceURL, | ||
| int | startingLineNumber, | ||
| JSValueRef * | exception ) |
Evaluates a string of JavaScript.
| ctx | The execution context to use. |
| script | A JSString containing the script to evaluate. |
| thisObject | The object to use as "this," or NULL to use the global object as "this." |
| sourceURL | A JSString containing a URL for the script's source file. This is used by debuggers and when reporting exceptions. Pass NULL if you do not care to include source file information. |
| startingLineNumber | An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. |
| exception | A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. |
| JS_EXPORT void JSGarbageCollect | ( | JSContextRef | ctx | ) |
Performs a JavaScript garbage collection.
| ctx | The execution context to use. |
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. JavaScript values created within a context group are automatically destroyed when the last reference to the context group is released.
| #define __has_declspec_attribute | ( | x | ) |
| #define JS_EXPORT |
| #define JSC_OBJC_API_ENABLED 0 |
| typedef struct OpaqueJSClass* JSClassRef |
| typedef const struct OpaqueJSContextGroup* JSContextGroupRef |
| typedef const struct OpaqueJSContext* JSContextRef |
| typedef struct OpaqueJSContext* JSGlobalContextRef |
| typedef struct OpaqueJSValue* JSObjectRef |
| typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef |
| typedef struct OpaqueJSPropertyNameArray* JSPropertyNameArrayRef |
| typedef struct OpaqueJSString* JSStringRef |
| typedef void(*) JSTypedArrayBytesDeallocator(void *bytes, void *deallocatorContext) |
A function used to deallocate bytes passed to a Typed Array constructor. The function should take two arguments. The first is a pointer to the bytes that were originally passed to the Typed Array constructor. The second is a pointer to additional information desired at the time the bytes are to be freed.
| typedef const struct OpaqueJSValue* JSValueRef |