diff --git a/.prettierignore b/.prettierignore index 1ba37c91d..cf98afb3c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,4 +12,5 @@ emsdk-cache .output packages/internal-tsconfig/*.d.*ts packages/internal-tsconfig/*.*js -vendor \ No newline at end of file +vendor +CLAUDE.md \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 6ea843285..8c8be0dfe 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,45 +1,53 @@ { - "configurations": [ - { - "name": "Mac", - "includePath": [ - "${workspaceFolder}/**", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/system/include/**", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/**", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/llvm/lib/clang/15.0.0/include/**", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/SDL", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include/compat", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/llvm/lib/clang/15.0.0/include", - "/opt/homebrew/Cellar/emscripten/3.1.7/libexec/cache/sysroot/include" - ], - "defines": ["QTS_ASYNCIFY=1", "QTS_DEBUG_MODE=1", "__EMSCRIPTEN__=1"], - "macFrameworkPath": [ - "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" - ], - "compilerPath": "/usr/bin/clang", - "cStandard": "c17", - "cppStandard": "c++98", - "intelliSenseMode": "macos-clang-arm64", - "compilerArgs": [], - "mergeConfigurations": false, - "browse": { - "path": ["${workspaceFolder}/**"], - "limitSymbolsToIncludedHeaders": true - }, - "configurationProvider": "ms-vscode.makefile-tools" - }, - { - "name": "Emscripten", - "includePath": ["${workspaceFolder}/**"], - "defines": [], - "macFrameworkPath": [ - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - ], - "compilerPath": "/opt/homebrew/bin/emcc", - "cStandard": "c17", - "cppStandard": "c++98", - "intelliSenseMode": "macos-clang-arm64" - } - ], - "version": 4 -} + "configurations": [ + { + "name": "Mac", + "includePath": [ + "${workspaceFolder}/**", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/system/include/**", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/cache/sysroot/include/**", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/llvm/lib/clang/23/include/**", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/cache/sysroot/include/SDL", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/cache/sysroot/include/compat", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/llvm/lib/clang/23/include", + "/opt/homebrew/Cellar/emscripten/5.0.1/libexec/cache/sysroot/include" + ], + "defines": [ + "QTS_ASYNCIFY=1", + "QTS_DEBUG_MODE=1", + "__EMSCRIPTEN__=1" + ], + "macFrameworkPath": [ + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" + ], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++98", + "intelliSenseMode": "macos-clang-arm64", + "compilerArgs": [], + "mergeConfigurations": false, + "browse": { + "path": [ + "${workspaceFolder}/**" + ], + "limitSymbolsToIncludedHeaders": true + }, + "configurationProvider": "ms-vscode.makefile-tools" + }, + { + "name": "Emscripten", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "macFrameworkPath": [ + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + ], + "compilerPath": "/opt/homebrew/bin/emcc", + "cStandard": "c17", + "cppStandard": "c++98", + "intelliSenseMode": "macos-clang-arm64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d268c48ee..4678e141f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## v0.32.0 + +- [#227](https://github.com/justjake/quickjs-emscripten/pull/227) + + - Re-works function binding in `newFunction` to use a different proxying strategy based on a new abstraction, `HostRef`. HostRef allows tracking references of host values from guest handles. Once all references to the HostRef object are disposed (either in the host, or GC'd in the guest), the host value will be dereferenced and become garbage collectable. + - Functions passed to `newFunction` are interned in the runtime's `HostRefMap` until dereferenced. + - `HostRef` is also exposed directly for use from `QuickJSContext`, see `newHostRef`, `toHostRef`, `unwrapHostRef` in the docs. + - Added `QuickJSContext.newConstructorFunction`, such functions will have their `this` set to the newly constructed object, although they may also return a new object. + +- [#244](https://github.com/justjake/quickjs-emscripten/pull/244) Upgrade [quickjs-ng](https://github.com/quickjs-ng/quickjs) to [v0.12.1](https://github.com/quickjs-ng/quickjs/releases/tag/v0.12.1). +- [#243](https://github.com/justjake/quickjs-emscripten/pull/243) (thanks to @josh-) Upgrade [bellard/quickjs](https://github.com/bellard/quickjs) to [2025-09-13+f1139494](https://github.com/bellard/quickjs/commit/f1139494d18a2053630c5ed3384a42bb70db3c53). Review the [QuickJS changelog](https://github.com/bellard/quickjs/blob/f1139494d18a2053630c5ed3384a42bb70db3c53/Changelog) for details. + - Some intrinsics like `BigInt` are now always enabled. + - BigNum extension removed. +- [#242](https://github.com/justjake/quickjs-emscripten/pull/242) Upgrade to Emscripten 5.0.1. +- [#221](https://github.com/justjake/quickjs-emscripten/pull/221) (thanks to @melbourne2991) Support generator return values in QuickJSIterator. + ## v0.31.0 - [#137](https://github.com/justjake/quickjs-emscripten/pull/137) diff --git a/CLAUDE.md b/CLAUDE.md index 11d1e4d71..6a850c5c4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -57,3 +57,87 @@ Other test filters: - `scripts/generate.ts` - Generates FFI bindings and symbols - `templates/Variant.mk` - Makefile template for variants - `c/interface.c` - C interface to QuickJS exposed to JavaScript + +## QuickJS C API Tips + +### Value Ownership + +QuickJS has strict ownership semantics. Functions either "consume" (take ownership of) or "borrow" values: + +**Functions that CONSUME values (caller must NOT free afterward):** + +- `JS_DefinePropertyValue` - consumes `val` +- `JS_DefinePropertyValueStr` - consumes `val` +- `JS_DefinePropertyValueUint32` - consumes `val` +- `JS_SetPropertyValue` - consumes `val` +- `JS_SetPropertyStr` - consumes `val` +- `JS_Throw` - consumes the error value + +**Functions that DUP values internally (caller SHOULD free afterward):** + +- `JS_NewCFunctionData` - calls `JS_DupValue` on data values, so free your reference after +- `JS_SetProperty` - dups the value + +**Common double-free bug pattern:** + +```c +// WRONG - double free! +JSValue val = JS_NewString(ctx, "hello"); +JS_DefinePropertyValueStr(ctx, obj, "name", val, JS_PROP_CONFIGURABLE); +JS_FreeValue(ctx, val); // BUG: val was already consumed! + +// CORRECT +JSValue val = JS_NewString(ctx, "hello"); +JS_DefinePropertyValueStr(ctx, obj, "name", val, JS_PROP_CONFIGURABLE); +// No JS_FreeValue needed - value is consumed +``` + +### quickjs vs quickjs-ng Differences + +Some functions have different signatures between bellard/quickjs and quickjs-ng: + +```c +// bellard/quickjs - class ID is global +JS_NewClassID(&class_id); + +// quickjs-ng - class ID is per-runtime +JS_NewClassID(rt, &class_id); +``` + +Use `#ifdef QTS_USE_QUICKJS_NG` for compatibility: + +```c +#ifdef QTS_USE_QUICKJS_NG + JS_NewClassID(rt, &class_id); +#else + JS_NewClassID(&class_id); +#endif +``` + +### Class Registration + +- `JS_NewClassID` allocates a new class ID (only call once globally or per-runtime for ng) +- `JS_NewClass` registers the class definition with a runtime +- `JS_IsRegisteredClass` checks if a class is already registered with a runtime +- Class prototypes default to `JS_NULL` for new classes - set with `JS_SetClassProto` if needed + +### Disposal Order + +When disposing resources, order matters for finalizers: + +```typescript +// CORRECT: Free runtime first so GC finalizers can call back to JS +const rt = new Lifetime(ffi.QTS_NewRuntime(), undefined, (rt_ptr) => { + ffi.QTS_FreeRuntime(rt_ptr); // 1. Free runtime - runs GC finalizers + callbacks.deleteRuntime(rt_ptr); // 2. Then delete callbacks +}); +``` + +### GC and Prevent Corruption Assertions + +If you see assertions like: +- `Assertion failed: i != 0, at: quickjs.c, JS_FreeAtomStruct` - atom hash corruption (often double-free) +- `Assertion failed: list_empty(&rt->gc_obj_list)` - objects leaked +- `Assertion failed: p->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT` - memory corruption + +These usually indicate memory management bugs: double-frees, use-after-free, or missing frees. diff --git a/c/interface.c b/c/interface.c index 85ada074b..ff68294ab 100644 --- a/c/interface.c +++ b/c/interface.c @@ -94,6 +94,7 @@ void js_std_dump_error(JSContext *ctx); #define BorrowedHeapChar const char #define OwnedHeapChar char #define JSBorrowedChar const char +#define HostRefId int32_t /** * Signal to our FFI code generator that this function should be called @@ -116,7 +117,7 @@ void js_std_dump_error(JSContext *ctx); // Forward declarations for EM_JS callback functions // These are implemented via EM_JS macro but need forward declarations for C99 compliance #ifdef __EMSCRIPTEN__ -JSValue *qts_host_call_function(JSContext *ctx, JSValueConst *this_ptr, int argc, JSValueConst *argv, uint32_t magic_func_id); +JSValue *qts_host_call_function(JSContext *ctx, JSValueConst *this_ptr, int argc, JSValueConst *argv, int32_t host_ref_id); int qts_host_interrupt_handler(JSRuntime *rt); char *qts_host_load_module_source(JSRuntime *rt, JSContext *ctx, const char *module_name); char *qts_host_normalize_module(JSRuntime *rt, JSContext *ctx, const char *module_base_name, const char *module_name); @@ -279,6 +280,7 @@ EM_JS(void, set_asyncify_stack_size, (size_t size, size_t default_size), { /** * Set the stack size limit, in bytes. Set to 0 to disable. */ + void QTS_RuntimeSetMaxStackSize(JSRuntime *rt, size_t stack_size) { #ifdef QTS_ASYNCIFY set_asyncify_stack_size(stack_size, QTS_ASYNCIFY_DEFAULT_STACK_SIZE); @@ -311,6 +313,92 @@ JSValueConst *QTS_GetTrue() { return &QTS_True; } +// ---------------------------------------------------------------------------- +// HostRef - De-reference host value based on JSValue GC. +// Used for functions + +static JSClassID host_ref_class_id; +// todo: variant with mark callback + +typedef struct HostRef { + int32_t id; +} HostRef; + +#ifdef __EMSCRIPTEN__ +EM_JS(void, qts_host_ref_free, (JSRuntime *rt, int32_t id), { + // For now we don't allow for async freeHostRef. + const asyncify = undefined; + Module['callbacks']['freeHostRef'](asyncify, rt, id); +}); +#endif + +static void host_ref_finalizer(JSRuntime *rt, JSValue val) { + HostRef *hv = JS_GetOpaque(val, host_ref_class_id); + if (hv) { +#ifdef __EMSCRIPTEN__ + qts_host_ref_free(rt, hv->id); +#endif + js_free_rt(rt, hv); + } +} + +static JSClassDef host_ref_class = { + .class_name = "HostRef", + .finalizer = host_ref_finalizer, +}; + +static int host_ref_class_init(JSRuntime *rt) { + // Only allocate class ID once globally + if (host_ref_class_id == 0) { +#ifdef QTS_USE_QUICKJS_NG + JS_NewClassID(rt, &host_ref_class_id); +#else + JS_NewClassID(&host_ref_class_id); +#endif + } + // Register class with this runtime if not already registered + // JS_NewClass returns 0 on success, -1 if already registered (which is fine) + if (!JS_IsRegisteredClass(rt, host_ref_class_id)) { + return JS_NewClass(rt, host_ref_class_id, &host_ref_class); + } + return 0; +} + +static JSValue new_host_ref(JSContext *ctx, HostRefId id) { + HostRef *hv; + JSValue obj; + obj = JS_NewObjectClass(ctx, host_ref_class_id); + if (JS_IsException(obj)) { + return obj; + } + + hv = js_mallocz(ctx, sizeof(*hv)); + if (!hv) { + // js_mallocz returns NULL on failure and sets rt.exception to OutOfMemory + JS_FreeValue(ctx, obj); + return JS_EXCEPTION; + } + + hv->id = id; + JS_SetOpaque(obj, hv); + return obj; +} + +JSValue *QTS_NewHostRef(JSContext *ctx, HostRefId id) { + return jsvalue_to_heap(new_host_ref(ctx, id)); +} + +HostRefId QTS_GetHostRefId(JSValueConst *value) { + HostRef *hv = JS_GetOpaque(*value, host_ref_class_id); + if (hv) { + return hv->id; + } + return 0; +} + +// ---------------------------------------------------------------------------- +// Context & Runtime + /** * Standard FFI functions */ @@ -343,51 +431,63 @@ enum QTS_Intrinsic { }; JSContext *QTS_NewContext(JSRuntime *rt, IntrinsicsFlags intrinsics) { + JSContext *ctx; + if (intrinsics == 0) { - return JS_NewContext(rt); + ctx = JS_NewContext(rt); + if (ctx == NULL) { + return NULL; + } + } else { + ctx = JS_NewContextRaw(rt); + if (ctx == NULL) { + return NULL; + } + + if (intrinsics & QTS_Intrinsic_BaseObjects) { + JS_AddIntrinsicBaseObjects(ctx); + } + if (intrinsics & QTS_Intrinsic_Date) { + JS_AddIntrinsicDate(ctx); + } + if (intrinsics & QTS_Intrinsic_Eval) { + JS_AddIntrinsicEval(ctx); + } + #ifndef QTS_USE_QUICKJS_NG + if (intrinsics & QTS_Intrinsic_StringNormalize) { + JS_AddIntrinsicStringNormalize(ctx); + } + #endif + if (intrinsics & QTS_Intrinsic_RegExp) { + JS_AddIntrinsicRegExp(ctx); + } + if (intrinsics & QTS_Intrinsic_RegExpCompiler) { + JS_AddIntrinsicRegExpCompiler(ctx); + } + if (intrinsics & QTS_Intrinsic_JSON) { + JS_AddIntrinsicJSON(ctx); + } + if (intrinsics & QTS_Intrinsic_Proxy) { + JS_AddIntrinsicProxy(ctx); + } + if (intrinsics & QTS_Intrinsic_MapSet) { + JS_AddIntrinsicMapSet(ctx); + } + if (intrinsics & QTS_Intrinsic_TypedArrays) { + JS_AddIntrinsicTypedArrays(ctx); + } + if (intrinsics & QTS_Intrinsic_Promise) { + JS_AddIntrinsicPromise(ctx); + } + + // Note: BigInt is now always part of QuickJS core, no need for separate intrinsic } - JSContext *ctx = JS_NewContextRaw(rt); - if (ctx == NULL) { + if (host_ref_class_init(JS_GetRuntime(ctx)) != 0) { + JS_FreeContext(ctx); return NULL; } - if (intrinsics & QTS_Intrinsic_BaseObjects) { - JS_AddIntrinsicBaseObjects(ctx); - } - if (intrinsics & QTS_Intrinsic_Date) { - JS_AddIntrinsicDate(ctx); - } - if (intrinsics & QTS_Intrinsic_Eval) { - JS_AddIntrinsicEval(ctx); - } -#ifndef QTS_USE_QUICKJS_NG - if (intrinsics & QTS_Intrinsic_StringNormalize) { - JS_AddIntrinsicStringNormalize(ctx); - } -#endif - if (intrinsics & QTS_Intrinsic_RegExp) { - JS_AddIntrinsicRegExp(ctx); - } - if (intrinsics & QTS_Intrinsic_RegExpCompiler) { - JS_AddIntrinsicRegExpCompiler(ctx); - } - if (intrinsics & QTS_Intrinsic_JSON) { - JS_AddIntrinsicJSON(ctx); - } - if (intrinsics & QTS_Intrinsic_Proxy) { - JS_AddIntrinsicProxy(ctx); - } - if (intrinsics & QTS_Intrinsic_MapSet) { - JS_AddIntrinsicMapSet(ctx); - } - if (intrinsics & QTS_Intrinsic_TypedArrays) { - JS_AddIntrinsicTypedArrays(ctx); - } - if (intrinsics & QTS_Intrinsic_Promise) { - JS_AddIntrinsicPromise(ctx); - } - // Note: BigInt is now always part of QuickJS core, no need for separate intrinsic return ctx; } @@ -1042,9 +1142,6 @@ int QTS_BuildIsAsyncify() { #endif } -// ---------------------------------------------------------------------------- -// Module loading helpers - // ---------------------------------------------------------------------------- // C -> Host Callbacks // Note: inside EM_JS, we need to use ['...'] subscript syntax for accessing JS @@ -1054,19 +1151,25 @@ int QTS_BuildIsAsyncify() { // ------------------- // function: C -> Host #ifdef __EMSCRIPTEN__ -EM_JS(MaybeAsync(JSValue *), qts_host_call_function, (JSContext * ctx, JSValueConst *this_ptr, int argc, JSValueConst *argv, uint32_t magic_func_id), { +EM_JS(MaybeAsync(JSValue *), qts_host_call_function, (JSContext * ctx, JSValueConst *this_ptr, int argc, JSValueConst *argv, HostRefId host_ref_id), { #ifdef QTS_ASYNCIFY const asyncify = {['handleSleep'] : Asyncify.handleSleep}; #else const asyncify = undefined; #endif - return Module['callbacks']['callFunction'](asyncify, ctx, this_ptr, argc, argv, magic_func_id); + return Module['callbacks']['callFunction'](asyncify, ctx, this_ptr, argc, argv, host_ref_id); }); #endif // Function: QuickJS -> C -JSValue qts_call_function(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic) { - JSValue *result_ptr = qts_host_call_function(ctx, &this_val, argc, argv, magic); +JSValue qts_call_function(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic, JSValue *func_data) { + int32_t host_ref_id = 0; + HostRef *host_ref = JS_GetOpaque(*func_data, host_ref_class_id); + if (host_ref) { + host_ref_id = host_ref->id; + } + + JSValue *result_ptr = qts_host_call_function(ctx, &this_val, argc, argv, host_ref_id); if (result_ptr == NULL) { return JS_UNDEFINED; } @@ -1076,19 +1179,46 @@ JSValue qts_call_function(JSContext *ctx, JSValueConst this_val, int argc, JSVal } // Function: Host -> QuickJS -JSValue *QTS_NewFunction(JSContext *ctx, uint32_t func_id, const char *name) { +JSValue *QTS_NewFunction(JSContext *ctx, const char *name, int arg_length, bool is_constructor, HostRefId host_ref_id) { IF_DEBUG { char msg[LOG_LEN]; - snprintf(msg, LOG_LEN, "new_function(name: %s, magic: %d)", name, func_id); + snprintf(msg, LOG_LEN, "new_function(name: %s, length: %d, is_constructor: %d, host_ref_id: %d)", name, arg_length, is_constructor, host_ref_id); qts_log(msg); } - JSValue func_obj = JS_NewCFunctionMagic( + + JSValue host_ref = new_host_ref(ctx, host_ref_id); + if (JS_IsException(host_ref)) { + return jsvalue_to_heap(host_ref); + } + + JSValue func_obj = JS_NewCFunctionData( /* context */ ctx, - /* JSCFunctionMagic* */ &qts_call_function, - /* name */ name, - /* min argc */ 0, - /* function type */ JS_CFUNC_constructor_or_func_magic, - /* magic: fn id */ func_id); + /* JSCFunctionData* */ &qts_call_function, + /* fn.length */ 0, + /* magic */ 0, + /* data length */ 1, + /* data */ &host_ref + ); + JS_FreeValue(ctx, host_ref); + + if (JS_IsException(func_obj)) { + return jsvalue_to_heap(func_obj); + } + + if (name && strlen(name) > 0) { + JSValue name_val = JS_NewString(ctx, name); + if (JS_IsException(name_val)) { + JS_FreeValue(ctx, func_obj); + return jsvalue_to_heap(name_val); + } + // JS_DefinePropertyValueStr takes ownership of name_val and frees it + JS_DefinePropertyValueStr(ctx, func_obj, "name", name_val, JS_PROP_CONFIGURABLE); + } + + if (is_constructor) { + JS_SetConstructorBit(ctx, func_obj, is_constructor); + } + return jsvalue_to_heap(func_obj); } @@ -1124,6 +1254,8 @@ void QTS_RuntimeDisableInterruptHandler(JSRuntime *rt) { JS_SetInterruptHandler(rt, NULL, NULL); } +// ---------------------------------------------------------------------------- +// Module loading helpers // -------------------- // load module: C -> Host // TODO: a future version can support host returning JSModuleDef* directly; diff --git a/doc/@jitl/quickjs-ffi-types/exports.md b/doc/@jitl/quickjs-ffi-types/exports.md index 880f87859..0055c6301 100644 --- a/doc/@jitl/quickjs-ffi-types/exports.md +++ b/doc/@jitl/quickjs-ffi-types/exports.md @@ -84,7 +84,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L246) +[packages/quickjs-ffi-types/src/emscripten-types.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L253) *** @@ -145,7 +145,7 @@ State of a promise. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) *** @@ -536,7 +536,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) ## Functions @@ -569,7 +569,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) +[packages/quickjs-ffi-types/src/ffi-types.ts:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L141) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModule.md b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModule.md index 6ca46e910..d60f9b2d5 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModule.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModule.md @@ -49,7 +49,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -59,7 +59,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -79,7 +79,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -89,7 +89,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -99,7 +99,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -109,7 +109,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -119,7 +119,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -129,7 +129,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -149,7 +149,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -165,7 +165,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -181,7 +181,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -204,7 +204,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -222,7 +222,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -240,7 +240,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -273,7 +273,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -299,7 +299,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -317,7 +317,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -361,7 +361,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -385,7 +385,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -410,7 +410,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoader.md b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoader.md index 4192e3ac0..c62d98cc8 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoader.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoader.md @@ -22,7 +22,7 @@ ## Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L249) +[packages/quickjs-ffi-types/src/emscripten-types.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L256) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoaderOptions.md b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoaderOptions.md index f1159f51b..b141f720b 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoaderOptions.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoaderOptions.md @@ -35,7 +35,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -47,7 +47,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -69,7 +69,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -109,7 +109,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -129,7 +129,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncEmscriptenModule.md index 5236da5a1..9c357d86b 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncEmscriptenModule.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -83,7 +83,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -97,7 +97,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -111,7 +111,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -125,7 +125,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -153,7 +153,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -167,7 +167,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -181,7 +181,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -195,7 +195,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -205,7 +205,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L243) +[packages/quickjs-ffi-types/src/emscripten-types.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L250) *** @@ -219,7 +219,7 @@ Implement this field #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:242](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L242) +[packages/quickjs-ffi-types/src/emscripten-types.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L249) *** @@ -235,7 +235,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -251,7 +251,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -278,7 +278,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -300,7 +300,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -322,7 +322,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -359,7 +359,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -385,7 +385,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -407,7 +407,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -451,7 +451,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -475,7 +475,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -504,7 +504,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md index db50ca6ab..8efc808c6 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md @@ -41,6 +41,7 @@ library. - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSAsyncFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) @@ -64,6 +65,7 @@ library. - [QTS\_NewError](QuickJSAsyncFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSAsyncFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSAsyncFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSAsyncFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSAsyncFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSAsyncFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSAsyncFFI.md#qts-newpromisecapability) @@ -105,7 +107,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L39) +[packages/quickjs-ffi-types/src/ffi-async.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L40) *** @@ -125,7 +127,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) +[packages/quickjs-ffi-types/src/ffi-async.ts:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) *** @@ -139,7 +141,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) +[packages/quickjs-ffi-types/src/ffi-async.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) *** @@ -153,7 +155,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) *** @@ -167,7 +169,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) +[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) *** @@ -193,7 +195,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L173) +[packages/quickjs-ffi-types/src/ffi-async.ts:176](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L176) *** @@ -219,7 +221,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L180) +[packages/quickjs-ffi-types/src/ffi-async.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L183) *** @@ -253,7 +255,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L148) +[packages/quickjs-ffi-types/src/ffi-async.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L151) *** @@ -273,7 +275,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L188) +[packages/quickjs-ffi-types/src/ffi-async.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) *** @@ -293,7 +295,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L192) +[packages/quickjs-ffi-types/src/ffi-async.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) *** @@ -313,7 +315,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) +[packages/quickjs-ffi-types/src/ffi-async.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) *** @@ -341,7 +343,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L196) +[packages/quickjs-ffi-types/src/ffi-async.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L199) *** @@ -369,7 +371,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L204) +[packages/quickjs-ffi-types/src/ffi-async.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L207) *** @@ -391,7 +393,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L106) +[packages/quickjs-ffi-types/src/ffi-async.ts:109](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L109) *** @@ -413,7 +415,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L111) +[packages/quickjs-ffi-types/src/ffi-async.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L114) *** @@ -433,7 +435,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) +[packages/quickjs-ffi-types/src/ffi-async.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L63) *** @@ -451,7 +453,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) +[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -469,7 +471,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) +[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -489,7 +491,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) +[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -509,7 +511,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) +[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) *** @@ -529,7 +531,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) +[packages/quickjs-ffi-types/src/ffi-async.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L62) *** @@ -549,7 +551,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L83) +[packages/quickjs-ffi-types/src/ffi-async.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) *** @@ -569,7 +571,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L87) +[packages/quickjs-ffi-types/src/ffi-async.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) *** @@ -587,7 +589,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -601,7 +603,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) +[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -621,7 +623,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) +[packages/quickjs-ffi-types/src/ffi-async.ts:80](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L80) *** @@ -639,7 +641,25 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) +[packages/quickjs-ffi-types/src/ffi-async.ts:234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L234) + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`HostRefId` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-async.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -661,7 +681,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L220) +[packages/quickjs-ffi-types/src/ffi-async.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L223) *** @@ -681,7 +701,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:212](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L212) +[packages/quickjs-ffi-types/src/ffi-async.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L215) *** @@ -695,7 +715,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) +[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -721,7 +741,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L159) +[packages/quickjs-ffi-types/src/ffi-async.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L162) *** @@ -747,7 +767,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L166) +[packages/quickjs-ffi-types/src/ffi-async.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L169) *** @@ -769,7 +789,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L116) +[packages/quickjs-ffi-types/src/ffi-async.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L119) *** @@ -791,7 +811,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L126) +[packages/quickjs-ffi-types/src/ffi-async.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L129) *** @@ -813,7 +833,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L131) +[packages/quickjs-ffi-types/src/ffi-async.ts:134](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L134) *** @@ -835,7 +855,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L121) +[packages/quickjs-ffi-types/src/ffi-async.ts:124](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L124) *** @@ -855,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) +[packages/quickjs-ffi-types/src/ffi-async.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) *** @@ -875,7 +895,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L96) +[packages/quickjs-ffi-types/src/ffi-async.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) *** @@ -895,7 +915,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L100) +[packages/quickjs-ffi-types/src/ffi-async.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) *** @@ -909,7 +929,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) +[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -923,7 +943,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) +[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -947,7 +967,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L225) +[packages/quickjs-ffi-types/src/ffi-async.ts:228](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L228) *** @@ -967,7 +987,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) +[packages/quickjs-ffi-types/src/ffi-async.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L107) *** @@ -985,7 +1005,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) +[packages/quickjs-ffi-types/src/ffi-async.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L108) *** @@ -1003,7 +1023,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) +[packages/quickjs-ffi-types/src/ffi-async.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L73) *** @@ -1025,7 +1045,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L71) +[packages/quickjs-ffi-types/src/ffi-async.ts:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L74) *** @@ -1045,7 +1065,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) +[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -1063,7 +1083,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) +[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1083,29 +1103,53 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) +[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) +[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +[packages/quickjs-ffi-types/src/ffi-async.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -1123,7 +1167,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) +[packages/quickjs-ffi-types/src/ffi-async.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L68) *** @@ -1143,7 +1187,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L66) +[packages/quickjs-ffi-types/src/ffi-async.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) *** @@ -1163,7 +1207,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:232](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L232) +[packages/quickjs-ffi-types/src/ffi-async.ts:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) *** @@ -1177,7 +1221,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) +[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -1197,7 +1241,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) +[packages/quickjs-ffi-types/src/ffi-async.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L81) *** @@ -1219,7 +1263,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L91) +[packages/quickjs-ffi-types/src/ffi-async.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L94) *** @@ -1239,7 +1283,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:240](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L240) +[packages/quickjs-ffi-types/src/ffi-async.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) *** @@ -1259,7 +1303,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:236](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L236) +[packages/quickjs-ffi-types/src/ffi-async.ts:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) *** @@ -1273,7 +1317,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) +[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -1293,7 +1337,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) +[packages/quickjs-ffi-types/src/ffi-async.ts:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L190) *** @@ -1313,7 +1357,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) +[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1331,7 +1375,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L264) *** @@ -1349,7 +1393,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:257](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L257) +[packages/quickjs-ffi-types/src/ffi-async.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L266) *** @@ -1367,7 +1411,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) +[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -1385,7 +1429,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:263](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L263) *** @@ -1405,7 +1449,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) +[packages/quickjs-ffi-types/src/ffi-async.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L265) *** @@ -1425,7 +1469,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) +[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) *** @@ -1445,7 +1489,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) +[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1465,7 +1509,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) *** @@ -1489,7 +1533,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L136) +[packages/quickjs-ffi-types/src/ffi-async.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L139) *** @@ -1513,7 +1557,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:142](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L142) +[packages/quickjs-ffi-types/src/ffi-async.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L145) *** @@ -1531,7 +1575,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -1551,7 +1595,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) +[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1571,7 +1615,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L216) +[packages/quickjs-ffi-types/src/ffi-async.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) *** @@ -1591,7 +1635,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:262](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L262) +[packages/quickjs-ffi-types/src/ffi-async.ts:271](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L271) *** @@ -1611,7 +1655,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:258](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L258) +[packages/quickjs-ffi-types/src/ffi-async.ts:267](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L267) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSEmscriptenModule.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSEmscriptenModule.md index 84d6d2d0a..20ee3c107 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSEmscriptenModule.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -83,7 +83,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -97,7 +97,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -111,7 +111,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -125,7 +125,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -153,7 +153,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -167,7 +167,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -181,7 +181,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -195,7 +195,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -205,7 +205,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:237](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L237) +[packages/quickjs-ffi-types/src/emscripten-types.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L244) *** @@ -215,7 +215,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:236](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L236) +[packages/quickjs-ffi-types/src/emscripten-types.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L243) *** @@ -231,7 +231,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -247,7 +247,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -274,7 +274,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -296,7 +296,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -318,7 +318,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -355,7 +355,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -381,7 +381,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -403,7 +403,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -447,7 +447,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -471,7 +471,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -500,7 +500,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md index eb92840e1..cfc55dbb1 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md @@ -37,6 +37,7 @@ library. - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) @@ -56,6 +57,7 @@ library. - [QTS\_NewError](QuickJSFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSFFI.md#qts-newpromisecapability) @@ -96,7 +98,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) +[packages/quickjs-ffi-types/src/ffi.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L39) *** @@ -116,7 +118,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) +[packages/quickjs-ffi-types/src/ffi.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) *** @@ -130,7 +132,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) +[packages/quickjs-ffi-types/src/ffi.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) *** @@ -144,7 +146,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -158,7 +160,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) +[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -184,7 +186,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) +[packages/quickjs-ffi-types/src/ffi.ts:143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L143) *** @@ -218,7 +220,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) +[packages/quickjs-ffi-types/src/ffi.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L125) *** @@ -238,7 +240,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) +[packages/quickjs-ffi-types/src/ffi.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) *** @@ -258,7 +260,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) +[packages/quickjs-ffi-types/src/ffi.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) *** @@ -286,7 +288,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) +[packages/quickjs-ffi-types/src/ffi.ts:155](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L155) *** @@ -308,7 +310,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) +[packages/quickjs-ffi-types/src/ffi.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L104) *** @@ -328,7 +330,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) +[packages/quickjs-ffi-types/src/ffi.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L62) *** @@ -346,7 +348,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -364,7 +366,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) +[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -384,7 +386,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -404,7 +406,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) +[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -424,7 +426,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) +[packages/quickjs-ffi-types/src/ffi.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L61) *** @@ -444,7 +446,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) +[packages/quickjs-ffi-types/src/ffi.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) *** @@ -464,7 +466,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) +[packages/quickjs-ffi-types/src/ffi.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) *** @@ -482,7 +484,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -496,7 +498,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) +[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -516,7 +518,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) +[packages/quickjs-ffi-types/src/ffi.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L79) *** @@ -534,7 +536,25 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) +[packages/quickjs-ffi-types/src/ffi.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L182) + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`HostRefId` + +#### Source + +[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -556,7 +576,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L168) +[packages/quickjs-ffi-types/src/ffi.ts:171](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L171) *** @@ -576,7 +596,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) +[packages/quickjs-ffi-types/src/ffi.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) *** @@ -590,7 +610,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) +[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -616,7 +636,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L133) +[packages/quickjs-ffi-types/src/ffi.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L136) *** @@ -638,7 +658,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) +[packages/quickjs-ffi-types/src/ffi.ts:109](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L109) *** @@ -660,7 +680,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L111) +[packages/quickjs-ffi-types/src/ffi.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L114) *** @@ -680,7 +700,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) +[packages/quickjs-ffi-types/src/ffi.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) *** @@ -700,7 +720,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) +[packages/quickjs-ffi-types/src/ffi.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) *** @@ -714,7 +734,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) +[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -728,7 +748,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) +[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -752,7 +772,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L173) +[packages/quickjs-ffi-types/src/ffi.ts:176](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L176) *** @@ -772,7 +792,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) +[packages/quickjs-ffi-types/src/ffi.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L102) *** @@ -790,7 +810,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) +[packages/quickjs-ffi-types/src/ffi.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L103) *** @@ -808,7 +828,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) +[packages/quickjs-ffi-types/src/ffi.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L72) *** @@ -830,7 +850,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) +[packages/quickjs-ffi-types/src/ffi.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L73) *** @@ -850,7 +870,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) +[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -868,7 +888,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) +[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -888,29 +908,53 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) +[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -928,7 +972,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) +[packages/quickjs-ffi-types/src/ffi.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L67) *** @@ -948,7 +992,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) +[packages/quickjs-ffi-types/src/ffi.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) *** @@ -968,7 +1012,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) +[packages/quickjs-ffi-types/src/ffi.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) *** @@ -982,7 +1026,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) +[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -1002,7 +1046,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) +[packages/quickjs-ffi-types/src/ffi.ts:80](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L80) *** @@ -1024,7 +1068,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) +[packages/quickjs-ffi-types/src/ffi.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L93) *** @@ -1044,7 +1088,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) +[packages/quickjs-ffi-types/src/ffi.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) *** @@ -1064,7 +1108,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) +[packages/quickjs-ffi-types/src/ffi.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) *** @@ -1078,7 +1122,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) +[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -1098,7 +1142,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) +[packages/quickjs-ffi-types/src/ffi.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L150) *** @@ -1118,7 +1162,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) +[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1136,7 +1180,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:212](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L212) *** @@ -1154,7 +1198,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) +[packages/quickjs-ffi-types/src/ffi.ts:214](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L214) *** @@ -1172,7 +1216,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) +[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -1190,7 +1234,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L211) *** @@ -1210,7 +1254,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) +[packages/quickjs-ffi-types/src/ffi.ts:213](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L213) *** @@ -1230,7 +1274,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) +[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) *** @@ -1250,7 +1294,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1270,7 +1314,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -1294,7 +1338,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) +[packages/quickjs-ffi-types/src/ffi.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L119) *** @@ -1312,7 +1356,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -1332,7 +1376,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -1352,7 +1396,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) +[packages/quickjs-ffi-types/src/ffi.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L167) *** @@ -1372,7 +1416,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) +[packages/quickjs-ffi-types/src/ffi.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L219) *** @@ -1392,7 +1436,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L206) +[packages/quickjs-ffi-types/src/ffi.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L215) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/SourceMapData.md b/doc/@jitl/quickjs-ffi-types/interfaces/SourceMapData.md index 5e00f16e2..1214491cb 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/SourceMapData.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/SourceMapData.md @@ -22,7 +22,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L58) +[packages/quickjs-ffi-types/src/emscripten-types.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L59) *** @@ -32,7 +32,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L57) +[packages/quickjs-ffi-types/src/emscripten-types.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L58) *** @@ -42,7 +42,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L56) +[packages/quickjs-ffi-types/src/emscripten-types.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L57) *** @@ -52,7 +52,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L55) +[packages/quickjs-ffi-types/src/emscripten-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L56) *** diff --git a/doc/quickjs-emscripten-core/classes/Lifetime.md b/doc/quickjs-emscripten-core/classes/Lifetime.md index c88e8f5a9..a5597c673 100644 --- a/doc/quickjs-emscripten-core/classes/Lifetime.md +++ b/doc/quickjs-emscripten-core/classes/Lifetime.md @@ -32,6 +32,7 @@ Typically, quickjs-emscripten uses Lifetimes to protect C memory pointers. - [value](Lifetime.md#value) - [Methods](Lifetime.md#methods) - [`[dispose]`()](Lifetime.md#dispose) + - [assertAlive()](Lifetime.md#assertalive) - [consume()](Lifetime.md#consume) - [dispose()](Lifetime.md#dispose) - [dup()](Lifetime.md#dup) @@ -258,6 +259,20 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index 754d4bc92..5fae5fcc7 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -54,8 +54,11 @@ host functions as though they were synchronous. - [newArrayBuffer()](QuickJSAsyncContext.md#newarraybuffer) - [newAsyncifiedFunction()](QuickJSAsyncContext.md#newasyncifiedfunction) - [newBigInt()](QuickJSAsyncContext.md#newbigint) + - [newConstructorFunction()](QuickJSAsyncContext.md#newconstructorfunction) - [newError()](QuickJSAsyncContext.md#newerror) - [newFunction()](QuickJSAsyncContext.md#newfunction) + - [newFunctionWithOptions()](QuickJSAsyncContext.md#newfunctionwithoptions) + - [newHostRef()](QuickJSAsyncContext.md#newhostref) - [newNumber()](QuickJSAsyncContext.md#newnumber) - [newObject()](QuickJSAsyncContext.md#newobject) - [newPromise()](QuickJSAsyncContext.md#newpromise) @@ -68,7 +71,9 @@ host functions as though they were synchronous. - [setProp()](QuickJSAsyncContext.md#setprop) - [success()](QuickJSAsyncContext.md#success) - [throw()](QuickJSAsyncContext.md#throw) + - [toHostRef()](QuickJSAsyncContext.md#tohostref) - [typeof()](QuickJSAsyncContext.md#typeof) + - [unwrapHostRef()](QuickJSAsyncContext.md#unwraphostref) - [unwrapResult()](QuickJSAsyncContext.md#unwrapresult) ## Extends @@ -112,7 +117,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L224) +[packages/quickjs-emscripten-core/src/context.ts:233](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L233) ## Properties @@ -146,7 +151,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L255) +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -162,7 +167,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:313](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L313) +[packages/quickjs-emscripten-core/src/context.ts:322](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L322) *** @@ -180,7 +185,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L328) +[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) *** @@ -196,7 +201,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:287](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L287) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -212,7 +217,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:300](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L300) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -228,7 +233,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) ## Methods @@ -298,7 +303,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1059](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1059) +[packages/quickjs-emscripten-core/src/context.ts:1180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1180) #### callFunction(func, thisVal, args) @@ -322,7 +327,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1064](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1064) +[packages/quickjs-emscripten-core/src/context.ts:1185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1185) *** @@ -356,7 +361,7 @@ value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1113) +[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) *** @@ -389,7 +394,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1530](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1530) *** @@ -420,7 +425,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1000](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1000) +[packages/quickjs-emscripten-core/src/context.ts:1121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1121) *** @@ -445,7 +450,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L265) +[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) *** @@ -471,7 +476,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) +[packages/quickjs-emscripten-core/src/context.ts:1355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1355) *** @@ -505,7 +510,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) +[packages/quickjs-emscripten-core/src/context.ts:1513](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1513) *** @@ -532,7 +537,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) +[packages/quickjs-emscripten-core/src/context.ts:932](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L932) *** @@ -595,7 +600,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1156](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1156) +[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) *** @@ -643,7 +648,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) +[packages/quickjs-emscripten-core/src/context.ts:1539](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1539) *** @@ -667,7 +672,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:690](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L690) +[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) *** @@ -691,7 +696,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) +[packages/quickjs-emscripten-core/src/context.ts:802](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L802) *** @@ -727,7 +732,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1081](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1081) *** @@ -762,7 +767,7 @@ a number if the handle has a numeric length property, otherwise `undefined`. #### Source -[packages/quickjs-emscripten-core/src/context.ts:870](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L870) +[packages/quickjs-emscripten-core/src/context.ts:991](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L991) *** @@ -788,7 +793,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:652](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L652) +[packages/quickjs-emscripten-core/src/context.ts:773](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L773) *** @@ -842,7 +847,7 @@ QuickJSEmptyGetOwnPropertyNames if no options are set. #### Source -[packages/quickjs-emscripten-core/src/context.ts:907](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L907) +[packages/quickjs-emscripten-core/src/context.ts:1028](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1028) *** @@ -876,7 +881,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:715](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L715) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -906,7 +911,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:840](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L840) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -930,7 +935,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:660](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L660) +[packages/quickjs-emscripten-core/src/context.ts:781](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L781) *** @@ -955,7 +960,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:669](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L669) +[packages/quickjs-emscripten-core/src/context.ts:790](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L790) *** @@ -979,7 +984,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:388](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L388) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -1000,7 +1005,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:430](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L430) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -1024,7 +1029,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:438](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L438) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) *** @@ -1080,7 +1085,56 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:396](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L396) +[packages/quickjs-emscripten-core/src/context.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L405) + +*** + +### newConstructorFunction() + +#### newConstructorFunction(fn) + +> **newConstructorFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Convert a Javascript function into a QuickJS constructor function. +See [newFunction](QuickJSAsyncContext.md#newfunction) for more details. + +##### Parameters + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.newConstructorFunction`](QuickJSContext.md#newconstructorfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:635](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L635) + +#### newConstructorFunction(name, fn) + +> **newConstructorFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.newConstructorFunction`](QuickJSContext.md#newconstructorfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:636](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L636) *** @@ -1108,7 +1162,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:679](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L679) #### newError(message) @@ -1128,7 +1182,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) #### newError(undefined) @@ -1144,13 +1198,15 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) +[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) *** ### newFunction() -> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) +#### newFunction(fn) + +> **newFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) Convert a Javascript function into a QuickJS function value. See [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) for more details. @@ -1159,6 +1215,8 @@ A [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) sho value. A VmFunctionImplementation should also not retain any references to its return value. +For constructors (functions that will be called with `new ...`), use [newConstructorFunction](QuickJSAsyncContext.md#newconstructorfunction). + The function argument handles are automatically disposed when the function returns. If you want to retain a handle beyond the end of the function, you can call [Lifetime#dup](Lifetime.md#dup) to create a copy of the handle that you own @@ -1245,23 +1303,110 @@ someNativeAsyncFunction().then(deferred.resolve) return deferred.handle ``` -#### Parameters +##### Parameters -• **name**: `string` +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:612](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L612) + +#### newFunction(name, fn) + +> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` • **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:613](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L613) + +*** + +### newFunctionWithOptions() + +> **newFunctionWithOptions**(`args`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Lower-level API for creating functions. +See [newFunction](QuickJSAsyncContext.md#newfunction) for more details on how to use functions. + +#### Parameters + +• **args**: `Object` + +• **args\.fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +• **args\.isConstructor**: `boolean` + +• **args\.length**: `number` + +• **args\.name**: `undefined` \| `string` + #### Returns [`QuickJSHandle`](../exports.md#quickjshandle) #### Inherited from -[`quickjs-emscripten-core.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) +[`quickjs-emscripten-core.QuickJSContext.newFunctionWithOptions`](QuickJSContext.md#newfunctionwithoptions) #### Source -[packages/quickjs-emscripten-core/src/context.ts:601](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L601) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) + +*** + +### newHostRef() + +> **newHostRef**\<`T`\>(`value`): `HostRef`\<`T`\> + +Create an opaque handle object that stores a reference to a host JavaScript object. + +The guest cannot access the host object directly, but you may use +getHostRef to convert a HostRef handle back into a HostRef`` from +inside a function implementation. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **value**: `T` + +#### Returns + +`HostRef`\<`T`\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.newHostRef`](QuickJSContext.md#newhostref) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -1285,7 +1430,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:347](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L347) +[packages/quickjs-emscripten-core/src/context.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L356) *** @@ -1312,7 +1457,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L416) +[packages/quickjs-emscripten-core/src/context.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L425) *** @@ -1337,7 +1482,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L451) +[packages/quickjs-emscripten-core/src/context.ts:460](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L460) #### newPromise(promise) @@ -1363,7 +1508,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:459](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L459) +[packages/quickjs-emscripten-core/src/context.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L468) #### newPromise(newPromiseFn) @@ -1388,7 +1533,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:466](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L466) +[packages/quickjs-emscripten-core/src/context.ts:475](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L475) *** @@ -1412,7 +1557,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L354) +[packages/quickjs-emscripten-core/src/context.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L363) *** @@ -1437,7 +1582,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:377](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L377) +[packages/quickjs-emscripten-core/src/context.ts:386](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L386) *** @@ -1462,7 +1607,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:365](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L365) +[packages/quickjs-emscripten-core/src/context.ts:374](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L374) *** @@ -1494,7 +1639,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:754](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L754) +[packages/quickjs-emscripten-core/src/context.ts:875](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L875) *** @@ -1521,7 +1666,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:819](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L819) +[packages/quickjs-emscripten-core/src/context.ts:940](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L940) *** @@ -1548,7 +1693,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:827](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L827) +[packages/quickjs-emscripten-core/src/context.ts:948](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L948) *** @@ -1585,7 +1730,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:985](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L985) +[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1611,7 +1756,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) +[packages/quickjs-emscripten-core/src/context.ts:1535](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1535) *** @@ -1635,7 +1780,37 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1193) +[packages/quickjs-emscripten-core/src/context.ts:1314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1314) + +*** + +### toHostRef() + +> **toHostRef**\<`T`\>(`handle`): `undefined` \| `HostRef`\<`T`\> + +If `handle` is a `HostRef.handle`, return a new `HostRef` instance wrapping the handle. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `HostRef`\<`T`\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.toHostRef`](QuickJSContext.md#tohostref) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:732](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L732) *** @@ -1663,7 +1838,39 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:643](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L643) +[packages/quickjs-emscripten-core/src/context.ts:764](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L764) + +*** + +### unwrapHostRef() + +> **unwrapHostRef**\<`T`\>(`handle`): `T` + +If `handle` is a `HostRef.handle`, return the host value `T`. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`T` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.unwrapHostRef`](QuickJSContext.md#unwraphostref) + +#### Throws + +QuickJSHostRefInvalid if `handle` is not a `HostRef.handle` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:747](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L747) *** @@ -1694,7 +1901,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) +[packages/quickjs-emscripten-core/src/context.ts:1398](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1398) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md index d6c4945f1..e20bdd5fa 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md @@ -96,7 +96,7 @@ false after the object has been [dispose](QuickJSAsyncRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[packages/quickjs-emscripten-core/src/runtime.ts:128](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L128) ## Methods @@ -144,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) +[packages/quickjs-emscripten-core/src/runtime.ts:330](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L330) *** @@ -168,7 +168,7 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSAsyncRuntime #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) +[packages/quickjs-emscripten-core/src/runtime.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L299) *** @@ -195,7 +195,7 @@ manipulation if debug logging is disabled. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L363) +[packages/quickjs-emscripten-core/src/runtime.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L366) *** @@ -215,7 +215,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) +[packages/quickjs-emscripten-core/src/runtime.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L132) *** @@ -236,7 +236,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSAsy #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) +[packages/quickjs-emscripten-core/src/runtime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L310) *** @@ -274,7 +274,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) +[packages/quickjs-emscripten-core/src/runtime.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L246) *** @@ -297,7 +297,7 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) +[packages/quickjs-emscripten-core/src/runtime.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L197) *** @@ -317,7 +317,7 @@ true if debug logging is enabled #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L353) +[packages/quickjs-emscripten-core/src/runtime.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L356) *** @@ -366,7 +366,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) +[packages/quickjs-emscripten-core/src/runtime.ts:222](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L222) *** @@ -386,7 +386,7 @@ Remove the the loader set by [setModuleLoader](QuickJSAsyncRuntime.md#setmodulel #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) +[packages/quickjs-emscripten-core/src/runtime.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L184) *** @@ -413,7 +413,7 @@ code. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L343) +[packages/quickjs-emscripten-core/src/runtime.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L346) *** @@ -441,7 +441,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSAsyncR #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) +[packages/quickjs-emscripten-core/src/runtime.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L210) *** @@ -494,7 +494,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) +[packages/quickjs-emscripten-core/src/runtime.ts:284](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L284) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncWASMModule.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncWASMModule.md index 1ef31647f..c13cc25ab 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncWASMModule.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncWASMModule.md @@ -104,7 +104,7 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) +[packages/quickjs-emscripten-core/src/module.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L441) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index bf3f1ad76..848fc634a 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -77,8 +77,11 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [newArray()](QuickJSContext.md#newarray) - [newArrayBuffer()](QuickJSContext.md#newarraybuffer) - [newBigInt()](QuickJSContext.md#newbigint) + - [newConstructorFunction()](QuickJSContext.md#newconstructorfunction) - [newError()](QuickJSContext.md#newerror) - [newFunction()](QuickJSContext.md#newfunction) + - [newFunctionWithOptions()](QuickJSContext.md#newfunctionwithoptions) + - [newHostRef()](QuickJSContext.md#newhostref) - [newNumber()](QuickJSContext.md#newnumber) - [newObject()](QuickJSContext.md#newobject) - [newPromise()](QuickJSContext.md#newpromise) @@ -91,7 +94,9 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [setProp()](QuickJSContext.md#setprop) - [success()](QuickJSContext.md#success) - [throw()](QuickJSContext.md#throw) + - [toHostRef()](QuickJSContext.md#tohostref) - [typeof()](QuickJSContext.md#typeof) + - [unwrapHostRef()](QuickJSContext.md#unwraphostref) - [unwrapResult()](QuickJSContext.md#unwrapresult) ## Extends @@ -140,7 +145,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L224) +[packages/quickjs-emscripten-core/src/context.ts:233](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L233) ## Properties @@ -152,7 +157,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context.ts:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L186) +[packages/quickjs-emscripten-core/src/context.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L195) ## Accessors @@ -170,7 +175,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L255) +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -186,7 +191,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:313](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L313) +[packages/quickjs-emscripten-core/src/context.ts:322](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L322) *** @@ -204,7 +209,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L328) +[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) *** @@ -220,7 +225,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:287](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L287) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -236,7 +241,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:300](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L300) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -252,7 +257,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) ## Methods @@ -326,7 +331,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1059](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1059) +[packages/quickjs-emscripten-core/src/context.ts:1180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1180) #### callFunction(func, thisVal, args) @@ -350,7 +355,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1064](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1064) +[packages/quickjs-emscripten-core/src/context.ts:1185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1185) *** @@ -380,7 +385,7 @@ value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1113) +[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) *** @@ -409,7 +414,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1530](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1530) *** @@ -440,7 +445,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1000](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1000) +[packages/quickjs-emscripten-core/src/context.ts:1121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1121) *** @@ -469,7 +474,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L265) +[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) *** @@ -491,7 +496,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) +[packages/quickjs-emscripten-core/src/context.ts:1355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1355) *** @@ -521,7 +526,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) +[packages/quickjs-emscripten-core/src/context.ts:1513](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1513) *** @@ -544,7 +549,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) +[packages/quickjs-emscripten-core/src/context.ts:932](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L932) *** @@ -607,7 +612,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1156](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1156) +[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) *** @@ -625,7 +630,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) +[packages/quickjs-emscripten-core/src/context.ts:1539](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1539) *** @@ -645,7 +650,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:690](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L690) +[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) *** @@ -665,7 +670,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) +[packages/quickjs-emscripten-core/src/context.ts:802](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L802) *** @@ -697,7 +702,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1081](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1081) *** @@ -728,7 +733,7 @@ a number if the handle has a numeric length property, otherwise `undefined`. #### Source -[packages/quickjs-emscripten-core/src/context.ts:870](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L870) +[packages/quickjs-emscripten-core/src/context.ts:991](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L991) *** @@ -754,7 +759,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:652](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L652) +[packages/quickjs-emscripten-core/src/context.ts:773](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L773) *** @@ -804,7 +809,7 @@ QuickJSEmptyGetOwnPropertyNames if no options are set. #### Source -[packages/quickjs-emscripten-core/src/context.ts:907](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L907) +[packages/quickjs-emscripten-core/src/context.ts:1028](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1028) *** @@ -834,7 +839,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:715](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L715) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -864,7 +869,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:840](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L840) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -888,7 +893,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:660](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L660) +[packages/quickjs-emscripten-core/src/context.ts:781](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L781) *** @@ -909,7 +914,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:669](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L669) +[packages/quickjs-emscripten-core/src/context.ts:790](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L790) *** @@ -929,7 +934,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:388](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L388) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -946,7 +951,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:430](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L430) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -966,7 +971,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:438](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L438) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) *** @@ -986,7 +991,48 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:396](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L396) +[packages/quickjs-emscripten-core/src/context.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L405) + +*** + +### newConstructorFunction() + +#### newConstructorFunction(fn) + +> **newConstructorFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Convert a Javascript function into a QuickJS constructor function. +See [newFunction](QuickJSContext.md#newfunction) for more details. + +##### Parameters + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:635](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L635) + +#### newConstructorFunction(name, fn) + +> **newConstructorFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:636](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L636) *** @@ -1010,7 +1056,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:679](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L679) #### newError(message) @@ -1026,7 +1072,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) #### newError(undefined) @@ -1038,13 +1084,15 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) +[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) *** ### newFunction() -> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) +#### newFunction(fn) + +> **newFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) Convert a Javascript function into a QuickJS function value. See [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) for more details. @@ -1053,6 +1101,8 @@ A [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) sho value. A VmFunctionImplementation should also not retain any references to its return value. +For constructors (functions that will be called with `new ...`), use [newConstructorFunction](QuickJSContext.md#newconstructorfunction). + The function argument handles are automatically disposed when the function returns. If you want to retain a handle beyond the end of the function, you can call [Lifetime#dup](Lifetime.md#dup) to create a copy of the handle that you own @@ -1139,23 +1189,102 @@ someNativeAsyncFunction().then(deferred.resolve) return deferred.handle ``` -#### Parameters +##### Parameters -• **name**: `string` +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Implementation of + +[`quickjs-emscripten-core.LowLevelJavascriptVm.newFunction`](../interfaces/LowLevelJavascriptVm.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:612](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L612) + +#### newFunction(name, fn) + +> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` • **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Implementation of + +`LowLevelJavascriptVm.newFunction` + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:613](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L613) + +*** + +### newFunctionWithOptions() + +> **newFunctionWithOptions**(`args`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Lower-level API for creating functions. +See [newFunction](QuickJSContext.md#newfunction) for more details on how to use functions. + +#### Parameters + +• **args**: `Object` + +• **args\.fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +• **args\.isConstructor**: `boolean` + +• **args\.length**: `number` + +• **args\.name**: `undefined` \| `string` + #### Returns [`QuickJSHandle`](../exports.md#quickjshandle) -#### Implementation of +#### Source -[`quickjs-emscripten-core.LowLevelJavascriptVm.newFunction`](../interfaces/LowLevelJavascriptVm.md#newfunction) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) + +*** + +### newHostRef() + +> **newHostRef**\<`T`\>(`value`): `HostRef`\<`T`\> + +Create an opaque handle object that stores a reference to a host JavaScript object. + +The guest cannot access the host object directly, but you may use +getHostRef to convert a HostRef handle back into a HostRef`` from +inside a function implementation. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **value**: `T` + +#### Returns + +`HostRef`\<`T`\> #### Source -[packages/quickjs-emscripten-core/src/context.ts:601](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L601) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -1179,7 +1308,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:347](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L347) +[packages/quickjs-emscripten-core/src/context.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L356) *** @@ -1206,7 +1335,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L416) +[packages/quickjs-emscripten-core/src/context.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L425) *** @@ -1227,7 +1356,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L451) +[packages/quickjs-emscripten-core/src/context.ts:460](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L460) #### newPromise(promise) @@ -1249,7 +1378,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:459](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L459) +[packages/quickjs-emscripten-core/src/context.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L468) #### newPromise(newPromiseFn) @@ -1270,7 +1399,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:466](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L466) +[packages/quickjs-emscripten-core/src/context.ts:475](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L475) *** @@ -1294,7 +1423,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L354) +[packages/quickjs-emscripten-core/src/context.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L363) *** @@ -1315,7 +1444,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:377](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L377) +[packages/quickjs-emscripten-core/src/context.ts:386](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L386) *** @@ -1336,7 +1465,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:365](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L365) +[packages/quickjs-emscripten-core/src/context.ts:374](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L374) *** @@ -1364,7 +1493,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:754](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L754) +[packages/quickjs-emscripten-core/src/context.ts:875](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L875) *** @@ -1387,7 +1516,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:819](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L819) +[packages/quickjs-emscripten-core/src/context.ts:940](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L940) *** @@ -1410,7 +1539,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:827](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L827) +[packages/quickjs-emscripten-core/src/context.ts:948](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L948) *** @@ -1447,7 +1576,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:985](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L985) +[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1469,7 +1598,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) +[packages/quickjs-emscripten-core/src/context.ts:1535](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1535) *** @@ -1489,7 +1618,33 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1193) +[packages/quickjs-emscripten-core/src/context.ts:1314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1314) + +*** + +### toHostRef() + +> **toHostRef**\<`T`\>(`handle`): `undefined` \| `HostRef`\<`T`\> + +If `handle` is a `HostRef.handle`, return a new `HostRef` instance wrapping the handle. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `HostRef`\<`T`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:732](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L732) *** @@ -1517,7 +1672,35 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:643](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L643) +[packages/quickjs-emscripten-core/src/context.ts:764](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L764) + +*** + +### unwrapHostRef() + +> **unwrapHostRef**\<`T`\>(`handle`): `T` + +If `handle` is a `HostRef.handle`, return the host value `T`. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`T` + +#### Throws + +QuickJSHostRefInvalid if `handle` is not a `HostRef.handle` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:747](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L747) *** @@ -1544,7 +1727,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) +[packages/quickjs-emscripten-core/src/context.ts:1398](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1398) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md index f8bf2eff6..b53d42af0 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md @@ -79,7 +79,7 @@ A context here may be allocated if one is needed by the runtime, eg for [compute #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L78) +[packages/quickjs-emscripten-core/src/runtime.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L79) ## Accessors @@ -97,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[packages/quickjs-emscripten-core/src/runtime.ts:128](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L128) ## Methods @@ -145,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) +[packages/quickjs-emscripten-core/src/runtime.ts:330](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L330) *** @@ -165,7 +165,7 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSRuntime.md#d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) +[packages/quickjs-emscripten-core/src/runtime.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L299) *** @@ -188,7 +188,7 @@ manipulation if debug logging is disabled. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L363) +[packages/quickjs-emscripten-core/src/runtime.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L366) *** @@ -212,7 +212,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) +[packages/quickjs-emscripten-core/src/runtime.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L132) *** @@ -229,7 +229,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSRun #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) +[packages/quickjs-emscripten-core/src/runtime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L310) *** @@ -263,7 +263,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) +[packages/quickjs-emscripten-core/src/runtime.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L246) *** @@ -282,7 +282,7 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) +[packages/quickjs-emscripten-core/src/runtime.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L197) *** @@ -298,7 +298,7 @@ true if debug logging is enabled #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L353) +[packages/quickjs-emscripten-core/src/runtime.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L356) *** @@ -322,7 +322,7 @@ You should dispose a created context before disposing this runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L140) +[packages/quickjs-emscripten-core/src/runtime.ts:143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L143) *** @@ -339,7 +339,7 @@ See [setInterruptHandler](QuickJSRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) +[packages/quickjs-emscripten-core/src/runtime.ts:222](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L222) *** @@ -355,7 +355,7 @@ Remove the the loader set by [setModuleLoader](QuickJSRuntime.md#setmoduleloader #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) +[packages/quickjs-emscripten-core/src/runtime.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L184) *** @@ -378,7 +378,7 @@ code. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L343) +[packages/quickjs-emscripten-core/src/runtime.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L346) *** @@ -402,7 +402,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSRuntim #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) +[packages/quickjs-emscripten-core/src/runtime.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L210) *** @@ -423,7 +423,7 @@ To remove the limit, set to `0`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:315](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L315) +[packages/quickjs-emscripten-core/src/runtime.ts:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L318) *** @@ -444,7 +444,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) +[packages/quickjs-emscripten-core/src/runtime.ts:284](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L284) *** @@ -469,7 +469,7 @@ The loader can be removed with [removeModuleLoader](QuickJSRuntime.md#removemodu #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L172) +[packages/quickjs-emscripten-core/src/runtime.ts:175](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L175) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSWASMModule.md b/doc/quickjs-emscripten-core/classes/QuickJSWASMModule.md index bd3c82cd1..69abf2e94 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSWASMModule.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSWASMModule.md @@ -81,7 +81,7 @@ with name `"InternalError"` and message `"interrupted"`. #### Source -[packages/quickjs-emscripten-core/src/module.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L395) +[packages/quickjs-emscripten-core/src/module.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L410) *** @@ -101,7 +101,7 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) +[packages/quickjs-emscripten-core/src/module.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L441) *** @@ -123,7 +123,7 @@ be disposed when the context is disposed. #### Source -[packages/quickjs-emscripten-core/src/module.ts:360](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L360) +[packages/quickjs-emscripten-core/src/module.ts:375](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L375) *** @@ -145,7 +145,7 @@ loading for one or more [QuickJSContext](QuickJSContext.md)s inside the runtime. #### Source -[packages/quickjs-emscripten-core/src/module.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L333) +[packages/quickjs-emscripten-core/src/module.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L346) *** diff --git a/doc/quickjs-emscripten-core/classes/StaticLifetime.md b/doc/quickjs-emscripten-core/classes/StaticLifetime.md index 97d17214d..2d044895e 100644 --- a/doc/quickjs-emscripten-core/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten-core/classes/StaticLifetime.md @@ -28,6 +28,7 @@ A Lifetime that lives forever. Used for constants. - [value](StaticLifetime.md#value) - [Methods](StaticLifetime.md#methods) - [`[dispose]`()](StaticLifetime.md#dispose) + - [assertAlive()](StaticLifetime.md#assertalive) - [consume()](StaticLifetime.md#consume) - [dispose()](StaticLifetime.md#dispose) - [dup()](StaticLifetime.md#dup) @@ -257,6 +258,24 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten-core.Lifetime.assertAlive`](Lifetime.md#assertalive) + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten-core/classes/WeakLifetime.md b/doc/quickjs-emscripten-core/classes/WeakLifetime.md index 089cf48fe..a8b3abc95 100644 --- a/doc/quickjs-emscripten-core/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten-core/classes/WeakLifetime.md @@ -32,6 +32,7 @@ Used for function arguments. - [value](WeakLifetime.md#value) - [Methods](WeakLifetime.md#methods) - [`[dispose]`()](WeakLifetime.md#dispose) + - [assertAlive()](WeakLifetime.md#assertalive) - [consume()](WeakLifetime.md#consume) - [dispose()](WeakLifetime.md#dispose) - [dup()](WeakLifetime.md#dup) @@ -267,6 +268,24 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten-core.Lifetime.assertAlive`](Lifetime.md#assertalive) + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten-core/exports.md b/doc/quickjs-emscripten-core/exports.md index 51df2323f..fc4489e51 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -215,7 +215,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L246) +[packages/quickjs-ffi-types/src/emscripten-types.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L253) *** @@ -231,7 +231,7 @@ by the runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L35) +[packages/quickjs-emscripten-core/src/runtime.ts:36](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L36) *** @@ -256,7 +256,7 @@ Determines if a VM's execution should be interrupted. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:27](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L27) +[packages/quickjs-emscripten-core/src/runtime.ts:28](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L28) *** @@ -472,7 +472,7 @@ State of a promise. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) *** @@ -733,7 +733,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L68) +[packages/quickjs-emscripten-core/src/context.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L71) *** @@ -1141,7 +1141,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) ## Functions @@ -1174,7 +1174,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) +[packages/quickjs-ffi-types/src/ffi-types.ts:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L141) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md index b92006021..d39bcb7d7 100644 --- a/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md +++ b/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md @@ -49,7 +49,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -59,7 +59,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -79,7 +79,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -89,7 +89,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -99,7 +99,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -109,7 +109,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -119,7 +119,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -129,7 +129,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -149,7 +149,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -165,7 +165,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -181,7 +181,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -204,7 +204,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -222,7 +222,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -240,7 +240,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -273,7 +273,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -299,7 +299,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -317,7 +317,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -361,7 +361,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -385,7 +385,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -410,7 +410,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md index e31d5f435..89d140fbc 100644 --- a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md +++ b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md @@ -22,7 +22,7 @@ ## Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L249) +[packages/quickjs-ffi-types/src/emscripten-types.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L256) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md index c8e525b5d..ff70822f0 100644 --- a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md @@ -35,7 +35,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -47,7 +47,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -69,7 +69,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -109,7 +109,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -129,7 +129,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** diff --git a/doc/quickjs-emscripten-core/interfaces/ModuleEvalOptions.md b/doc/quickjs-emscripten-core/interfaces/ModuleEvalOptions.md index 4007ac79b..1804e4f68 100644 --- a/doc/quickjs-emscripten-core/interfaces/ModuleEvalOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/ModuleEvalOptions.md @@ -27,7 +27,7 @@ To remove the limit, set to `0`. #### Source -[packages/quickjs-emscripten-core/src/module.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L82) +[packages/quickjs-emscripten-core/src/module.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L85) *** @@ -39,7 +39,7 @@ Memory limit, in bytes, of WebAssembly heap memory used by the QuickJS VM. #### Source -[packages/quickjs-emscripten-core/src/module.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L76) +[packages/quickjs-emscripten-core/src/module.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L79) *** @@ -51,7 +51,7 @@ Module loader for any `import` statements or expressions. #### Source -[packages/quickjs-emscripten-core/src/module.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L87) +[packages/quickjs-emscripten-core/src/module.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L90) *** @@ -64,7 +64,7 @@ See [shouldInterruptAfterDeadline](../exports.md#shouldinterruptafterdeadline). #### Source -[packages/quickjs-emscripten-core/src/module.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L71) +[packages/quickjs-emscripten-core/src/module.ts:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L74) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md index 5d3924f3c..41a1d7c80 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -83,7 +83,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -97,7 +97,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -111,7 +111,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -125,7 +125,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -153,7 +153,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -167,7 +167,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -181,7 +181,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -195,7 +195,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -205,7 +205,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L243) +[packages/quickjs-ffi-types/src/emscripten-types.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L250) *** @@ -219,7 +219,7 @@ Implement this field #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:242](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L242) +[packages/quickjs-ffi-types/src/emscripten-types.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L249) *** @@ -235,7 +235,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -251,7 +251,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -278,7 +278,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -300,7 +300,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -322,7 +322,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -359,7 +359,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -385,7 +385,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -407,7 +407,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -451,7 +451,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -475,7 +475,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -504,7 +504,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md index cbcad7484..a52ba33d2 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md @@ -41,6 +41,7 @@ library. - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSAsyncFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) @@ -64,6 +65,7 @@ library. - [QTS\_NewError](QuickJSAsyncFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSAsyncFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSAsyncFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSAsyncFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSAsyncFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSAsyncFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSAsyncFFI.md#qts-newpromisecapability) @@ -105,7 +107,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L39) +[packages/quickjs-ffi-types/src/ffi-async.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L40) *** @@ -125,7 +127,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) +[packages/quickjs-ffi-types/src/ffi-async.ts:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) *** @@ -139,7 +141,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) +[packages/quickjs-ffi-types/src/ffi-async.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) *** @@ -153,7 +155,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) *** @@ -167,7 +169,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) +[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) *** @@ -193,7 +195,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L173) +[packages/quickjs-ffi-types/src/ffi-async.ts:176](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L176) *** @@ -219,7 +221,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L180) +[packages/quickjs-ffi-types/src/ffi-async.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L183) *** @@ -253,7 +255,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L148) +[packages/quickjs-ffi-types/src/ffi-async.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L151) *** @@ -273,7 +275,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L188) +[packages/quickjs-ffi-types/src/ffi-async.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) *** @@ -293,7 +295,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L192) +[packages/quickjs-ffi-types/src/ffi-async.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) *** @@ -313,7 +315,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) +[packages/quickjs-ffi-types/src/ffi-async.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) *** @@ -341,7 +343,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L196) +[packages/quickjs-ffi-types/src/ffi-async.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L199) *** @@ -369,7 +371,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L204) +[packages/quickjs-ffi-types/src/ffi-async.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L207) *** @@ -391,7 +393,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L106) +[packages/quickjs-ffi-types/src/ffi-async.ts:109](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L109) *** @@ -413,7 +415,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L111) +[packages/quickjs-ffi-types/src/ffi-async.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L114) *** @@ -433,7 +435,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) +[packages/quickjs-ffi-types/src/ffi-async.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L63) *** @@ -451,7 +453,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) +[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -469,7 +471,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) +[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -489,7 +491,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) +[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -509,7 +511,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) +[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) *** @@ -529,7 +531,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) +[packages/quickjs-ffi-types/src/ffi-async.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L62) *** @@ -549,7 +551,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L83) +[packages/quickjs-ffi-types/src/ffi-async.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) *** @@ -569,7 +571,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L87) +[packages/quickjs-ffi-types/src/ffi-async.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) *** @@ -587,7 +589,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -601,7 +603,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) +[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -621,7 +623,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) +[packages/quickjs-ffi-types/src/ffi-async.ts:80](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L80) *** @@ -639,7 +641,25 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) +[packages/quickjs-ffi-types/src/ffi-async.ts:234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L234) + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`HostRefId` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-async.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -661,7 +681,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L220) +[packages/quickjs-ffi-types/src/ffi-async.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L223) *** @@ -681,7 +701,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:212](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L212) +[packages/quickjs-ffi-types/src/ffi-async.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L215) *** @@ -695,7 +715,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) +[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -721,7 +741,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L159) +[packages/quickjs-ffi-types/src/ffi-async.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L162) *** @@ -747,7 +767,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L166) +[packages/quickjs-ffi-types/src/ffi-async.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L169) *** @@ -769,7 +789,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L116) +[packages/quickjs-ffi-types/src/ffi-async.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L119) *** @@ -791,7 +811,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L126) +[packages/quickjs-ffi-types/src/ffi-async.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L129) *** @@ -813,7 +833,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L131) +[packages/quickjs-ffi-types/src/ffi-async.ts:134](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L134) *** @@ -835,7 +855,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L121) +[packages/quickjs-ffi-types/src/ffi-async.ts:124](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L124) *** @@ -855,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) +[packages/quickjs-ffi-types/src/ffi-async.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) *** @@ -875,7 +895,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L96) +[packages/quickjs-ffi-types/src/ffi-async.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) *** @@ -895,7 +915,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L100) +[packages/quickjs-ffi-types/src/ffi-async.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) *** @@ -909,7 +929,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) +[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -923,7 +943,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) +[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -947,7 +967,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L225) +[packages/quickjs-ffi-types/src/ffi-async.ts:228](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L228) *** @@ -967,7 +987,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) +[packages/quickjs-ffi-types/src/ffi-async.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L107) *** @@ -985,7 +1005,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) +[packages/quickjs-ffi-types/src/ffi-async.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L108) *** @@ -1003,7 +1023,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) +[packages/quickjs-ffi-types/src/ffi-async.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L73) *** @@ -1025,7 +1045,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L71) +[packages/quickjs-ffi-types/src/ffi-async.ts:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L74) *** @@ -1045,7 +1065,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) +[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -1063,7 +1083,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) +[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1083,29 +1103,53 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) +[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) +[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +[packages/quickjs-ffi-types/src/ffi-async.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -1123,7 +1167,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) +[packages/quickjs-ffi-types/src/ffi-async.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L68) *** @@ -1143,7 +1187,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L66) +[packages/quickjs-ffi-types/src/ffi-async.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) *** @@ -1163,7 +1207,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:232](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L232) +[packages/quickjs-ffi-types/src/ffi-async.ts:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) *** @@ -1177,7 +1221,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) +[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -1197,7 +1241,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) +[packages/quickjs-ffi-types/src/ffi-async.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L81) *** @@ -1219,7 +1263,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L91) +[packages/quickjs-ffi-types/src/ffi-async.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L94) *** @@ -1239,7 +1283,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:240](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L240) +[packages/quickjs-ffi-types/src/ffi-async.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) *** @@ -1259,7 +1303,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:236](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L236) +[packages/quickjs-ffi-types/src/ffi-async.ts:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) *** @@ -1273,7 +1317,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) +[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -1293,7 +1337,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) +[packages/quickjs-ffi-types/src/ffi-async.ts:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L190) *** @@ -1313,7 +1357,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) +[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1331,7 +1375,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L264) *** @@ -1349,7 +1393,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:257](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L257) +[packages/quickjs-ffi-types/src/ffi-async.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L266) *** @@ -1367,7 +1411,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) +[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -1385,7 +1429,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:263](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L263) *** @@ -1405,7 +1449,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) +[packages/quickjs-ffi-types/src/ffi-async.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L265) *** @@ -1425,7 +1469,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) +[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) *** @@ -1445,7 +1489,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) +[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1465,7 +1509,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) *** @@ -1489,7 +1533,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L136) +[packages/quickjs-ffi-types/src/ffi-async.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L139) *** @@ -1513,7 +1557,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:142](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L142) +[packages/quickjs-ffi-types/src/ffi-async.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L145) *** @@ -1531,7 +1575,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -1551,7 +1595,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) +[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1571,7 +1615,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L216) +[packages/quickjs-ffi-types/src/ffi-async.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) *** @@ -1591,7 +1635,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:262](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L262) +[packages/quickjs-ffi-types/src/ffi-async.ts:271](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L271) *** @@ -1611,7 +1655,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:258](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L258) +[packages/quickjs-ffi-types/src/ffi-async.ts:267](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L267) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md index f3621bfea..a598870cd 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) +[packages/quickjs-ffi-types/src/emscripten-types.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L169) *** @@ -69,7 +69,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) +[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) *** @@ -83,7 +83,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159) +[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) *** @@ -97,7 +97,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157) +[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158) *** @@ -111,7 +111,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) +[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) *** @@ -125,7 +125,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164) +[packages/quickjs-ffi-types/src/emscripten-types.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L165) *** @@ -139,7 +139,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) +[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) *** @@ -153,7 +153,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162) +[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163) *** @@ -167,7 +167,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160) +[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161) *** @@ -181,7 +181,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) +[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168) *** @@ -195,7 +195,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166) +[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167) *** @@ -205,7 +205,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:237](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L237) +[packages/quickjs-ffi-types/src/emscripten-types.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L244) *** @@ -215,7 +215,7 @@ QuickJS. #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:236](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L236) +[packages/quickjs-ffi-types/src/emscripten-types.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L243) *** @@ -231,7 +231,7 @@ Compile this to WebAssembly.Module #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L104) +[packages/quickjs-ffi-types/src/emscripten-types.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L105) *** @@ -247,7 +247,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L107) +[packages/quickjs-ffi-types/src/emscripten-types.ts:108](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L108) ## Methods @@ -274,7 +274,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L144) +[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) *** @@ -296,7 +296,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) +[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) *** @@ -318,7 +318,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L147) +[packages/quickjs-ffi-types/src/emscripten-types.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L148) *** @@ -355,7 +355,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L149) +[packages/quickjs-ffi-types/src/emscripten-types.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L150) *** @@ -381,7 +381,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L110) +[packages/quickjs-ffi-types/src/emscripten-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L111) *** @@ -403,7 +403,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L145) +[packages/quickjs-ffi-types/src/emscripten-types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L146) *** @@ -447,7 +447,7 @@ Often `''` (empty string) #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L97) +[packages/quickjs-ffi-types/src/emscripten-types.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L98) *** @@ -471,7 +471,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L116) +[packages/quickjs-ffi-types/src/emscripten-types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L117) *** @@ -500,7 +500,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L139) +[packages/quickjs-ffi-types/src/emscripten-types.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L140) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md index 4251716a5..638a9afc4 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md @@ -37,6 +37,7 @@ library. - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) @@ -56,6 +57,7 @@ library. - [QTS\_NewError](QuickJSFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSFFI.md#qts-newpromisecapability) @@ -96,7 +98,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) +[packages/quickjs-ffi-types/src/ffi.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L39) *** @@ -116,7 +118,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) +[packages/quickjs-ffi-types/src/ffi.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) *** @@ -130,7 +132,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) +[packages/quickjs-ffi-types/src/ffi.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) *** @@ -144,7 +146,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -158,7 +160,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) +[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -184,7 +186,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) +[packages/quickjs-ffi-types/src/ffi.ts:143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L143) *** @@ -218,7 +220,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) +[packages/quickjs-ffi-types/src/ffi.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L125) *** @@ -238,7 +240,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) +[packages/quickjs-ffi-types/src/ffi.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) *** @@ -258,7 +260,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) +[packages/quickjs-ffi-types/src/ffi.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) *** @@ -286,7 +288,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) +[packages/quickjs-ffi-types/src/ffi.ts:155](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L155) *** @@ -308,7 +310,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) +[packages/quickjs-ffi-types/src/ffi.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L104) *** @@ -328,7 +330,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) +[packages/quickjs-ffi-types/src/ffi.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L62) *** @@ -346,7 +348,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -364,7 +366,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) +[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -384,7 +386,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -404,7 +406,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) +[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -424,7 +426,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) +[packages/quickjs-ffi-types/src/ffi.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L61) *** @@ -444,7 +446,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) +[packages/quickjs-ffi-types/src/ffi.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) *** @@ -464,7 +466,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) +[packages/quickjs-ffi-types/src/ffi.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) *** @@ -482,7 +484,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -496,7 +498,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) +[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -516,7 +518,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) +[packages/quickjs-ffi-types/src/ffi.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L79) *** @@ -534,7 +536,25 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) +[packages/quickjs-ffi-types/src/ffi.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L182) + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`HostRefId` + +#### Source + +[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -556,7 +576,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L168) +[packages/quickjs-ffi-types/src/ffi.ts:171](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L171) *** @@ -576,7 +596,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) +[packages/quickjs-ffi-types/src/ffi.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) *** @@ -590,7 +610,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) +[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -616,7 +636,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L133) +[packages/quickjs-ffi-types/src/ffi.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L136) *** @@ -638,7 +658,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) +[packages/quickjs-ffi-types/src/ffi.ts:109](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L109) *** @@ -660,7 +680,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L111) +[packages/quickjs-ffi-types/src/ffi.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L114) *** @@ -680,7 +700,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) +[packages/quickjs-ffi-types/src/ffi.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) *** @@ -700,7 +720,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) +[packages/quickjs-ffi-types/src/ffi.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) *** @@ -714,7 +734,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) +[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -728,7 +748,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) +[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -752,7 +772,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L173) +[packages/quickjs-ffi-types/src/ffi.ts:176](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L176) *** @@ -772,7 +792,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) +[packages/quickjs-ffi-types/src/ffi.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L102) *** @@ -790,7 +810,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) +[packages/quickjs-ffi-types/src/ffi.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L103) *** @@ -808,7 +828,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) +[packages/quickjs-ffi-types/src/ffi.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L72) *** @@ -830,7 +850,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) +[packages/quickjs-ffi-types/src/ffi.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L73) *** @@ -850,7 +870,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) +[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -868,7 +888,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) +[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -888,29 +908,53 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) +[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -928,7 +972,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) +[packages/quickjs-ffi-types/src/ffi.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L67) *** @@ -948,7 +992,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) +[packages/quickjs-ffi-types/src/ffi.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) *** @@ -968,7 +1012,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) +[packages/quickjs-ffi-types/src/ffi.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) *** @@ -982,7 +1026,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) +[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -1002,7 +1046,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) +[packages/quickjs-ffi-types/src/ffi.ts:80](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L80) *** @@ -1024,7 +1068,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) +[packages/quickjs-ffi-types/src/ffi.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L93) *** @@ -1044,7 +1088,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) +[packages/quickjs-ffi-types/src/ffi.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) *** @@ -1064,7 +1108,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) +[packages/quickjs-ffi-types/src/ffi.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) *** @@ -1078,7 +1122,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) +[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -1098,7 +1142,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) +[packages/quickjs-ffi-types/src/ffi.ts:150](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L150) *** @@ -1118,7 +1162,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) +[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1136,7 +1180,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:212](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L212) *** @@ -1154,7 +1198,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) +[packages/quickjs-ffi-types/src/ffi.ts:214](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L214) *** @@ -1172,7 +1216,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) +[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -1190,7 +1234,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L211) *** @@ -1210,7 +1254,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) +[packages/quickjs-ffi-types/src/ffi.ts:213](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L213) *** @@ -1230,7 +1274,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) +[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) *** @@ -1250,7 +1294,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1270,7 +1314,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -1294,7 +1338,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) +[packages/quickjs-ffi-types/src/ffi.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L119) *** @@ -1312,7 +1356,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -1332,7 +1376,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -1352,7 +1396,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) +[packages/quickjs-ffi-types/src/ffi.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L167) *** @@ -1372,7 +1416,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) +[packages/quickjs-ffi-types/src/ffi.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L219) *** @@ -1392,7 +1436,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L206) +[packages/quickjs-ffi-types/src/ffi.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L215) *** diff --git a/doc/quickjs-emscripten-core/interfaces/SourceMapData.md b/doc/quickjs-emscripten-core/interfaces/SourceMapData.md index 31350f94f..2369ac1e8 100644 --- a/doc/quickjs-emscripten-core/interfaces/SourceMapData.md +++ b/doc/quickjs-emscripten-core/interfaces/SourceMapData.md @@ -22,7 +22,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L58) +[packages/quickjs-ffi-types/src/emscripten-types.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L59) *** @@ -32,7 +32,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L57) +[packages/quickjs-ffi-types/src/emscripten-types.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L58) *** @@ -42,7 +42,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L56) +[packages/quickjs-ffi-types/src/emscripten-types.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L57) *** @@ -52,7 +52,7 @@ #### Source -[packages/quickjs-ffi-types/src/emscripten-types.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L55) +[packages/quickjs-ffi-types/src/emscripten-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L56) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/README.md b/doc/quickjs-emscripten-core/namespaces/errors/README.md index 46c855dd5..beed0e962 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/README.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/README.md @@ -16,6 +16,8 @@ Collects the informative errors this library may throw. - [QuickJSAsyncifySuspended](classes/QuickJSAsyncifySuspended.md) - [QuickJSEmptyGetOwnPropertyNames](classes/QuickJSEmptyGetOwnPropertyNames.md) - [QuickJSEmscriptenModuleError](classes/QuickJSEmscriptenModuleError.md) +- [QuickJSHostRefInvalid](classes/QuickJSHostRefInvalid.md) +- [QuickJSHostRefRangeExceeded](classes/QuickJSHostRefRangeExceeded.md) - [QuickJSMemoryLeakDetected](classes/QuickJSMemoryLeakDetected.md) - [QuickJSNotImplemented](classes/QuickJSNotImplemented.md) - [QuickJSPromisePending](classes/QuickJSPromisePending.md) diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefInvalid.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefInvalid.md new file mode 100644 index 000000000..42e991919 --- /dev/null +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefInvalid.md @@ -0,0 +1,59 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten-core** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten-core](../../../exports.md) / [errors](../README.md) / QuickJSHostRefInvalid + +# Class: QuickJSHostRefInvalid + +## Contents + +- [Extends](QuickJSHostRefInvalid.md#extends) +- [Constructors](QuickJSHostRefInvalid.md#constructors) + - [new QuickJSHostRefInvalid(message)](QuickJSHostRefInvalid.md#new-quickjshostrefinvalidmessage) +- [Properties](QuickJSHostRefInvalid.md#properties) + - [name](QuickJSHostRefInvalid.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSHostRefInvalid(message) + +> **new QuickJSHostRefInvalid**(`message`?): [`QuickJSHostRefInvalid`](QuickJSHostRefInvalid.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSHostRefInvalid`](QuickJSHostRefInvalid.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSHostRefInvalid"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L65) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md new file mode 100644 index 000000000..ca9ae2da5 --- /dev/null +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md @@ -0,0 +1,59 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten-core** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten-core](../../../exports.md) / [errors](../README.md) / QuickJSHostRefRangeExceeded + +# Class: QuickJSHostRefRangeExceeded + +## Contents + +- [Extends](QuickJSHostRefRangeExceeded.md#extends) +- [Constructors](QuickJSHostRefRangeExceeded.md#constructors) + - [new QuickJSHostRefRangeExceeded(message)](QuickJSHostRefRangeExceeded.md#new-quickjshostrefrangeexceededmessage) +- [Properties](QuickJSHostRefRangeExceeded.md#properties) + - [name](QuickJSHostRefRangeExceeded.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSHostRefRangeExceeded(message) + +> **new QuickJSHostRefRangeExceeded**(`message`?): [`QuickJSHostRefRangeExceeded`](QuickJSHostRefRangeExceeded.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSHostRefRangeExceeded`](QuickJSHostRefRangeExceeded.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSHostRefRangeExceeded"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L61) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten/classes/Lifetime.md b/doc/quickjs-emscripten/classes/Lifetime.md index 62ec48a93..d263c8697 100644 --- a/doc/quickjs-emscripten/classes/Lifetime.md +++ b/doc/quickjs-emscripten/classes/Lifetime.md @@ -32,6 +32,7 @@ Typically, quickjs-emscripten uses Lifetimes to protect C memory pointers. - [value](Lifetime.md#value) - [Methods](Lifetime.md#methods) - [`[dispose]`()](Lifetime.md#dispose) + - [assertAlive()](Lifetime.md#assertalive) - [consume()](Lifetime.md#consume) - [dispose()](Lifetime.md#dispose) - [dup()](Lifetime.md#dup) @@ -258,6 +259,20 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index d5fdcc5b3..9326f9317 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -54,8 +54,11 @@ host functions as though they were synchronous. - [newArrayBuffer()](QuickJSAsyncContext.md#newarraybuffer) - [newAsyncifiedFunction()](QuickJSAsyncContext.md#newasyncifiedfunction) - [newBigInt()](QuickJSAsyncContext.md#newbigint) + - [newConstructorFunction()](QuickJSAsyncContext.md#newconstructorfunction) - [newError()](QuickJSAsyncContext.md#newerror) - [newFunction()](QuickJSAsyncContext.md#newfunction) + - [newFunctionWithOptions()](QuickJSAsyncContext.md#newfunctionwithoptions) + - [newHostRef()](QuickJSAsyncContext.md#newhostref) - [newNumber()](QuickJSAsyncContext.md#newnumber) - [newObject()](QuickJSAsyncContext.md#newobject) - [newPromise()](QuickJSAsyncContext.md#newpromise) @@ -68,7 +71,9 @@ host functions as though they were synchronous. - [setProp()](QuickJSAsyncContext.md#setprop) - [success()](QuickJSAsyncContext.md#success) - [throw()](QuickJSAsyncContext.md#throw) + - [toHostRef()](QuickJSAsyncContext.md#tohostref) - [typeof()](QuickJSAsyncContext.md#typeof) + - [unwrapHostRef()](QuickJSAsyncContext.md#unwraphostref) - [unwrapResult()](QuickJSAsyncContext.md#unwrapresult) ## Extends @@ -112,7 +117,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L224) +[packages/quickjs-emscripten-core/src/context.ts:233](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L233) ## Properties @@ -146,7 +151,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L255) +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -162,7 +167,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:313](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L313) +[packages/quickjs-emscripten-core/src/context.ts:322](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L322) *** @@ -180,7 +185,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L328) +[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) *** @@ -196,7 +201,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:287](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L287) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -212,7 +217,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:300](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L300) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -228,7 +233,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) ## Methods @@ -298,7 +303,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1059](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1059) +[packages/quickjs-emscripten-core/src/context.ts:1180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1180) #### callFunction(func, thisVal, args) @@ -322,7 +327,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1064](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1064) +[packages/quickjs-emscripten-core/src/context.ts:1185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1185) *** @@ -356,7 +361,7 @@ value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1113) +[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) *** @@ -389,7 +394,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1530](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1530) *** @@ -420,7 +425,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1000](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1000) +[packages/quickjs-emscripten-core/src/context.ts:1121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1121) *** @@ -445,7 +450,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L265) +[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) *** @@ -471,7 +476,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) +[packages/quickjs-emscripten-core/src/context.ts:1355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1355) *** @@ -505,7 +510,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) +[packages/quickjs-emscripten-core/src/context.ts:1513](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1513) *** @@ -532,7 +537,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) +[packages/quickjs-emscripten-core/src/context.ts:932](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L932) *** @@ -595,7 +600,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1156](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1156) +[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) *** @@ -643,7 +648,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) +[packages/quickjs-emscripten-core/src/context.ts:1539](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1539) *** @@ -667,7 +672,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:690](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L690) +[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) *** @@ -691,7 +696,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) +[packages/quickjs-emscripten-core/src/context.ts:802](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L802) *** @@ -727,7 +732,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1081](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1081) *** @@ -762,7 +767,7 @@ a number if the handle has a numeric length property, otherwise `undefined`. #### Source -[packages/quickjs-emscripten-core/src/context.ts:870](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L870) +[packages/quickjs-emscripten-core/src/context.ts:991](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L991) *** @@ -788,7 +793,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:652](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L652) +[packages/quickjs-emscripten-core/src/context.ts:773](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L773) *** @@ -842,7 +847,7 @@ QuickJSEmptyGetOwnPropertyNames if no options are set. #### Source -[packages/quickjs-emscripten-core/src/context.ts:907](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L907) +[packages/quickjs-emscripten-core/src/context.ts:1028](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1028) *** @@ -876,7 +881,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:715](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L715) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -906,7 +911,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:840](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L840) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -930,7 +935,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:660](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L660) +[packages/quickjs-emscripten-core/src/context.ts:781](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L781) *** @@ -955,7 +960,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:669](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L669) +[packages/quickjs-emscripten-core/src/context.ts:790](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L790) *** @@ -979,7 +984,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:388](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L388) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -1000,7 +1005,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:430](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L430) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -1024,7 +1029,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:438](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L438) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) *** @@ -1080,7 +1085,56 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:396](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L396) +[packages/quickjs-emscripten-core/src/context.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L405) + +*** + +### newConstructorFunction() + +#### newConstructorFunction(fn) + +> **newConstructorFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Convert a Javascript function into a QuickJS constructor function. +See [newFunction](QuickJSAsyncContext.md#newfunction) for more details. + +##### Parameters + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.newConstructorFunction`](QuickJSContext.md#newconstructorfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:635](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L635) + +#### newConstructorFunction(name, fn) + +> **newConstructorFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.newConstructorFunction`](QuickJSContext.md#newconstructorfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:636](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L636) *** @@ -1108,7 +1162,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:679](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L679) #### newError(message) @@ -1128,7 +1182,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) #### newError(undefined) @@ -1144,13 +1198,15 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) +[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) *** ### newFunction() -> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) +#### newFunction(fn) + +> **newFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) Convert a Javascript function into a QuickJS function value. See [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) for more details. @@ -1159,6 +1215,8 @@ A [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) sho value. A VmFunctionImplementation should also not retain any references to its return value. +For constructors (functions that will be called with `new ...`), use [newConstructorFunction](QuickJSAsyncContext.md#newconstructorfunction). + The function argument handles are automatically disposed when the function returns. If you want to retain a handle beyond the end of the function, you can call [Lifetime#dup](Lifetime.md#dup) to create a copy of the handle that you own @@ -1245,23 +1303,110 @@ someNativeAsyncFunction().then(deferred.resolve) return deferred.handle ``` -#### Parameters +##### Parameters -• **name**: `string` +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:612](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L612) + +#### newFunction(name, fn) + +> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` • **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:613](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L613) + +*** + +### newFunctionWithOptions() + +> **newFunctionWithOptions**(`args`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Lower-level API for creating functions. +See [newFunction](QuickJSAsyncContext.md#newfunction) for more details on how to use functions. + +#### Parameters + +• **args**: `Object` + +• **args\.fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +• **args\.isConstructor**: `boolean` + +• **args\.length**: `number` + +• **args\.name**: `undefined` \| `string` + #### Returns [`QuickJSHandle`](../exports.md#quickjshandle) #### Inherited from -[`quickjs-emscripten.QuickJSContext.newFunction`](QuickJSContext.md#newfunction) +[`quickjs-emscripten.QuickJSContext.newFunctionWithOptions`](QuickJSContext.md#newfunctionwithoptions) #### Source -[packages/quickjs-emscripten-core/src/context.ts:601](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L601) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) + +*** + +### newHostRef() + +> **newHostRef**\<`T`\>(`value`): `HostRef`\<`T`\> + +Create an opaque handle object that stores a reference to a host JavaScript object. + +The guest cannot access the host object directly, but you may use +getHostRef to convert a HostRef handle back into a HostRef`` from +inside a function implementation. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **value**: `T` + +#### Returns + +`HostRef`\<`T`\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.newHostRef`](QuickJSContext.md#newhostref) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -1285,7 +1430,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:347](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L347) +[packages/quickjs-emscripten-core/src/context.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L356) *** @@ -1312,7 +1457,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L416) +[packages/quickjs-emscripten-core/src/context.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L425) *** @@ -1337,7 +1482,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L451) +[packages/quickjs-emscripten-core/src/context.ts:460](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L460) #### newPromise(promise) @@ -1363,7 +1508,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:459](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L459) +[packages/quickjs-emscripten-core/src/context.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L468) #### newPromise(newPromiseFn) @@ -1388,7 +1533,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:466](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L466) +[packages/quickjs-emscripten-core/src/context.ts:475](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L475) *** @@ -1412,7 +1557,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L354) +[packages/quickjs-emscripten-core/src/context.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L363) *** @@ -1437,7 +1582,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:377](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L377) +[packages/quickjs-emscripten-core/src/context.ts:386](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L386) *** @@ -1462,7 +1607,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:365](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L365) +[packages/quickjs-emscripten-core/src/context.ts:374](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L374) *** @@ -1494,7 +1639,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:754](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L754) +[packages/quickjs-emscripten-core/src/context.ts:875](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L875) *** @@ -1521,7 +1666,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:819](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L819) +[packages/quickjs-emscripten-core/src/context.ts:940](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L940) *** @@ -1548,7 +1693,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:827](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L827) +[packages/quickjs-emscripten-core/src/context.ts:948](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L948) *** @@ -1585,7 +1730,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:985](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L985) +[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1611,7 +1756,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) +[packages/quickjs-emscripten-core/src/context.ts:1535](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1535) *** @@ -1635,7 +1780,37 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1193) +[packages/quickjs-emscripten-core/src/context.ts:1314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1314) + +*** + +### toHostRef() + +> **toHostRef**\<`T`\>(`handle`): `undefined` \| `HostRef`\<`T`\> + +If `handle` is a `HostRef.handle`, return a new `HostRef` instance wrapping the handle. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `HostRef`\<`T`\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.toHostRef`](QuickJSContext.md#tohostref) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:732](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L732) *** @@ -1663,7 +1838,39 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:643](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L643) +[packages/quickjs-emscripten-core/src/context.ts:764](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L764) + +*** + +### unwrapHostRef() + +> **unwrapHostRef**\<`T`\>(`handle`): `T` + +If `handle` is a `HostRef.handle`, return the host value `T`. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`T` + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.unwrapHostRef`](QuickJSContext.md#unwraphostref) + +#### Throws + +QuickJSHostRefInvalid if `handle` is not a `HostRef.handle` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:747](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L747) *** @@ -1694,7 +1901,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) +[packages/quickjs-emscripten-core/src/context.ts:1398](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1398) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md index 1167449a2..eb9a422bd 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md @@ -96,7 +96,7 @@ false after the object has been [dispose](QuickJSAsyncRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[packages/quickjs-emscripten-core/src/runtime.ts:128](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L128) ## Methods @@ -144,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) +[packages/quickjs-emscripten-core/src/runtime.ts:330](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L330) *** @@ -168,7 +168,7 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSAsyncRuntime #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) +[packages/quickjs-emscripten-core/src/runtime.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L299) *** @@ -195,7 +195,7 @@ manipulation if debug logging is disabled. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L363) +[packages/quickjs-emscripten-core/src/runtime.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L366) *** @@ -215,7 +215,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) +[packages/quickjs-emscripten-core/src/runtime.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L132) *** @@ -236,7 +236,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSAsy #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) +[packages/quickjs-emscripten-core/src/runtime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L310) *** @@ -274,7 +274,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) +[packages/quickjs-emscripten-core/src/runtime.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L246) *** @@ -297,7 +297,7 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) +[packages/quickjs-emscripten-core/src/runtime.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L197) *** @@ -317,7 +317,7 @@ true if debug logging is enabled #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L353) +[packages/quickjs-emscripten-core/src/runtime.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L356) *** @@ -366,7 +366,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) +[packages/quickjs-emscripten-core/src/runtime.ts:222](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L222) *** @@ -386,7 +386,7 @@ Remove the the loader set by [setModuleLoader](QuickJSAsyncRuntime.md#setmodulel #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) +[packages/quickjs-emscripten-core/src/runtime.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L184) *** @@ -413,7 +413,7 @@ code. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L343) +[packages/quickjs-emscripten-core/src/runtime.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L346) *** @@ -441,7 +441,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSAsyncR #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) +[packages/quickjs-emscripten-core/src/runtime.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L210) *** @@ -494,7 +494,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) +[packages/quickjs-emscripten-core/src/runtime.ts:284](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L284) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md b/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md index bdbe26f6c..d7ba40d81 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md @@ -104,7 +104,7 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) +[packages/quickjs-emscripten-core/src/module.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L441) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 00d400b92..4f9672697 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -77,8 +77,11 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [newArray()](QuickJSContext.md#newarray) - [newArrayBuffer()](QuickJSContext.md#newarraybuffer) - [newBigInt()](QuickJSContext.md#newbigint) + - [newConstructorFunction()](QuickJSContext.md#newconstructorfunction) - [newError()](QuickJSContext.md#newerror) - [newFunction()](QuickJSContext.md#newfunction) + - [newFunctionWithOptions()](QuickJSContext.md#newfunctionwithoptions) + - [newHostRef()](QuickJSContext.md#newhostref) - [newNumber()](QuickJSContext.md#newnumber) - [newObject()](QuickJSContext.md#newobject) - [newPromise()](QuickJSContext.md#newpromise) @@ -91,7 +94,9 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [setProp()](QuickJSContext.md#setprop) - [success()](QuickJSContext.md#success) - [throw()](QuickJSContext.md#throw) + - [toHostRef()](QuickJSContext.md#tohostref) - [typeof()](QuickJSContext.md#typeof) + - [unwrapHostRef()](QuickJSContext.md#unwraphostref) - [unwrapResult()](QuickJSContext.md#unwrapresult) ## Extends @@ -140,7 +145,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L224) +[packages/quickjs-emscripten-core/src/context.ts:233](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L233) ## Properties @@ -152,7 +157,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context.ts:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L186) +[packages/quickjs-emscripten-core/src/context.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L195) ## Accessors @@ -170,7 +175,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L255) +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -186,7 +191,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:313](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L313) +[packages/quickjs-emscripten-core/src/context.ts:322](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L322) *** @@ -204,7 +209,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:328](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L328) +[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) *** @@ -220,7 +225,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:287](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L287) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -236,7 +241,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:300](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L300) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -252,7 +257,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) ## Methods @@ -326,7 +331,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1059](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1059) +[packages/quickjs-emscripten-core/src/context.ts:1180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1180) #### callFunction(func, thisVal, args) @@ -350,7 +355,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Source -[packages/quickjs-emscripten-core/src/context.ts:1064](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1064) +[packages/quickjs-emscripten-core/src/context.ts:1185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1185) *** @@ -380,7 +385,7 @@ value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1113) +[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) *** @@ -409,7 +414,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) +[packages/quickjs-emscripten-core/src/context.ts:1530](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1530) *** @@ -440,7 +445,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1000](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1000) +[packages/quickjs-emscripten-core/src/context.ts:1121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1121) *** @@ -469,7 +474,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:265](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L265) +[packages/quickjs-emscripten-core/src/context.ts:274](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L274) *** @@ -491,7 +496,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1234](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1234) +[packages/quickjs-emscripten-core/src/context.ts:1355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1355) *** @@ -521,7 +526,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) +[packages/quickjs-emscripten-core/src/context.ts:1513](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1513) *** @@ -544,7 +549,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) +[packages/quickjs-emscripten-core/src/context.ts:932](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L932) *** @@ -607,7 +612,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1156](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1156) +[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) *** @@ -625,7 +630,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) +[packages/quickjs-emscripten-core/src/context.ts:1539](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1539) *** @@ -645,7 +650,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:690](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L690) +[packages/quickjs-emscripten-core/src/context.ts:811](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L811) *** @@ -665,7 +670,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) +[packages/quickjs-emscripten-core/src/context.ts:802](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L802) *** @@ -697,7 +702,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1081](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1081) *** @@ -728,7 +733,7 @@ a number if the handle has a numeric length property, otherwise `undefined`. #### Source -[packages/quickjs-emscripten-core/src/context.ts:870](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L870) +[packages/quickjs-emscripten-core/src/context.ts:991](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L991) *** @@ -754,7 +759,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:652](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L652) +[packages/quickjs-emscripten-core/src/context.ts:773](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L773) *** @@ -804,7 +809,7 @@ QuickJSEmptyGetOwnPropertyNames if no options are set. #### Source -[packages/quickjs-emscripten-core/src/context.ts:907](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L907) +[packages/quickjs-emscripten-core/src/context.ts:1028](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1028) *** @@ -834,7 +839,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:715](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L715) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -864,7 +869,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:840](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L840) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -888,7 +893,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:660](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L660) +[packages/quickjs-emscripten-core/src/context.ts:781](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L781) *** @@ -909,7 +914,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:669](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L669) +[packages/quickjs-emscripten-core/src/context.ts:790](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L790) *** @@ -929,7 +934,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:388](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L388) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -946,7 +951,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:430](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L430) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -966,7 +971,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:438](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L438) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) *** @@ -986,7 +991,48 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:396](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L396) +[packages/quickjs-emscripten-core/src/context.ts:405](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L405) + +*** + +### newConstructorFunction() + +#### newConstructorFunction(fn) + +> **newConstructorFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Convert a Javascript function into a QuickJS constructor function. +See [newFunction](QuickJSContext.md#newfunction) for more details. + +##### Parameters + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:635](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L635) + +#### newConstructorFunction(name, fn) + +> **newConstructorFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` + +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:636](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L636) *** @@ -1010,7 +1056,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:679](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L679) #### newError(message) @@ -1026,7 +1072,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) #### newError(undefined) @@ -1038,13 +1084,15 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) +[packages/quickjs-emscripten-core/src/context.ts:681](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L681) *** ### newFunction() -> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) +#### newFunction(fn) + +> **newFunction**(`fn`): [`QuickJSHandle`](../exports.md#quickjshandle) Convert a Javascript function into a QuickJS function value. See [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) for more details. @@ -1053,6 +1101,8 @@ A [VmFunctionImplementation](../exports.md#vmfunctionimplementationvmhandle) sho value. A VmFunctionImplementation should also not retain any references to its return value. +For constructors (functions that will be called with `new ...`), use [newConstructorFunction](QuickJSContext.md#newconstructorfunction). + The function argument handles are automatically disposed when the function returns. If you want to retain a handle beyond the end of the function, you can call [Lifetime#dup](Lifetime.md#dup) to create a copy of the handle that you own @@ -1139,23 +1189,102 @@ someNativeAsyncFunction().then(deferred.resolve) return deferred.handle ``` -#### Parameters +##### Parameters -• **name**: `string` +• **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Implementation of + +[`quickjs-emscripten.LowLevelJavascriptVm.newFunction`](../interfaces/LowLevelJavascriptVm.md#newfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:612](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L612) + +#### newFunction(name, fn) + +> **newFunction**(`name`, `fn`): [`QuickJSHandle`](../exports.md#quickjshandle) + +##### Parameters + +• **name**: `undefined` \| `string` • **fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +##### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +##### Implementation of + +`LowLevelJavascriptVm.newFunction` + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:613](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L613) + +*** + +### newFunctionWithOptions() + +> **newFunctionWithOptions**(`args`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Lower-level API for creating functions. +See [newFunction](QuickJSContext.md#newfunction) for more details on how to use functions. + +#### Parameters + +• **args**: `Object` + +• **args\.fn**: [`VmFunctionImplementation`](../exports.md#vmfunctionimplementationvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +• **args\.isConstructor**: `boolean` + +• **args\.length**: `number` + +• **args\.name**: `undefined` \| `string` + #### Returns [`QuickJSHandle`](../exports.md#quickjshandle) -#### Implementation of +#### Source -[`quickjs-emscripten.LowLevelJavascriptVm.newFunction`](../interfaces/LowLevelJavascriptVm.md#newfunction) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) + +*** + +### newHostRef() + +> **newHostRef**\<`T`\>(`value`): `HostRef`\<`T`\> + +Create an opaque handle object that stores a reference to a host JavaScript object. + +The guest cannot access the host object directly, but you may use +getHostRef to convert a HostRef handle back into a HostRef`` from +inside a function implementation. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **value**: `T` + +#### Returns + +`HostRef`\<`T`\> #### Source -[packages/quickjs-emscripten-core/src/context.ts:601](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L601) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -1179,7 +1308,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:347](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L347) +[packages/quickjs-emscripten-core/src/context.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L356) *** @@ -1206,7 +1335,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L416) +[packages/quickjs-emscripten-core/src/context.ts:425](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L425) *** @@ -1227,7 +1356,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:451](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L451) +[packages/quickjs-emscripten-core/src/context.ts:460](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L460) #### newPromise(promise) @@ -1249,7 +1378,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:459](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L459) +[packages/quickjs-emscripten-core/src/context.ts:468](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L468) #### newPromise(newPromiseFn) @@ -1270,7 +1399,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:466](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L466) +[packages/quickjs-emscripten-core/src/context.ts:475](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L475) *** @@ -1294,7 +1423,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:354](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L354) +[packages/quickjs-emscripten-core/src/context.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L363) *** @@ -1315,7 +1444,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:377](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L377) +[packages/quickjs-emscripten-core/src/context.ts:386](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L386) *** @@ -1336,7 +1465,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:365](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L365) +[packages/quickjs-emscripten-core/src/context.ts:374](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L374) *** @@ -1364,7 +1493,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:754](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L754) +[packages/quickjs-emscripten-core/src/context.ts:875](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L875) *** @@ -1387,7 +1516,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:819](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L819) +[packages/quickjs-emscripten-core/src/context.ts:940](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L940) *** @@ -1410,7 +1539,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:827](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L827) +[packages/quickjs-emscripten-core/src/context.ts:948](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L948) *** @@ -1447,7 +1576,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:985](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L985) +[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1469,7 +1598,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) +[packages/quickjs-emscripten-core/src/context.ts:1535](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1535) *** @@ -1489,7 +1618,33 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1193) +[packages/quickjs-emscripten-core/src/context.ts:1314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1314) + +*** + +### toHostRef() + +> **toHostRef**\<`T`\>(`handle`): `undefined` \| `HostRef`\<`T`\> + +If `handle` is a `HostRef.handle`, return a new `HostRef` instance wrapping the handle. + +You must call [HostRef#dispose]([object Object]) or otherwise consume the [HostRef#handle]([object Object]) to ensure the handle is not leaked. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `HostRef`\<`T`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:732](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L732) *** @@ -1517,7 +1672,35 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:643](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L643) +[packages/quickjs-emscripten-core/src/context.ts:764](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L764) + +*** + +### unwrapHostRef() + +> **unwrapHostRef**\<`T`\>(`handle`): `T` + +If `handle` is a `HostRef.handle`, return the host value `T`. + +#### Type parameters + +• **T** extends `object` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`T` + +#### Throws + +QuickJSHostRefInvalid if `handle` is not a `HostRef.handle` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:747](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L747) *** @@ -1544,7 +1727,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -[packages/quickjs-emscripten-core/src/context.ts:1277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1277) +[packages/quickjs-emscripten-core/src/context.ts:1398](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1398) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSRuntime.md b/doc/quickjs-emscripten/classes/QuickJSRuntime.md index a6c48a828..7c9199406 100644 --- a/doc/quickjs-emscripten/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSRuntime.md @@ -79,7 +79,7 @@ A context here may be allocated if one is needed by the runtime, eg for [compute #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L78) +[packages/quickjs-emscripten-core/src/runtime.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L79) ## Accessors @@ -97,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[packages/quickjs-emscripten-core/src/runtime.ts:128](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L128) ## Methods @@ -145,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) +[packages/quickjs-emscripten-core/src/runtime.ts:330](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L330) *** @@ -165,7 +165,7 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSRuntime.md#d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) +[packages/quickjs-emscripten-core/src/runtime.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L299) *** @@ -188,7 +188,7 @@ manipulation if debug logging is disabled. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:363](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L363) +[packages/quickjs-emscripten-core/src/runtime.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L366) *** @@ -212,7 +212,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) +[packages/quickjs-emscripten-core/src/runtime.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L132) *** @@ -229,7 +229,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSRun #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) +[packages/quickjs-emscripten-core/src/runtime.ts:310](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L310) *** @@ -263,7 +263,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) +[packages/quickjs-emscripten-core/src/runtime.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L246) *** @@ -282,7 +282,7 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) +[packages/quickjs-emscripten-core/src/runtime.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L197) *** @@ -298,7 +298,7 @@ true if debug logging is enabled #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L353) +[packages/quickjs-emscripten-core/src/runtime.ts:356](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L356) *** @@ -322,7 +322,7 @@ You should dispose a created context before disposing this runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L140) +[packages/quickjs-emscripten-core/src/runtime.ts:143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L143) *** @@ -339,7 +339,7 @@ See [setInterruptHandler](QuickJSRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) +[packages/quickjs-emscripten-core/src/runtime.ts:222](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L222) *** @@ -355,7 +355,7 @@ Remove the the loader set by [setModuleLoader](QuickJSRuntime.md#setmoduleloader #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) +[packages/quickjs-emscripten-core/src/runtime.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L184) *** @@ -378,7 +378,7 @@ code. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L343) +[packages/quickjs-emscripten-core/src/runtime.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L346) *** @@ -402,7 +402,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSRuntim #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) +[packages/quickjs-emscripten-core/src/runtime.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L210) *** @@ -423,7 +423,7 @@ To remove the limit, set to `0`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:315](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L315) +[packages/quickjs-emscripten-core/src/runtime.ts:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L318) *** @@ -444,7 +444,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) +[packages/quickjs-emscripten-core/src/runtime.ts:284](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L284) *** @@ -469,7 +469,7 @@ The loader can be removed with [removeModuleLoader](QuickJSRuntime.md#removemodu #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L172) +[packages/quickjs-emscripten-core/src/runtime.ts:175](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L175) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSWASMModule.md b/doc/quickjs-emscripten/classes/QuickJSWASMModule.md index 160016779..8e49ce59d 100644 --- a/doc/quickjs-emscripten/classes/QuickJSWASMModule.md +++ b/doc/quickjs-emscripten/classes/QuickJSWASMModule.md @@ -81,7 +81,7 @@ with name `"InternalError"` and message `"interrupted"`. #### Source -[packages/quickjs-emscripten-core/src/module.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L395) +[packages/quickjs-emscripten-core/src/module.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L410) *** @@ -101,7 +101,7 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) +[packages/quickjs-emscripten-core/src/module.ts:441](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L441) *** @@ -123,7 +123,7 @@ be disposed when the context is disposed. #### Source -[packages/quickjs-emscripten-core/src/module.ts:360](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L360) +[packages/quickjs-emscripten-core/src/module.ts:375](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L375) *** @@ -145,7 +145,7 @@ loading for one or more [QuickJSContext](QuickJSContext.md)s inside the runtime. #### Source -[packages/quickjs-emscripten-core/src/module.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L333) +[packages/quickjs-emscripten-core/src/module.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L346) *** diff --git a/doc/quickjs-emscripten/classes/StaticLifetime.md b/doc/quickjs-emscripten/classes/StaticLifetime.md index d8ce4a699..32d30ca3b 100644 --- a/doc/quickjs-emscripten/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten/classes/StaticLifetime.md @@ -28,6 +28,7 @@ A Lifetime that lives forever. Used for constants. - [value](StaticLifetime.md#value) - [Methods](StaticLifetime.md#methods) - [`[dispose]`()](StaticLifetime.md#dispose) + - [assertAlive()](StaticLifetime.md#assertalive) - [consume()](StaticLifetime.md#consume) - [dispose()](StaticLifetime.md#dispose) - [dup()](StaticLifetime.md#dup) @@ -257,6 +258,24 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten.Lifetime.assertAlive`](Lifetime.md#assertalive) + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten/classes/WeakLifetime.md b/doc/quickjs-emscripten/classes/WeakLifetime.md index eedbf4cd7..8190471f2 100644 --- a/doc/quickjs-emscripten/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten/classes/WeakLifetime.md @@ -32,6 +32,7 @@ Used for function arguments. - [value](WeakLifetime.md#value) - [Methods](WeakLifetime.md#methods) - [`[dispose]`()](WeakLifetime.md#dispose) + - [assertAlive()](WeakLifetime.md#assertalive) - [consume()](WeakLifetime.md#consume) - [dispose()](WeakLifetime.md#dispose) - [dup()](WeakLifetime.md#dup) @@ -267,6 +268,24 @@ Just calls the standard .dispose() method of this class. *** +### assertAlive() + +> **`protected`** **assertAlive**(): `void` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten.Lifetime.assertAlive`](Lifetime.md#assertalive) + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L182) + +*** + ### consume() #### consume(map) diff --git a/doc/quickjs-emscripten/exports.md b/doc/quickjs-emscripten/exports.md index f1158d416..c43ec1b96 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -219,7 +219,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -packages/quickjs-ffi-types/dist/index.d.ts:538 +packages/quickjs-ffi-types/dist/index.d.ts:547 *** @@ -229,7 +229,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:538 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:332 +packages/quickjs-ffi-types/dist/index.d.ts:337 *** @@ -245,7 +245,7 @@ by the runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L35) +[packages/quickjs-emscripten-core/src/runtime.ts:36](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L36) *** @@ -270,7 +270,7 @@ Determines if a VM's execution should be interrupted. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:27](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L27) +[packages/quickjs-emscripten-core/src/runtime.ts:28](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L28) *** @@ -486,7 +486,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:145 +packages/quickjs-ffi-types/dist/index.d.ts:149 *** @@ -747,7 +747,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L68) +[packages/quickjs-emscripten-core/src/context.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L71) *** @@ -757,7 +757,7 @@ Property key for getting or setting a property on a handle with #### Source -packages/quickjs-ffi-types/dist/index.d.ts:537 +packages/quickjs-ffi-types/dist/index.d.ts:546 *** @@ -1033,7 +1033,7 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:94 +packages/quickjs-ffi-types/dist/index.d.ts:98 *** @@ -1075,7 +1075,7 @@ Bitfield options for QTS_GetOwnPropertyNames #### Source -packages/quickjs-ffi-types/dist/index.d.ts:154 +packages/quickjs-ffi-types/dist/index.d.ts:158 *** @@ -1153,7 +1153,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -packages/quickjs-ffi-types/dist/index.d.ts:122 +packages/quickjs-ffi-types/dist/index.d.ts:126 *** @@ -1177,7 +1177,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:122 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:168 +packages/quickjs-ffi-types/dist/index.d.ts:172 *** @@ -1201,7 +1201,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:168 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:145 +packages/quickjs-ffi-types/dist/index.d.ts:149 *** @@ -1280,7 +1280,7 @@ packages/variant-quickjs-wasmfile-release-sync/dist/index.d.ts:18 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:90 +packages/quickjs-ffi-types/dist/index.d.ts:94 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModule.md b/doc/quickjs-emscripten/interfaces/EmscriptenModule.md index 3ae98434e..2fb8fba3d 100644 --- a/doc/quickjs-emscripten/interfaces/EmscriptenModule.md +++ b/doc/quickjs-emscripten/interfaces/EmscriptenModule.md @@ -49,7 +49,7 @@ QuickJS. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:289 +packages/quickjs-ffi-types/dist/index.d.ts:293 *** @@ -59,7 +59,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:289 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -79,7 +79,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:281 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -89,7 +89,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:285 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -99,7 +99,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:285 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:286 +packages/quickjs-ffi-types/dist/index.d.ts:290 *** @@ -109,7 +109,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:286 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:283 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -119,7 +119,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:284 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -129,7 +129,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:284 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:288 +packages/quickjs-ffi-types/dist/index.d.ts:292 *** @@ -149,7 +149,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:288 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:287 +packages/quickjs-ffi-types/dist/index.d.ts:291 *** @@ -165,7 +165,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -181,7 +181,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:252 ## Methods @@ -204,7 +204,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -222,7 +222,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -240,7 +240,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -273,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -299,7 +299,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:254 *** @@ -317,7 +317,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:250 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -361,7 +361,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:242 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -385,7 +385,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:256 *** @@ -410,7 +410,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +packages/quickjs-ffi-types/dist/index.d.ts:273 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md index 5a7ed44d7..2e09fe34c 100644 --- a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md +++ b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md @@ -22,7 +22,7 @@ ## Source -packages/quickjs-ffi-types/dist/index.d.ts:334 +packages/quickjs-ffi-types/dist/index.d.ts:339 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md index a13ee856e..d87ea2daa 100644 --- a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md +++ b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md @@ -35,7 +35,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -47,7 +47,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:252 ## Methods @@ -69,7 +69,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:254 *** @@ -109,7 +109,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:242 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -129,7 +129,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:256 *** diff --git a/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md b/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md index ad467e4ff..463554f6c 100644 --- a/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md +++ b/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md @@ -27,7 +27,7 @@ To remove the limit, set to `0`. #### Source -[packages/quickjs-emscripten-core/src/module.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L82) +[packages/quickjs-emscripten-core/src/module.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L85) *** @@ -39,7 +39,7 @@ Memory limit, in bytes, of WebAssembly heap memory used by the QuickJS VM. #### Source -[packages/quickjs-emscripten-core/src/module.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L76) +[packages/quickjs-emscripten-core/src/module.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L79) *** @@ -51,7 +51,7 @@ Module loader for any `import` statements or expressions. #### Source -[packages/quickjs-emscripten-core/src/module.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L87) +[packages/quickjs-emscripten-core/src/module.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L90) *** @@ -64,7 +64,7 @@ See [shouldInterruptAfterDeadline](../exports.md#shouldinterruptafterdeadline). #### Source -[packages/quickjs-emscripten-core/src/module.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L71) +[packages/quickjs-emscripten-core/src/module.ts:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L74) *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md index 3818ee385..9ef15e012 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:289 +packages/quickjs-ffi-types/dist/index.d.ts:293 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:289 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:281 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:285 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:285 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:286 +packages/quickjs-ffi-types/dist/index.d.ts:290 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:286 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:283 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:284 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:284 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:288 +packages/quickjs-ffi-types/dist/index.d.ts:292 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:288 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:287 +packages/quickjs-ffi-types/dist/index.d.ts:291 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:287 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:330 +packages/quickjs-ffi-types/dist/index.d.ts:335 *** @@ -219,7 +219,7 @@ Implement this field #### Source -packages/quickjs-ffi-types/dist/index.d.ts:329 +packages/quickjs-ffi-types/dist/index.d.ts:334 *** @@ -235,7 +235,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -251,7 +251,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:252 ## Methods @@ -278,7 +278,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -300,7 +300,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -322,7 +322,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -359,7 +359,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -385,7 +385,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:254 *** @@ -407,7 +407,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:250 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -451,7 +451,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:242 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -475,7 +475,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:256 *** @@ -504,7 +504,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +packages/quickjs-ffi-types/dist/index.d.ts:273 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md index 0d45618c4..6ddff62b8 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md @@ -41,6 +41,7 @@ library. - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSAsyncFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) @@ -64,6 +65,7 @@ library. - [QTS\_NewError](QuickJSAsyncFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSAsyncFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSAsyncFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSAsyncFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSAsyncFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSAsyncFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSAsyncFFI.md#qts-newpromisecapability) @@ -105,7 +107,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:424 +packages/quickjs-ffi-types/dist/index.d.ts:431 *** @@ -125,7 +127,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:424 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:493 +packages/quickjs-ffi-types/dist/index.d.ts:502 *** @@ -139,7 +141,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:493 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:491 +packages/quickjs-ffi-types/dist/index.d.ts:500 *** @@ -153,7 +155,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:491 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:490 +packages/quickjs-ffi-types/dist/index.d.ts:499 *** @@ -167,7 +169,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:490 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:431 +packages/quickjs-ffi-types/dist/index.d.ts:438 *** @@ -193,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:472 +packages/quickjs-ffi-types/dist/index.d.ts:481 *** @@ -219,7 +221,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:472 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:473 +packages/quickjs-ffi-types/dist/index.d.ts:482 *** @@ -253,7 +255,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:473 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:469 +packages/quickjs-ffi-types/dist/index.d.ts:478 *** @@ -273,7 +275,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:469 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:475 +packages/quickjs-ffi-types/dist/index.d.ts:484 *** @@ -293,7 +295,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:475 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:476 +packages/quickjs-ffi-types/dist/index.d.ts:485 *** @@ -313,7 +315,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:476 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:445 +packages/quickjs-ffi-types/dist/index.d.ts:454 *** @@ -341,7 +343,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:445 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:477 +packages/quickjs-ffi-types/dist/index.d.ts:486 *** @@ -369,7 +371,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:477 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:478 +packages/quickjs-ffi-types/dist/index.d.ts:487 *** @@ -391,7 +393,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:478 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:461 +packages/quickjs-ffi-types/dist/index.d.ts:470 *** @@ -413,7 +415,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:461 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:462 +packages/quickjs-ffi-types/dist/index.d.ts:471 *** @@ -433,7 +435,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:462 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:444 +packages/quickjs-ffi-types/dist/index.d.ts:453 *** @@ -451,7 +453,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:444 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:440 +packages/quickjs-ffi-types/dist/index.d.ts:449 *** @@ -469,7 +471,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:440 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:438 +packages/quickjs-ffi-types/dist/index.d.ts:447 *** @@ -489,7 +491,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:441 +packages/quickjs-ffi-types/dist/index.d.ts:450 *** @@ -509,7 +511,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:441 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:442 +packages/quickjs-ffi-types/dist/index.d.ts:451 *** @@ -529,7 +531,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:443 +packages/quickjs-ffi-types/dist/index.d.ts:452 *** @@ -549,7 +551,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:454 +packages/quickjs-ffi-types/dist/index.d.ts:463 *** @@ -569,7 +571,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:454 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:455 +packages/quickjs-ffi-types/dist/index.d.ts:464 *** @@ -587,7 +589,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:455 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:488 +packages/quickjs-ffi-types/dist/index.d.ts:497 *** @@ -601,7 +603,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:488 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:435 +packages/quickjs-ffi-types/dist/index.d.ts:442 *** @@ -621,7 +623,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:451 +packages/quickjs-ffi-types/dist/index.d.ts:460 *** @@ -639,7 +641,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:451 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:483 +packages/quickjs-ffi-types/dist/index.d.ts:492 + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Returns + +`HostRefId` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:445 *** @@ -661,7 +681,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:483 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:481 +packages/quickjs-ffi-types/dist/index.d.ts:490 *** @@ -681,7 +701,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:481 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:479 +packages/quickjs-ffi-types/dist/index.d.ts:488 *** @@ -695,7 +715,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:479 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:434 +packages/quickjs-ffi-types/dist/index.d.ts:441 *** @@ -721,7 +741,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:434 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:470 +packages/quickjs-ffi-types/dist/index.d.ts:479 *** @@ -747,7 +767,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:470 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:471 +packages/quickjs-ffi-types/dist/index.d.ts:480 *** @@ -769,7 +789,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:471 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:463 +packages/quickjs-ffi-types/dist/index.d.ts:472 *** @@ -791,7 +811,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:463 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:465 +packages/quickjs-ffi-types/dist/index.d.ts:474 *** @@ -813,7 +833,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:465 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:466 +packages/quickjs-ffi-types/dist/index.d.ts:475 *** @@ -835,7 +855,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:466 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:464 +packages/quickjs-ffi-types/dist/index.d.ts:473 *** @@ -855,7 +875,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:464 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:453 +packages/quickjs-ffi-types/dist/index.d.ts:462 *** @@ -875,7 +895,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:453 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:457 +packages/quickjs-ffi-types/dist/index.d.ts:466 *** @@ -895,7 +915,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:458 +packages/quickjs-ffi-types/dist/index.d.ts:467 *** @@ -909,7 +929,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:458 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:436 +packages/quickjs-ffi-types/dist/index.d.ts:443 *** @@ -923,7 +943,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:436 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:433 +packages/quickjs-ffi-types/dist/index.d.ts:440 *** @@ -947,7 +967,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:482 +packages/quickjs-ffi-types/dist/index.d.ts:491 *** @@ -967,7 +987,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:482 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:459 +packages/quickjs-ffi-types/dist/index.d.ts:468 *** @@ -985,7 +1005,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:459 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:460 +packages/quickjs-ffi-types/dist/index.d.ts:469 *** @@ -1003,7 +1023,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:460 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:448 +packages/quickjs-ffi-types/dist/index.d.ts:457 *** @@ -1025,7 +1045,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:448 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:449 +packages/quickjs-ffi-types/dist/index.d.ts:458 *** @@ -1045,7 +1065,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:449 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:439 +packages/quickjs-ffi-types/dist/index.d.ts:448 *** @@ -1063,7 +1083,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:439 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:426 +packages/quickjs-ffi-types/dist/index.d.ts:433 *** @@ -1083,29 +1103,53 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:450 +packages/quickjs-ffi-types/dist/index.d.ts:459 *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:492 +packages/quickjs-ffi-types/dist/index.d.ts:501 + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:444 *** @@ -1123,7 +1167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:492 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:446 +packages/quickjs-ffi-types/dist/index.d.ts:455 *** @@ -1143,7 +1187,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:447 +packages/quickjs-ffi-types/dist/index.d.ts:456 *** @@ -1163,7 +1207,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:484 +packages/quickjs-ffi-types/dist/index.d.ts:493 *** @@ -1177,7 +1221,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:484 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:437 +packages/quickjs-ffi-types/dist/index.d.ts:446 *** @@ -1197,7 +1241,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:452 +packages/quickjs-ffi-types/dist/index.d.ts:461 *** @@ -1219,7 +1263,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:452 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:456 +packages/quickjs-ffi-types/dist/index.d.ts:465 *** @@ -1239,7 +1283,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:456 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:486 +packages/quickjs-ffi-types/dist/index.d.ts:495 *** @@ -1259,7 +1303,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:486 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:485 +packages/quickjs-ffi-types/dist/index.d.ts:494 *** @@ -1273,7 +1317,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:485 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:430 +packages/quickjs-ffi-types/dist/index.d.ts:437 *** @@ -1293,7 +1337,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:474 +packages/quickjs-ffi-types/dist/index.d.ts:483 *** @@ -1313,7 +1357,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:474 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:428 +packages/quickjs-ffi-types/dist/index.d.ts:435 *** @@ -1331,7 +1375,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:428 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:495 +packages/quickjs-ffi-types/dist/index.d.ts:504 *** @@ -1349,7 +1393,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:495 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:497 +packages/quickjs-ffi-types/dist/index.d.ts:506 *** @@ -1367,7 +1411,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:497 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:429 +packages/quickjs-ffi-types/dist/index.d.ts:436 *** @@ -1385,7 +1429,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:494 +packages/quickjs-ffi-types/dist/index.d.ts:503 *** @@ -1405,7 +1449,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:494 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:496 +packages/quickjs-ffi-types/dist/index.d.ts:505 *** @@ -1425,7 +1469,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:496 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:432 +packages/quickjs-ffi-types/dist/index.d.ts:439 *** @@ -1445,7 +1489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:432 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:427 +packages/quickjs-ffi-types/dist/index.d.ts:434 *** @@ -1465,7 +1509,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:427 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:489 +packages/quickjs-ffi-types/dist/index.d.ts:498 *** @@ -1489,7 +1533,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:489 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:467 +packages/quickjs-ffi-types/dist/index.d.ts:476 *** @@ -1513,7 +1557,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:467 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:468 +packages/quickjs-ffi-types/dist/index.d.ts:477 *** @@ -1531,7 +1575,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:468 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:487 +packages/quickjs-ffi-types/dist/index.d.ts:496 *** @@ -1551,7 +1595,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:487 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:425 +packages/quickjs-ffi-types/dist/index.d.ts:432 *** @@ -1571,7 +1615,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:425 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:480 +packages/quickjs-ffi-types/dist/index.d.ts:489 *** @@ -1591,7 +1635,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:480 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:499 +packages/quickjs-ffi-types/dist/index.d.ts:508 *** @@ -1611,7 +1655,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:499 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:498 +packages/quickjs-ffi-types/dist/index.d.ts:507 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md index 20da37113..8063569c8 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md @@ -36,7 +36,7 @@ build variant to [newQuickJSWASMModule](../exports.md#newquickjswasmmodule) or [ #### Source -packages/quickjs-ffi-types/dist/index.d.ts:534 +packages/quickjs-ffi-types/dist/index.d.ts:543 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:534 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:535 +packages/quickjs-ffi-types/dist/index.d.ts:544 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:535 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:533 +packages/quickjs-ffi-types/dist/index.d.ts:542 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md index 8220ecd3f..56dab5a93 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md @@ -55,7 +55,7 @@ QuickJS. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:289 +packages/quickjs-ffi-types/dist/index.d.ts:293 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:289 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:281 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:285 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:285 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:286 +packages/quickjs-ffi-types/dist/index.d.ts:290 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:286 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:283 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:284 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:284 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:288 +packages/quickjs-ffi-types/dist/index.d.ts:292 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:288 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:287 +packages/quickjs-ffi-types/dist/index.d.ts:291 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:287 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:325 +packages/quickjs-ffi-types/dist/index.d.ts:330 *** @@ -215,7 +215,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:325 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:324 +packages/quickjs-ffi-types/dist/index.d.ts:329 *** @@ -231,7 +231,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -247,7 +247,7 @@ If provided, use this WebAssembly.Memory instead of an automatically created one #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:252 ## Methods @@ -274,7 +274,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -296,7 +296,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -318,7 +318,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -355,7 +355,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -381,7 +381,7 @@ Create an instance of the WASM module, call onSuccess(instance), then return ins #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:254 *** @@ -403,7 +403,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:250 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -447,7 +447,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:242 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -471,7 +471,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:256 *** @@ -500,7 +500,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +packages/quickjs-ffi-types/dist/index.d.ts:273 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md index 0239d3df2..43fb7f948 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md @@ -37,6 +37,7 @@ library. - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetHostRefId](QuickJSFFI.md#qts-gethostrefid) - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) @@ -56,6 +57,7 @@ library. - [QTS\_NewError](QuickJSFFI.md#qts-newerror) - [QTS\_NewFloat64](QuickJSFFI.md#qts-newfloat64) - [QTS\_NewFunction](QuickJSFFI.md#qts-newfunction) + - [QTS\_NewHostRef](QuickJSFFI.md#qts-newhostref) - [QTS\_NewObject](QuickJSFFI.md#qts-newobject) - [QTS\_NewObjectProto](QuickJSFFI.md#qts-newobjectproto) - [QTS\_NewPromiseCapability](QuickJSFFI.md#qts-newpromisecapability) @@ -96,7 +98,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:346 +packages/quickjs-ffi-types/dist/index.d.ts:351 *** @@ -116,7 +118,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:346 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:406 +packages/quickjs-ffi-types/dist/index.d.ts:413 *** @@ -130,7 +132,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:406 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:404 +packages/quickjs-ffi-types/dist/index.d.ts:411 *** @@ -144,7 +146,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:404 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:403 +packages/quickjs-ffi-types/dist/index.d.ts:410 *** @@ -158,7 +160,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:403 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:353 +packages/quickjs-ffi-types/dist/index.d.ts:358 *** @@ -184,7 +186,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:353 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:388 +packages/quickjs-ffi-types/dist/index.d.ts:395 *** @@ -218,7 +220,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:388 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:386 +packages/quickjs-ffi-types/dist/index.d.ts:393 *** @@ -238,7 +240,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:386 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +packages/quickjs-ffi-types/dist/index.d.ts:397 *** @@ -258,7 +260,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:390 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:367 +packages/quickjs-ffi-types/dist/index.d.ts:374 *** @@ -286,7 +288,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:367 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:391 +packages/quickjs-ffi-types/dist/index.d.ts:398 *** @@ -308,7 +310,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:391 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:382 +packages/quickjs-ffi-types/dist/index.d.ts:389 *** @@ -328,7 +330,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:382 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:366 +packages/quickjs-ffi-types/dist/index.d.ts:373 *** @@ -346,7 +348,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:366 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:362 +packages/quickjs-ffi-types/dist/index.d.ts:369 *** @@ -364,7 +366,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:362 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:360 +packages/quickjs-ffi-types/dist/index.d.ts:367 *** @@ -384,7 +386,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:360 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:363 +packages/quickjs-ffi-types/dist/index.d.ts:370 *** @@ -404,7 +406,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:363 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:364 +packages/quickjs-ffi-types/dist/index.d.ts:371 *** @@ -424,7 +426,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:364 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:365 +packages/quickjs-ffi-types/dist/index.d.ts:372 *** @@ -444,7 +446,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:365 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:376 +packages/quickjs-ffi-types/dist/index.d.ts:383 *** @@ -464,7 +466,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:376 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:377 +packages/quickjs-ffi-types/dist/index.d.ts:384 *** @@ -482,7 +484,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:377 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:401 +packages/quickjs-ffi-types/dist/index.d.ts:408 *** @@ -496,7 +498,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:401 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:357 +packages/quickjs-ffi-types/dist/index.d.ts:362 *** @@ -516,7 +518,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:357 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:373 +packages/quickjs-ffi-types/dist/index.d.ts:380 *** @@ -534,7 +536,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:373 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:396 +packages/quickjs-ffi-types/dist/index.d.ts:403 + +*** + +### QTS\_GetHostRefId + +> **QTS\_GetHostRefId**: (`value`) => `HostRefId` + +#### Parameters + +• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Returns + +`HostRefId` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:365 *** @@ -556,7 +576,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:396 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:394 +packages/quickjs-ffi-types/dist/index.d.ts:401 *** @@ -576,7 +596,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:394 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:392 +packages/quickjs-ffi-types/dist/index.d.ts:399 *** @@ -590,7 +610,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:392 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:356 +packages/quickjs-ffi-types/dist/index.d.ts:361 *** @@ -616,7 +636,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:356 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:387 +packages/quickjs-ffi-types/dist/index.d.ts:394 *** @@ -638,7 +658,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:387 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:383 +packages/quickjs-ffi-types/dist/index.d.ts:390 *** @@ -660,7 +680,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:383 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:384 +packages/quickjs-ffi-types/dist/index.d.ts:391 *** @@ -680,7 +700,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:384 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:375 +packages/quickjs-ffi-types/dist/index.d.ts:382 *** @@ -700,7 +720,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:375 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:379 +packages/quickjs-ffi-types/dist/index.d.ts:386 *** @@ -714,7 +734,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:379 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:358 +packages/quickjs-ffi-types/dist/index.d.ts:363 *** @@ -728,7 +748,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:358 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:355 +packages/quickjs-ffi-types/dist/index.d.ts:360 *** @@ -752,7 +772,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:355 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:395 +packages/quickjs-ffi-types/dist/index.d.ts:402 *** @@ -772,7 +792,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:395 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:380 +packages/quickjs-ffi-types/dist/index.d.ts:387 *** @@ -790,7 +810,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:380 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:381 +packages/quickjs-ffi-types/dist/index.d.ts:388 *** @@ -808,7 +828,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:381 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:370 +packages/quickjs-ffi-types/dist/index.d.ts:377 *** @@ -830,7 +850,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:370 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:371 +packages/quickjs-ffi-types/dist/index.d.ts:378 *** @@ -850,7 +870,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:371 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:361 +packages/quickjs-ffi-types/dist/index.d.ts:368 *** @@ -868,7 +888,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:361 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:348 +packages/quickjs-ffi-types/dist/index.d.ts:353 *** @@ -888,29 +908,53 @@ packages/quickjs-ffi-types/dist/index.d.ts:348 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:372 +packages/quickjs-ffi-types/dist/index.d.ts:379 *** ### QTS\_NewFunction -> **QTS\_NewFunction**: (`ctx`, `func_id`, `name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) +> **QTS\_NewFunction**: (`ctx`, `name`, `arg_length`, `is_constructor`, `host_ref_id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) #### Parameters • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_id**: `number` - • **name**: `string` +• **arg\_length**: `number` + +• **is\_constructor**: `boolean` + +• **host\_ref\_id**: `HostRefId` + #### Returns [`JSValuePointer`](../exports.md#jsvaluepointer) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:405 +packages/quickjs-ffi-types/dist/index.d.ts:412 + +*** + +### QTS\_NewHostRef + +> **QTS\_NewHostRef**: (`ctx`, `id`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **id**: `HostRefId` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:364 *** @@ -928,7 +972,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:405 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:368 +packages/quickjs-ffi-types/dist/index.d.ts:375 *** @@ -948,7 +992,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:368 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:369 +packages/quickjs-ffi-types/dist/index.d.ts:376 *** @@ -968,7 +1012,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:369 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:397 +packages/quickjs-ffi-types/dist/index.d.ts:404 *** @@ -982,7 +1026,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:397 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:359 +packages/quickjs-ffi-types/dist/index.d.ts:366 *** @@ -1002,7 +1046,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:359 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:374 +packages/quickjs-ffi-types/dist/index.d.ts:381 *** @@ -1024,7 +1068,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:374 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:378 +packages/quickjs-ffi-types/dist/index.d.ts:385 *** @@ -1044,7 +1088,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:378 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:399 +packages/quickjs-ffi-types/dist/index.d.ts:406 *** @@ -1064,7 +1108,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:399 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:398 +packages/quickjs-ffi-types/dist/index.d.ts:405 *** @@ -1078,7 +1122,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:398 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:352 +packages/quickjs-ffi-types/dist/index.d.ts:357 *** @@ -1098,7 +1142,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:352 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:389 +packages/quickjs-ffi-types/dist/index.d.ts:396 *** @@ -1118,7 +1162,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:389 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:350 +packages/quickjs-ffi-types/dist/index.d.ts:355 *** @@ -1136,7 +1180,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:408 +packages/quickjs-ffi-types/dist/index.d.ts:415 *** @@ -1154,7 +1198,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:408 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:410 +packages/quickjs-ffi-types/dist/index.d.ts:417 *** @@ -1172,7 +1216,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:410 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:351 +packages/quickjs-ffi-types/dist/index.d.ts:356 *** @@ -1190,7 +1234,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:351 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:407 +packages/quickjs-ffi-types/dist/index.d.ts:414 *** @@ -1210,7 +1254,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:407 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:409 +packages/quickjs-ffi-types/dist/index.d.ts:416 *** @@ -1230,7 +1274,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:409 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:354 +packages/quickjs-ffi-types/dist/index.d.ts:359 *** @@ -1250,7 +1294,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:354 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:349 +packages/quickjs-ffi-types/dist/index.d.ts:354 *** @@ -1270,7 +1314,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:349 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:402 +packages/quickjs-ffi-types/dist/index.d.ts:409 *** @@ -1294,7 +1338,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:402 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:385 +packages/quickjs-ffi-types/dist/index.d.ts:392 *** @@ -1312,7 +1356,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:385 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:400 +packages/quickjs-ffi-types/dist/index.d.ts:407 *** @@ -1332,7 +1376,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:400 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:347 +packages/quickjs-ffi-types/dist/index.d.ts:352 *** @@ -1352,7 +1396,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:347 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:393 +packages/quickjs-ffi-types/dist/index.d.ts:400 *** @@ -1372,7 +1416,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:412 +packages/quickjs-ffi-types/dist/index.d.ts:419 *** @@ -1392,7 +1436,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:412 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:411 +packages/quickjs-ffi-types/dist/index.d.ts:418 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md index 5f0cc9566..8c0b7fc62 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md @@ -36,7 +36,7 @@ build variant to [newQuickJSWASMModule](../exports.md#newquickjswasmmodule) or [ #### Source -packages/quickjs-ffi-types/dist/index.d.ts:520 +packages/quickjs-ffi-types/dist/index.d.ts:529 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:520 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:521 +packages/quickjs-ffi-types/dist/index.d.ts:530 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:521 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:519 +packages/quickjs-ffi-types/dist/index.d.ts:528 *** diff --git a/doc/quickjs-emscripten/interfaces/SourceMapData.md b/doc/quickjs-emscripten/interfaces/SourceMapData.md index f4318f17a..a8e914fd1 100644 --- a/doc/quickjs-emscripten/interfaces/SourceMapData.md +++ b/doc/quickjs-emscripten/interfaces/SourceMapData.md @@ -22,7 +22,7 @@ #### Source -packages/quickjs-ffi-types/dist/index.d.ts:205 +packages/quickjs-ffi-types/dist/index.d.ts:209 *** @@ -32,7 +32,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:205 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:204 +packages/quickjs-ffi-types/dist/index.d.ts:208 *** @@ -42,7 +42,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:204 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:203 +packages/quickjs-ffi-types/dist/index.d.ts:207 *** @@ -52,7 +52,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:203 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:202 +packages/quickjs-ffi-types/dist/index.d.ts:206 *** diff --git a/doc/quickjs-emscripten/namespaces/errors/README.md b/doc/quickjs-emscripten/namespaces/errors/README.md index 9b6039da0..9347cf277 100644 --- a/doc/quickjs-emscripten/namespaces/errors/README.md +++ b/doc/quickjs-emscripten/namespaces/errors/README.md @@ -16,6 +16,8 @@ Collects the informative errors this library may throw. - [QuickJSAsyncifySuspended](classes/QuickJSAsyncifySuspended.md) - [QuickJSEmptyGetOwnPropertyNames](classes/QuickJSEmptyGetOwnPropertyNames.md) - [QuickJSEmscriptenModuleError](classes/QuickJSEmscriptenModuleError.md) +- [QuickJSHostRefInvalid](classes/QuickJSHostRefInvalid.md) +- [QuickJSHostRefRangeExceeded](classes/QuickJSHostRefRangeExceeded.md) - [QuickJSMemoryLeakDetected](classes/QuickJSMemoryLeakDetected.md) - [QuickJSNotImplemented](classes/QuickJSNotImplemented.md) - [QuickJSPromisePending](classes/QuickJSPromisePending.md) diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefInvalid.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefInvalid.md new file mode 100644 index 000000000..bebe75a4f --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefInvalid.md @@ -0,0 +1,59 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten](../../../exports.md) / [errors](../README.md) / QuickJSHostRefInvalid + +# Class: QuickJSHostRefInvalid + +## Contents + +- [Extends](QuickJSHostRefInvalid.md#extends) +- [Constructors](QuickJSHostRefInvalid.md#constructors) + - [new QuickJSHostRefInvalid(message)](QuickJSHostRefInvalid.md#new-quickjshostrefinvalidmessage) +- [Properties](QuickJSHostRefInvalid.md#properties) + - [name](QuickJSHostRefInvalid.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSHostRefInvalid(message) + +> **new QuickJSHostRefInvalid**(`message`?): [`QuickJSHostRefInvalid`](QuickJSHostRefInvalid.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSHostRefInvalid`](QuickJSHostRefInvalid.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSHostRefInvalid"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L65) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md new file mode 100644 index 000000000..b4a1ce64a --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSHostRefRangeExceeded.md @@ -0,0 +1,59 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten](../../../exports.md) / [errors](../README.md) / QuickJSHostRefRangeExceeded + +# Class: QuickJSHostRefRangeExceeded + +## Contents + +- [Extends](QuickJSHostRefRangeExceeded.md#extends) +- [Constructors](QuickJSHostRefRangeExceeded.md#constructors) + - [new QuickJSHostRefRangeExceeded(message)](QuickJSHostRefRangeExceeded.md#new-quickjshostrefrangeexceededmessage) +- [Properties](QuickJSHostRefRangeExceeded.md#properties) + - [name](QuickJSHostRefRangeExceeded.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSHostRefRangeExceeded(message) + +> **new QuickJSHostRefRangeExceeded**(`message`?): [`QuickJSHostRefRangeExceeded`](QuickJSHostRefRangeExceeded.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSHostRefRangeExceeded`](QuickJSHostRefRangeExceeded.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSHostRefRangeExceeded"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L61) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index d2a19bdb0..9bc7c8a0d 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -13,6 +13,7 @@ import type { UInt32Pointer, JSValuePointerPointerPointer, JSVoidPointer, + HostRefId, } from "@jitl/quickjs-ffi-types" import type { JSPromiseState } from "./deferred-promise" import { QuickJSDeferredPromise } from "./deferred-promise" @@ -20,6 +21,7 @@ import { QuickJSDeferredPromise } from "./deferred-promise" import type { shouldInterruptAfterDeadline } from "./interrupt-helpers" import { QuickJSEmptyGetOwnPropertyNames, + QuickJSHostRefInvalid, QuickJSNotImplemented, QuickJSPromisePending, QuickJSUnwrapError, @@ -58,6 +60,7 @@ import type { VmPropertyDescriptor, } from "./vm-interface" import { QuickJSIterator } from "./QuickJSIterator" +import { HostRef } from "./host-ref" export type QuickJSContextResult = DisposableResult @@ -129,8 +132,14 @@ class ContextMemory extends ModuleMemory implements Disposable { return str } - heapValueHandle(ptr: JSValuePointer): JSValue { - return new Lifetime(ptr, this.copyJSValue, this.freeJSValue, this.owner) + heapValueHandle(ptr: JSValuePointer, extraDispose?: () => void): JSValue { + const dispose: typeof this.freeJSValue = extraDispose + ? (val) => { + extraDispose() + this.freeJSValue(val) + } + : this.freeJSValue + return new Lifetime(ptr, this.copyJSValue, dispose, this.owner) } /** Manage a heap pointer with the lifetime of the context */ @@ -512,6 +521,8 @@ export class QuickJSContext * value. A VmFunctionImplementation should also not retain any references to * its return value. * + * For constructors (functions that will be called with `new ...`), use {@link newConstructorFunction}. + * * The function argument handles are automatically disposed when the function * returns. If you want to retain a handle beyond the end of the function, you * can call {@link Lifetime#dup} to create a copy of the handle that you own @@ -598,10 +609,71 @@ export class QuickJSContext * return deferred.handle * ``` */ - newFunction(name: string, fn: VmFunctionImplementation): QuickJSHandle { - const fnId = ++this.fnNextId - this.setFunction(fnId, fn) - return this.memory.heapValueHandle(this.ffi.QTS_NewFunction(this.ctx.value, fnId, name)) + newFunction(fn: VmFunctionImplementation): QuickJSHandle + newFunction(name: string | undefined, fn: VmFunctionImplementation): QuickJSHandle + newFunction( + nameOrFn: string | undefined | VmFunctionImplementation, + maybeFn?: VmFunctionImplementation, + ): QuickJSHandle { + const fn = typeof nameOrFn === "function" ? nameOrFn : maybeFn + if (!fn) { + throw new TypeError("Expected a function") + } + + return this.newFunctionWithOptions({ + name: typeof nameOrFn === "string" ? nameOrFn : undefined, + length: fn.length, + isConstructor: false, + fn, + }) + } + + /** + * Convert a Javascript function into a QuickJS constructor function. + * See {@link newFunction} for more details. + */ + newConstructorFunction(fn: VmFunctionImplementation): QuickJSHandle + newConstructorFunction( + name: string | undefined, + fn: VmFunctionImplementation, + ): QuickJSHandle + newConstructorFunction( + nameOrFn: string | undefined | VmFunctionImplementation, + maybeFn?: VmFunctionImplementation, + ): QuickJSHandle { + const fn = typeof nameOrFn === "function" ? nameOrFn : maybeFn + if (!fn) { + throw new TypeError("Expected a function") + } + + return this.newFunctionWithOptions({ + name: typeof nameOrFn === "string" ? nameOrFn : undefined, + length: fn.length, + isConstructor: true, + fn, + }) + } + + /** + * Lower-level API for creating functions. + * See {@link newFunction} for more details on how to use functions. + */ + newFunctionWithOptions(args: { + name: string | undefined + length: number + isConstructor: boolean + fn: VmFunctionImplementation + }): QuickJSHandle { + const { name, length, isConstructor, fn } = args + const refId = this.runtime.hostRefs.put(fn) + try { + return this.memory.heapValueHandle( + this.ffi.QTS_NewFunction(this.ctx.value, name ?? "", length, isConstructor, refId), + ) + } catch (error) { + this.runtime.hostRefs.delete(refId) + throw error + } } newError(error: { name: string; message: string }): QuickJSHandle @@ -632,6 +704,55 @@ export class QuickJSContext return errorHandle } + /** + * Create an opaque handle object that stores a reference to a host JavaScript object. + * + * The guest cannot access the host object directly, but you may use + * {@link getHostRef} to convert a HostRef handle back into a HostRef from + * inside a function implementation. + * + * You must call {@link HostRef#dispose} or otherwise consume the {@link HostRef#handle} to ensure the handle is not leaked. + */ + newHostRef(value: T): HostRef { + const id = this.runtime.hostRefs.put(value) + try { + const handle = this.memory.heapValueHandle(this.ffi.QTS_NewHostRef(this.ctx.value, id)) + return new HostRef(this.runtime, handle, id) + } catch (error) { + this.runtime.hostRefs.delete(id) + throw error + } + } + + /** + * If `handle` is a `HostRef.handle`, return a new `HostRef` instance wrapping the handle. + * + * You must call {@link HostRef#dispose} or otherwise consume the {@link HostRef#handle} to ensure the handle is not leaked. + */ + toHostRef(handle: QuickJSHandle): HostRef | undefined { + const id = this.ffi.QTS_GetHostRefId(handle.value) + if (id === 0) { + return undefined + } + + // Assert id is valid + this.runtime.hostRefs.get(id) as T + return new HostRef(this.runtime, handle.dup(), id) + } + + /** + * If `handle` is a `HostRef.handle`, return the host value `T`. + * @throws {@link QuickJSHostRefInvalid} if `handle` is not a `HostRef.handle` + */ + unwrapHostRef(handle: QuickJSHandle): T { + const id = this.ffi.QTS_GetHostRefId(handle.value) + if (id === 0) { + throw new QuickJSHostRefInvalid("handle is not a HostRef") + } + + return this.runtime.hostRefs.get(id) as T + } + // Read values -------------------------------------------------------------- /** @@ -1313,29 +1434,12 @@ export class QuickJSContext } /** @private */ - protected fnNextId = -32768 // min value of signed 16bit int used by Quickjs - /** @private */ - protected fnMaps = new Map>>() - - /** @private */ - protected getFunction(fn_id: number): VmFunctionImplementation | undefined { - const map_id = fn_id >> 8 - const fnMap = this.fnMaps.get(map_id) - if (!fnMap) { - return undefined - } - return fnMap.get(fn_id) - } - - /** @private */ - protected setFunction(fn_id: number, handle: VmFunctionImplementation) { - const map_id = fn_id >> 8 - let fnMap = this.fnMaps.get(map_id) - if (!fnMap) { - fnMap = new Map>() - this.fnMaps.set(map_id, fnMap) + protected getFunction(fn_id: HostRefId): VmFunctionImplementation { + const fn = this.runtime.hostRefs.get(fn_id) + if (typeof fn !== "function") { + throw new Error(`Host reference ${fn_id} is not a function`) } - return fnMap.set(fn_id, handle) + return fn as VmFunctionImplementation } /** @@ -1348,11 +1452,6 @@ export class QuickJSContext } const fn = this.getFunction(fn_id) - if (!fn) { - // this "throw" is not catch-able from the TS side. could we somehow handle this higher up? - throw new Error(`QuickJSContext had no callback with id ${fn_id}`) - } - return Scope.withScopeMaybeAsync(this, function* (awaited, scope) { const thisHandle = scope.manage( new WeakLifetime( diff --git a/packages/quickjs-emscripten-core/src/errors.ts b/packages/quickjs-emscripten-core/src/errors.ts index af491e54c..510207431 100644 --- a/packages/quickjs-emscripten-core/src/errors.ts +++ b/packages/quickjs-emscripten-core/src/errors.ts @@ -56,3 +56,11 @@ export class QuickJSPromisePending extends Error { export class QuickJSEmptyGetOwnPropertyNames extends Error { name = "QuickJSEmptyGetOwnPropertyNames" } + +export class QuickJSHostRefRangeExceeded extends Error { + name = "QuickJSHostRefRangeExceeded" +} + +export class QuickJSHostRefInvalid extends Error { + name = "QuickJSHostRefInvalid" +} diff --git a/packages/quickjs-emscripten-core/src/host-ref.test.ts b/packages/quickjs-emscripten-core/src/host-ref.test.ts new file mode 100644 index 000000000..cc0028733 --- /dev/null +++ b/packages/quickjs-emscripten-core/src/host-ref.test.ts @@ -0,0 +1,237 @@ +import assert from "assert" +import { describe, it } from "vitest" +import { HostRefMap, INVALID_HOST_REF_ID } from "./host-ref" +import { QuickJSHostRefInvalid, QuickJSHostRefRangeExceeded } from "./errors" + +const INT32_MAX = 2147483647 + +describe("HostRefMap", () => { + describe("put", () => { + it("stores a value and returns an ID", () => { + const map = new HostRefMap() + const value = { name: "test" } + const id = map.put(value) + assert.notStrictEqual(id, INVALID_HOST_REF_ID) + assert.strictEqual(typeof id, "number") + }) + + it("returns unique IDs for different values", () => { + const map = new HostRefMap() + const id1 = map.put({ a: 1 }) + const id2 = map.put({ b: 2 }) + const id3 = map.put({ c: 3 }) + assert.notStrictEqual(id1, id2) + assert.notStrictEqual(id2, id3) + assert.notStrictEqual(id1, id3) + }) + + it("never returns INVALID_HOST_REF_ID (0)", () => { + const map = new HostRefMap() + const ids: number[] = [] + // Allocate enough IDs to potentially hit 0 if the implementation is wrong + for (let i = 0; i < 1000; i++) { + ids.push(map.put({ i })) + } + assert.ok(!ids.includes(INVALID_HOST_REF_ID)) + }) + }) + + describe("get", () => { + it("retrieves a stored value by ID", () => { + const map = new HostRefMap() + const value = { name: "test" } + const id = map.put(value) + const retrieved = map.get(id) + assert.strictEqual(retrieved, value) + }) + + it("throws QuickJSHostRefInvalid for INVALID_HOST_REF_ID", () => { + const map = new HostRefMap() + assert.throws( + () => map.get(INVALID_HOST_REF_ID), + (err) => + err instanceof QuickJSHostRefInvalid && + err.message.includes("no host reference id defined"), + ) + }) + + it("throws QuickJSHostRefInvalid for non-existent ID", () => { + const map = new HostRefMap() + assert.throws( + () => map.get(12345 as any), + (err) => err instanceof QuickJSHostRefInvalid && err.message.includes("is not defined"), + ) + }) + + it("throws QuickJSHostRefInvalid after value is deleted", () => { + const map = new HostRefMap() + const id = map.put({ value: "test" }) + map.delete(id) + assert.throws( + () => map.get(id), + (err) => err instanceof QuickJSHostRefInvalid, + ) + }) + }) + + describe("delete", () => { + it("removes the value from the map", () => { + const map = new HostRefMap() + const value = { name: "test" } + const id = map.put(value) + map.delete(id) + assert.throws(() => map.get(id), QuickJSHostRefInvalid) + }) + + it("throws QuickJSHostRefInvalid for INVALID_HOST_REF_ID", () => { + const map = new HostRefMap() + assert.throws( + () => map.delete(INVALID_HOST_REF_ID), + (err) => + err instanceof QuickJSHostRefInvalid && + err.message.includes("no host reference id defined"), + ) + }) + + it("throws QuickJSHostRefInvalid for non-existent ID", () => { + const map = new HostRefMap() + assert.throws( + () => map.delete(99999 as any), + (err) => err instanceof QuickJSHostRefInvalid && err.message.includes("is not defined"), + ) + }) + + it("allows deleting the same ID only once", () => { + const map = new HostRefMap() + const id = map.put({ value: "test" }) + map.delete(id) + assert.throws(() => map.delete(id), QuickJSHostRefInvalid) + }) + }) + + describe("ID recycling (freelist)", () => { + it("reuses deleted IDs", () => { + const map = new HostRefMap() + const id1 = map.put({ first: true }) + map.delete(id1) + const id2 = map.put({ second: true }) + // The deleted ID should be reused + assert.strictEqual(id1, id2) + }) + + it("reuses IDs in FIFO order", () => { + const map = new HostRefMap() + const id1 = map.put({ a: 1 }) + const id2 = map.put({ b: 2 }) + const id3 = map.put({ c: 3 }) + + map.delete(id1) + map.delete(id2) + + // Should reuse id1 first (FIFO) + const newId1 = map.put({ d: 4 }) + assert.strictEqual(newId1, id1) + + // Should reuse id2 next + const newId2 = map.put({ e: 5 }) + assert.strictEqual(newId2, id2) + + // Should allocate new ID + const newId3 = map.put({ f: 6 }) + assert.notStrictEqual(newId3, id1) + assert.notStrictEqual(newId3, id2) + assert.notStrictEqual(newId3, id3) + }) + + it("recycled ID correctly stores new value", () => { + const map = new HostRefMap() + const oldValue = { old: true } + const newValue = { new: true } + + const id = map.put(oldValue) + assert.strictEqual(map.get(id), oldValue) + + map.delete(id) + const reusedId = map.put(newValue) + + assert.strictEqual(id, reusedId) + assert.strictEqual(map.get(reusedId), newValue) + }) + }) + + describe("multiple values", () => { + it("stores and retrieves multiple distinct values", () => { + const map = new HostRefMap() + const values = [{ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 }, { e: 5 }] + const ids = values.map((v) => map.put(v)) + + for (let i = 0; i < values.length; i++) { + assert.strictEqual(map.get(ids[i]), values[i]) + } + }) + + it("deleting one value does not affect others", () => { + const map = new HostRefMap() + const value1 = { first: true } + const value2 = { second: true } + const value3 = { third: true } + + const id1 = map.put(value1) + const id2 = map.put(value2) + const id3 = map.put(value3) + + map.delete(id2) + + assert.strictEqual(map.get(id1), value1) + assert.throws(() => map.get(id2), QuickJSHostRefInvalid) + assert.strictEqual(map.get(id3), value3) + }) + }) + + describe("group cleanup", () => { + it("cleans up empty groups when last entry is deleted", () => { + const map = new HostRefMap() + // Access private groups for testing + const groups = (map as any).groups as Map> + + const id = map.put({ test: true }) + const groupId = id >> 8 + + assert.ok(groups.has(groupId), "group should exist after put") + map.delete(id) + assert.ok(!groups.has(groupId), "group should be deleted when empty") + }) + }) + + describe("range exceeded", () => { + it("throws QuickJSHostRefRangeExceeded when all IDs are exhausted", () => { + const map = new HostRefMap() + // Manipulate private nextId to be at the limit + ;(map as any).nextId = INT32_MAX + + // First allocation at INT32_MAX should succeed + const id = map.put({ final: true }) + assert.strictEqual(id, INT32_MAX) + + // Next allocation should throw + assert.throws( + () => map.put({ overflow: true }), + (err) => + err instanceof QuickJSHostRefRangeExceeded && + err.message.includes("too many host refs created"), + ) + }) + + it("can still use freelist even when range is exhausted", () => { + const map = new HostRefMap() + ;(map as any).nextId = INT32_MAX + + const id = map.put({ value: 1 }) + map.delete(id) + + // Should be able to reuse the freed ID + const reusedId = map.put({ value: 2 }) + assert.strictEqual(reusedId, id) + }) + }) +}) diff --git a/packages/quickjs-emscripten-core/src/host-ref.ts b/packages/quickjs-emscripten-core/src/host-ref.ts new file mode 100644 index 000000000..664f8c197 --- /dev/null +++ b/packages/quickjs-emscripten-core/src/host-ref.ts @@ -0,0 +1,137 @@ +import type { HostRefId } from "@jitl/quickjs-ffi-types" +import { QuickJSHostRefInvalid, QuickJSHostRefRangeExceeded } from "./errors" +import type { QuickJSHandle } from "./types" +import type { QuickJSRuntime } from "./runtime" +import { UsingDisposable } from "./lifetime" + +const INT32_MIN = -2147483648 +const INT32_MAX = 2147483647 +export const INVALID_HOST_REF_ID = 0 as HostRefId + +function getGroupId(id: HostRefId): number { + return id >> 8 +} + +/** + * HostRefMap stores references to host JavaScript based on an auto-incrementing id. + */ +export class HostRefMap { + private nextId = INT32_MIN + private freelist: HostRefId[] = [] + private groups = new Map>() + + put(value: object): HostRefId { + const id = this.allocateId() + const groupId = getGroupId(id) + let group = this.groups.get(groupId) + if (!group) { + group = new Map() + this.groups.set(groupId, group) + } + group.set(id, value) + return id + } + + get(id: HostRefId): object { + if (id === INVALID_HOST_REF_ID) { + throw new QuickJSHostRefInvalid("no host reference id defined") + } + + const groupId = getGroupId(id) + const group = this.groups.get(groupId) + if (!group) { + throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`) + } + + const value = group.get(id) + if (!value) { + throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`) + } + + return value + } + + delete(id: HostRefId): void { + if (id === INVALID_HOST_REF_ID) { + throw new QuickJSHostRefInvalid("no host reference id defined") + } + + const groupId = getGroupId(id) + const group = this.groups.get(groupId) + if (!group) { + throw new QuickJSHostRefInvalid(`host reference id ${id} is not defined`) + } + + group.delete(id) + if (group.size === 0) { + this.groups.delete(groupId) + } + + this.freelist.push(id) + } + + private allocateId(): HostRefId { + if (this.freelist.length > 0) { + return this.freelist.shift()! + } + + if (this.nextId === INVALID_HOST_REF_ID) { + this.nextId++ + } + + if (this.nextId > INT32_MAX) { + throw new QuickJSHostRefRangeExceeded( + `HostRefMap: too many host refs created without disposing. Max simultaneous host refs: ${ + INT32_MAX - INT32_MIN + }`, + ) + } + + return this.nextId++ as HostRefId + } +} + +/** + * HostRef represents a reference to a host value from a QuickJS guest. + * + * The host value is stored with a strong reference in a map within the runtime. + * Once all references to the HostRef's handle are disposed and there are no + * more references from the guest, the host value will be removed from the map. + * + * This abstraction allows passing values to the guest that need to keep a host + * value alive for their method callbacks. + * + * Note that there may be multiple HostRef instances pointing to the same host + * value slot in the runtime. + */ +export class HostRef extends UsingDisposable implements Disposable { + constructor( + public readonly runtime: QuickJSRuntime, + public readonly handle: QuickJSHandle, + public readonly id: HostRefId, + ) { + if (id === INVALID_HOST_REF_ID) { + throw new QuickJSHostRefInvalid("cannot create HostRef with undefined id") + } + + super() + } + + /** true if *this instance's* handle is alive */ + get alive(): boolean { + return this.handle.alive + } + + /** Dispose this instance's handle */ + dispose(): void { + this.handle.dispose() + } + + /** + * Retrieve the host value + * @throws {@link QuickJSHostRefInvalid} if the host value was freed once all reference handles were disposed + */ + get value(): T { + return this.runtime.hostRefs.get(this.id) as T + } +} diff --git a/packages/quickjs-emscripten-core/src/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 5b97e43b0..cdd1c1d49 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -179,7 +179,7 @@ export class Lifetime this._alive = false } - private assertAlive() { + protected assertAlive() { if (!this.alive) { if (this._constructorStack) { throw new QuickJSUseAfterFree( diff --git a/packages/quickjs-emscripten-core/src/module.ts b/packages/quickjs-emscripten-core/src/module.ts index 787df7dbb..84de47dc0 100644 --- a/packages/quickjs-emscripten-core/src/module.ts +++ b/packages/quickjs-emscripten-core/src/module.ts @@ -42,17 +42,20 @@ export interface ContextCallbacks { * @private */ export interface RuntimeCallbacks { + freeHostRef: MaybeAsyncEmscriptenCallbacks["freeHostRef"] shouldInterrupt: MaybeAsyncEmscriptenCallbacks["shouldInterrupt"] loadModuleSource: MaybeAsyncEmscriptenCallbacks["loadModuleSource"] normalizeModule: MaybeAsyncEmscriptenCallbacks["normalizeModule"] } class QuickJSEmscriptenModuleCallbacks implements EmscriptenModuleCallbacks { + public freeHostRef: EmscriptenModuleCallbacks["freeHostRef"] public callFunction: EmscriptenModuleCallbacks["callFunction"] public shouldInterrupt: EmscriptenModuleCallbacks["shouldInterrupt"] public loadModuleSource: EmscriptenModuleCallbacks["loadModuleSource"] public normalizeModule: EmscriptenModuleCallbacks["normalizeModule"] constructor(args: EmscriptenModuleCallbacks) { + this.freeHostRef = args.freeHostRef this.callFunction = args.callFunction this.shouldInterrupt = args.shouldInterrupt this.loadModuleSource = args.loadModuleSource @@ -179,6 +182,16 @@ export class QuickJSModuleCallbacks { } private cToHostCallbacks = new QuickJSEmscriptenModuleCallbacks({ + freeHostRef: (_asyncify, rt, host_ref_id) => { + const runtimeCallbacks = this.runtimeCallbacks.get(rt) + if (!runtimeCallbacks) { + throw new Error( + `QuickJSRuntime(rt = ${rt}) not found when trying to free HostRef(id = ${host_ref_id})`, + ) + } + runtimeCallbacks.freeHostRef(rt, host_ref_id) + }, + callFunction: (asyncify, ctx, this_ptr, argc, argv, fn_id) => this.handleAsyncify(asyncify, () => { try { @@ -332,8 +345,10 @@ export class QuickJSWASMModule { */ newRuntime(options: RuntimeOptions = {}): QuickJSRuntime { const rt = new Lifetime(this.ffi.QTS_NewRuntime(), undefined, (rt_ptr) => { - this.callbacks.deleteRuntime(rt_ptr) + // Free runtime first - this runs GC finalizers that may call back into JS this.ffi.QTS_FreeRuntime(rt_ptr) + // Then delete callbacks after finalizers have run + this.callbacks.deleteRuntime(rt_ptr) }) const runtime = new QuickJSRuntime({ diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index fd98b4068..e404f0648 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -16,6 +16,7 @@ import { ModuleMemory } from "./memory" import type { QuickJSModuleCallbacks, RuntimeCallbacks } from "./module" import type { ContextOptions, JSModuleLoader, JSModuleNormalizer, QuickJSHandle } from "./types" import { intrinsicsToFlags } from "./types" +import { HostRefMap } from "./host-ref" /** * Callback called regularly while the VM executes code. @@ -96,6 +97,8 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { protected moduleLoader: JSModuleLoader | undefined /** @private */ protected moduleNormalizer: JSModuleNormalizer | undefined + /** @private */ + hostRefs = new HostRefMap() /** @private */ constructor(args: { @@ -383,6 +386,14 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { } private cToHostCallbacks: RuntimeCallbacks = { + freeHostRef: (rt, host_ref_id) => { + if (rt !== this.rt.value) { + throw new Error("Runtime pointer mismatch") + } + + this.hostRefs.delete(host_ref_id) + }, + shouldInterrupt: (rt) => { if (rt !== this.rt.value) { throw new Error("QuickJSContext instance received C -> JS interrupt with mismatched rt") diff --git a/packages/quickjs-ffi-types/src/emscripten-types.ts b/packages/quickjs-ffi-types/src/emscripten-types.ts index e4e080932..78fa7051e 100644 --- a/packages/quickjs-ffi-types/src/emscripten-types.ts +++ b/packages/quickjs-ffi-types/src/emscripten-types.ts @@ -18,6 +18,7 @@ import type { JSValueConstPointer, JSValuePointer, OwnedHeapCharPointer, + HostRefId, } from "./ffi-types" // eslint-disable-next-line @typescript-eslint/no-namespace @@ -202,13 +203,19 @@ export interface Asyncify { * @private */ export interface EmscriptenModuleCallbacks { + freeHostRef: ( + asyncify: Asyncify | undefined, + rt: JSRuntimePointer, + host_ref_id: HostRefId, + ) => void + callFunction: ( asyncify: Asyncify | undefined, ctx: JSContextPointer, this_ptr: JSValueConstPointer, argc: number, argv: JSValueConstPointer, - fn_id: number, + host_ref_id: HostRefId, ) => JSValuePointer | AsyncifySleepResult loadModuleSource: ( diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 8f50f7b23..e3aa0ad66 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "." @@ -50,6 +51,8 @@ export interface QuickJSAsyncFFI { QTS_GetNull: () => JSValueConstPointer QTS_GetFalse: () => JSValueConstPointer QTS_GetTrue: () => JSValueConstPointer + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer @@ -246,7 +249,13 @@ export interface QuickJSAsyncFFI { QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void QTS_BuildIsDebug: () => number QTS_BuildIsAsyncify: () => number - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, index: number, diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index b8c03033e..b55421792 100644 --- a/packages/quickjs-ffi-types/src/ffi-types.ts +++ b/packages/quickjs-ffi-types/src/ffi-types.ts @@ -125,6 +125,11 @@ export type GetOwnPropertyNamesFlags = Brand */ export type IsEqualOp = Brand +/** + * @private + */ +export type HostRefId = Brand + /** * State of a promise. */ diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index cf9a2096f..bf9e02c63 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "." @@ -49,6 +50,8 @@ export interface QuickJSFFI { QTS_GetNull: () => JSValueConstPointer QTS_GetFalse: () => JSValueConstPointer QTS_GetTrue: () => JSValueConstPointer + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer @@ -194,7 +197,13 @@ export interface QuickJSFFI { QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void QTS_BuildIsDebug: () => number QTS_BuildIsAsyncify: () => number - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, index: number, diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts b/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts index ee3ce88b3..a154293f8 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -482,8 +495,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts index 323a3abcf..6740134db 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts index 83989cf6d..e89c9b41c 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -479,8 +492,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts index ee3ce88b3..a154293f8 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -482,8 +495,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts index 323a3abcf..6740134db 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts index 83989cf6d..e89c9b41c 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -479,8 +492,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts index ee3ce88b3..a154293f8 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -482,8 +495,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts index 323a3abcf..6740134db 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts index 83989cf6d..e89c9b41c 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -479,8 +492,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts index ee3ce88b3..a154293f8 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -482,8 +495,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts index 323a3abcf..6740134db 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts index 83989cf6d..e89c9b41c 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -479,8 +492,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index ee3ce88b3..a154293f8 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -482,8 +495,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index 323a3abcf..6740134db 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index 83989cf6d..e89c9b41c 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -84,6 +85,18 @@ export class QuickJSAsyncFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -479,8 +492,19 @@ export class QuickJSAsyncFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 419f408d7..17e6ccac9 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -23,6 +23,7 @@ import { EvalDetectModule, GetOwnPropertyNamesFlags, IsEqualOp, + HostRefId, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -83,6 +84,18 @@ export class QuickJSFFI { QTS_GetTrue: () => JSValueConstPointer = this.module.cwrap("QTS_GetTrue", "number", []) + QTS_NewHostRef: (ctx: JSContextPointer, id: HostRefId) => JSValuePointer = this.module.cwrap( + "QTS_NewHostRef", + "number", + ["number", "number"], + ) + + QTS_GetHostRefId: (value: JSValuePointer | JSValueConstPointer) => HostRefId = this.module.cwrap( + "QTS_GetHostRefId", + "number", + ["number"], + ) + QTS_NewRuntime: () => JSRuntimePointer = this.module.cwrap("QTS_NewRuntime", "number", []) QTS_FreeRuntime: (rt: JSRuntimePointer) => void = this.module.cwrap("QTS_FreeRuntime", null, [ @@ -375,8 +388,19 @@ export class QuickJSFFI { QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) - QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer = - this.module.cwrap("QTS_NewFunction", "number", ["number", "number", "string"]) + QTS_NewFunction: ( + ctx: JSContextPointer, + name: string, + arg_length: number, + is_constructor: boolean, + host_ref_id: HostRefId, + ) => JSValuePointer = this.module.cwrap("QTS_NewFunction", "number", [ + "number", + "string", + "number", + "boolean", + "number", + ]) QTS_ArgvGetJSValueConstPointer: ( argv: JSValuePointer | JSValueConstPointer,