diff --git a/.vscode/settings.json b/.vscode/settings.json index 70283ee4..9ad76c27 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,10 @@ "lsan_interface.h": "c", "math.h": "c", "stdbool.h": "c", - "emscripten.h": "c" + "emscripten.h": "c", + "quickjs-atom.h": "c" + }, + "files.exclude": { + ".yarn/releases/*": true } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 51bfbc04..8fad84e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## v0.30.0 + +- [#200](https://github.com/justjake/quickjs-emscripten/pull/200) Inspect and iterate handles, equality, changes to result types, changes to debug logging. +- [#195](https://github.com/justjake/quickjs-emscripten/pull/195) Export `setDebugMode` + +### Collection & Iteration + +- For objects and arrays: add `context.getOwnPropertyNames(handle, options)` to iterate the key or array index handles. +- For arrays: add `context.getLength(handle)` which reads `handle.length` and returns it as a number or undefined to make writing `for (i=0;i` return type is largely replaced with a new return type `DisposableSuccess | DisposableFail`. The new type implements `result.unwrap()` as a replacement for `context.unwrapResult(result)`. It also implements `dispose()` directly, so you no longer need to distinguish between success and failure to clean up. +- add `context.callMethod(handle, 'methodName')`, this makes it easier to call methods like `context.callMethod(handle, 'keys')` or `context.callMethod('values')` which can be used with the new iterator. + +### Equality + +- Added `context.eq(a, b)`, `context.sameValue(a, b)`, `context.sameValueZero(a, b)` + +### Debug logging changes + +Debug logging is now disabled by default, even when using a DEBUG variant. It can be enabled on a runtime-by-runtime basis with `runtime.setDebugMode(boolean)` or `context.runtime.setDebugMode(boolean)`, or globally using `setDebugMode(boolean)`. As with before, you should use a DEBUG variant to see logs from the WebAssembly C code. + +## v0.29.2 + +- [#179](https://github.com/justjake/quickjs-emscripten/pull/161) Add a work-around for a bug in Webkit ARM to quickjs build variants. quickjs-ng is still affected by this bug. + ## v0.29.1 - [#161](https://github.com/justjake/quickjs-emscripten/pull/161) Fix a bug where `context.evalCode(..., { type: 'module' })` would return success when some kinds of error occurred when using `quickjs` variants. diff --git a/README.md b/README.md index 1e465af5..de4c113d 100644 --- a/README.md +++ b/README.md @@ -561,8 +561,9 @@ build variant of quickjs-emscripten, and also the [DEBUG_SYNC] build variant. The debug sync build variant has extra instrumentation code for detecting memory leaks. -The class [TestQuickJSWASMModule] exposes the memory leak detection API, although -this API is only accurate when using `DEBUG_SYNC` variant. +The class [TestQuickJSWASMModule] exposes the memory leak detection API, +although this API is only accurate when using `DEBUG_SYNC` variant. You can also +enable [debug logging](#debugging) to help diagnose failures. ```typescript // Define your test suite in a function, so that you can test against @@ -744,40 +745,51 @@ You can use quickjs-emscripten directly from an HTML file in two ways: ### Debugging -- Switch to a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library: +Debug logging can be enabled globally, or for specific runtimes. You need to use a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library. - ```typescript - import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" +```typescript +import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" + +const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) +``` + +With quickjs-emscripten-core: - const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) - ``` +```typescript +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" + +const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) +``` - With quickjs-emscripten-core: +To enable debug logging globally, call [setDebugMode][setDebugMode]. This affects global Javascript parts of the library, like the module loader and asyncify internals, and is inherited by runtimes created after the call. - ```typescript - import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" - import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" +```typescript +import { setDebugMode } from "quickjs-emscripten" - const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) - ``` +setDebugMode(true) +``` -- Enable debug log messages from the Javascript part of this library with [setDebugMode][setDebugMode]: +With quickjs-emscripten-core: - ```typescript - import { setDebugMode } from "quickjs-emscripten" +```typescript +import { setDebugMode } from "quickjs-emscripten-core" - setDebugMode(true) - ``` +setDebugMode(true) +``` - With quickjs-emscripten-core: +To enable debug logging for a specific runtime, call [setDebugModeRt][setDebugModeRt]. This affects only the runtime and its associated contexts. - ```typescript - import { setDebugMode } from "quickjs-emscripten-core" +```typescript +const runtime = QuickJS.newRuntime() +runtime.setDebugMode(true) - setDebugMode(true) - ``` +const context = QuickJS.newContext() +context.runtime.setDebugMode(true) +``` [setDebugMode]: doc/quickjs-emscripten/exports.md#setdebugmode +[setDebugModeRt]: https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md#setdebugmode ### Supported Platforms diff --git a/c/interface.c b/c/interface.c index 68a2408e..48cedffd 100644 --- a/c/interface.c +++ b/c/interface.c @@ -59,10 +59,18 @@ #define LOG_LEN 500 #ifdef QTS_DEBUG_MODE -#define QTS_DEBUG(msg) qts_log(msg); -#define QTS_DUMP(value) qts_dump(ctx, value); +#define IF_DEBUG if (qts_get_context_rt_data(ctx)->debug_log) +#define IF_DEBUG_RT if (qts_get_runtime_data(rt)->debug_log) + +#define QTS_DEBUG(msg) IF_DEBUG qts_log(msg); +#define QTS_DEBUG_RT(msg) IF_DEBUG_RT qts_log(msg); +#define QTS_DUMP(value) IF_DEBUG qts_dump(ctx, value); + #else +#define IF_DEBUG if (0) +#define IF_DEBUG_RT if (0) #define QTS_DEBUG(msg) ; +#define QTS_DEBUG_RT(msg) ; #define QTS_DUMP(value) ; #endif @@ -93,6 +101,24 @@ #define IntrinsicsFlags enum QTS_Intrinsic #define EvalDetectModule int +typedef struct qts_RuntimeData { + bool debug_log; +} qts_RuntimeData; + +qts_RuntimeData *qts_get_runtime_data(JSRuntime *rt) { + qts_RuntimeData *data = JS_GetRuntimeOpaque(rt); + if (data == NULL) { + data = malloc(sizeof(qts_RuntimeData)); + data->debug_log = false; + JS_SetRuntimeOpaque(rt, data); + } + return data; +} + +qts_RuntimeData *qts_get_context_rt_data(JSContext *ctx) { + return qts_get_runtime_data(JS_GetRuntime(ctx)); +} + void qts_log(char *msg) { fputs(PKG, stderr); fputs(msg, stderr); @@ -273,6 +299,10 @@ JSRuntime *QTS_NewRuntime() { } void QTS_FreeRuntime(JSRuntime *rt) { + void *data = JS_GetRuntimeOpaque(rt); + if (data) { + free(data); + } JS_FreeRuntime(rt); } @@ -533,11 +563,11 @@ MaybeAsync(JSValue *) QTS_ExecutePendingJob(JSRuntime *rt, int maxJobsToExecute, executed++; } } -#ifdef QTS_DEBUG_MODE - char msg[500]; - snprintf(msg, 500, "QTS_ExecutePendingJob(executed: %d, pctx: %p, lastJobExecuted: %p)", executed, pctx, *lastJobContext); - QTS_DEBUG(msg) -#endif + IF_DEBUG_RT { + char msg[LOG_LEN]; + snprintf(msg, LOG_LEN, "QTS_ExecutePendingJob(executed: %d, pctx: %p, lastJobExecuted: %p)", executed, pctx, *lastJobContext); + qts_log(msg); + } return jsvalue_to_heap(JS_NewFloat64(pctx, executed)); } @@ -548,6 +578,11 @@ MaybeAsync(JSValue *) QTS_GetProp(JSContext *ctx, JSValueConst *this_val, JSValu return jsvalue_to_heap(prop_val); } +MaybeAsync(JSValue *) QTS_GetPropNumber(JSContext *ctx, JSValueConst *this_val, int prop_name) { + JSValue prop_val = JS_GetPropertyUint32(ctx, *this_val, (uint32_t)prop_name); + return jsvalue_to_heap(prop_val); +} + MaybeAsync(void) QTS_SetProp(JSContext *ctx, JSValueConst *this_val, JSValueConst *prop_name, JSValueConst *prop_value) { JSAtom prop_atom = JS_ValueToAtom(ctx, *prop_name); JSValue extra_prop_value = JS_DupValue(ctx, *prop_value); @@ -586,6 +621,76 @@ void QTS_DefineProp(JSContext *ctx, JSValueConst *this_val, JSValueConst *prop_n JS_FreeAtom(ctx, prop_atom); } +#define JS_ATOM_TAG_INT (1U << 31) +static inline BOOL __JS_AtomIsTaggedInt(JSAtom v) { + return (v & JS_ATOM_TAG_INT) != 0; +} + +static inline uint32_t __JS_AtomToUInt32(JSAtom atom) { + return atom & ~JS_ATOM_TAG_INT; +} + +/* include numbers. when only this is set, we filter out strings */ +#define QTS_GPN_NUMBER_MASK (1 << 6) +/* Treat numbers as strings */ +#define QTS_STANDARD_COMPLIANT_NUMBER (1 << 7) + +MaybeAsync(JSValue *) QTS_GetOwnPropertyNames(JSContext *ctx, JSValue ***out_ptrs, uint32_t *out_len, JSValueConst *obj, int flags) { + JSPropertyEnum *tab = NULL; + uint32_t total_props = 0; + uint32_t out_props = 0; + + BOOL qts_standard_compliant_number = (flags & QTS_STANDARD_COMPLIANT_NUMBER) != 0; + BOOL qts_include_string = (flags & JS_GPN_STRING_MASK) != 0; + BOOL qts_include_number = qts_standard_compliant_number ? 0 : (flags & QTS_GPN_NUMBER_MASK) != 0; + if (qts_include_number) { + // if we want numbers, we must include strings in call down + flags = flags | JS_GPN_STRING_MASK; + } + + int status = 0; + status = JS_GetOwnPropertyNames(ctx, &tab, &total_props, *obj, flags); + if (status < 0) { + if (tab != NULL) { + js_free(ctx, tab); + } + return jsvalue_to_heap(JS_GetException(ctx)); + } + *out_ptrs = malloc(sizeof(JSValue) * *out_len); + for (int i = 0; i < total_props; i++) { + JSAtom atom = tab[i].atom; + + if (__JS_AtomIsTaggedInt(atom)) { + if (qts_include_number) { + uint32_t v = __JS_AtomToUInt32(atom); + (*out_ptrs)[out_props++] = jsvalue_to_heap(JS_NewUint32(ctx, v)); + } else if (qts_include_string && qts_standard_compliant_number) { + (*out_ptrs)[out_props++] = jsvalue_to_heap(JS_AtomToValue(ctx, tab[i].atom)); + } + JS_FreeAtom(ctx, atom); + continue; + } + + JSValue atom_value = JS_AtomToValue(ctx, atom); + JS_FreeAtom(ctx, atom); + + if (JS_IsString(atom_value)) { + if (qts_include_string) { + (*out_ptrs)[out_props++] = jsvalue_to_heap(atom_value); + } else { + JS_FreeValue(ctx, atom_value); + } + } else { // Symbol + // We must have set the includeSymbol or includePrivate flags + // if it's present + (*out_ptrs)[out_props++] = jsvalue_to_heap(atom_value); + } + } + js_free(ctx, tab); + *out_len = out_props; + return NULL; +} + MaybeAsync(JSValue *) QTS_Call(JSContext *ctx, JSValueConst *func_obj, JSValueConst *this_obj, int argc, JSValueConst **argv_ptrs) { // convert array of pointers to array of values JSValueConst argv[argc]; @@ -635,10 +740,10 @@ MaybeAsync(JSBorrowedChar *) QTS_Dump(JSContext *ctx, JSValueConst *obj) { } } -#ifdef QTS_DEBUG_MODE - qts_log("Error dumping JSON:"); - js_std_dump_error(ctx); -#endif + IF_DEBUG { + qts_log("Error dumping JSON:"); + js_std_dump_error(ctx); + } // Fallback: convert to string return QTS_GetString(ctx, obj); @@ -655,9 +760,7 @@ JSValue qts_resolve_func_data( } MaybeAsync(JSValue *) QTS_Eval(JSContext *ctx, BorrowedHeapChar *js_code, size_t js_code_length, const char *filename, EvalDetectModule detectModule, EvalFlags evalFlags) { -#ifdef QTS_DEBUG_MODE - char msg[500]; -#endif + char msg[LOG_LEN]; if (detectModule) { if (JS_DetectModule((const char *)js_code, js_code_length)) { QTS_DEBUG("QTS_Eval: Detected module = true"); @@ -703,10 +806,10 @@ MaybeAsync(JSValue *) QTS_Eval(JSContext *ctx, BorrowedHeapChar *js_code, size_t QTS_DEBUG("QTS_Eval: JS_EVAL_TYPE_GLOBAL eval_result") } -#ifdef QTS_DEBUG_MODE - snprintf(msg, 500, "QTS_Eval: eval_result = %d", eval_result); - QTS_DEBUG(msg) -#endif + IF_DEBUG { + snprintf(msg, LOG_LEN, "QTS_Eval: eval_result = %d", eval_result); + qts_log(msg); + } if ( // Error - nothing more to do. @@ -720,10 +823,10 @@ MaybeAsync(JSValue *) QTS_Eval(JSContext *ctx, BorrowedHeapChar *js_code, size_t // We eval'd a module. // Make our return type `ModuleExports | Promise>` JSPromiseStateEnum state = JS_PromiseState(ctx, eval_result); -#ifdef QTS_DEBUG_MODE - snprintf(msg, 500, "QTS_Eval: eval_result JS_PromiseState = %i", state); - QTS_DEBUG(msg) -#endif + IF_DEBUG { + snprintf(msg, LOG_LEN, "QTS_Eval: eval_result JS_PromiseState = %i", state); + qts_log(msg); + } if ( // quickjs@2024-01-14 evaluating module // produced a promise @@ -819,6 +922,53 @@ OwnedHeapChar *QTS_Typeof(JSContext *ctx, JSValueConst *value) { return out; } +JSAtom QTS_AtomLength = 0; +int QTS_GetLength(JSContext *ctx, uint32_t *out_len, JSValueConst *value) { + JSValue len_val; + int result; + + if (!JS_IsObject(*value)) { + return -1; + } + + if (QTS_AtomLength == 0) { + // This should result in a constant static atom we don't actually need to + // free, since it's interned within quickjs.c + QTS_AtomLength = JS_NewAtom(ctx, "length"); + } + + len_val = JS_GetProperty(ctx, *value, QTS_AtomLength); + if (JS_IsException(len_val)) { + return -1; + } + + result = JS_ToUint32(ctx, out_len, len_val); + JS_FreeValue(ctx, len_val); + return result; +} + +typedef enum IsEqualOp { + QTS_EqualOp_StrictEq = 0, + QTS_EqualOp_SameValue = 1, + QTS_EqualOp_SameValueZero = 2, +} IsEqualOp; + +int QTS_IsEqual(JSContext *ctx, JSValueConst *a, JSValueConst *b, IsEqualOp op) { +#ifdef QTS_USE_QUICKJS_NG + return -1; +#else + switch (op) { + case QTS_EqualOp_SameValue: + return JS_SameValue(ctx, *a, *b); + case QTS_EqualOp_SameValueZero: + return JS_SameValueZero(ctx, *a, *b); + default: + case QTS_EqualOp_StrictEq: + return JS_StrictEq(ctx, *a, *b); + } +#endif +} + JSValue *QTS_GetGlobalObject(JSContext *ctx) { return jsvalue_to_heap(JS_GetGlobalObject(ctx)); } @@ -843,6 +993,19 @@ void QTS_TestStringArg(const char *string) { // pass } +int QTS_GetDebugLogEnabled(JSRuntime *rt) { + IF_DEBUG_RT { + return 1; + } + return 0; +} + +void QTS_SetDebugLogEnabled(JSRuntime *rt, int is_enabled) { +#ifdef QTS_DEBUG_MODE + qts_get_runtime_data(rt)->debug_log = (bool)is_enabled; +#endif +} + int QTS_BuildIsDebug() { #ifdef QTS_DEBUG_MODE return 1; @@ -894,11 +1057,11 @@ 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) { -#ifdef QTS_DEBUG_MODE - char msg[500]; - snprintf(msg, 500, "new_function(name: %s, magic: %d)", name, func_id); - QTS_DEBUG(msg) -#endif + IF_DEBUG { + char msg[LOG_LEN]; + snprintf(msg, LOG_LEN, "new_function(name: %s, magic: %d)", name, func_id); + qts_log(msg); + } JSValue func_obj = JS_NewCFunctionMagic( /* context */ ctx, /* JSCFunctionMagic* */ &qts_call_function, @@ -979,11 +1142,11 @@ loading, but (1) seems much easier to implement in the sort run. */ JSModuleDef *qts_compile_module(JSContext *ctx, const char *module_name, BorrowedHeapChar *module_body) { -#ifdef QTS_DEBUG_MODE - char msg[500]; - sprintf(msg, "QTS_CompileModule(ctx: %p, name: %s, bodyLength: %lu)", ctx, module_name, strlen(module_body)); - QTS_DEBUG(msg) -#endif + IF_DEBUG { + char msg[LOG_LEN]; + sprintf(msg, "QTS_CompileModule(ctx: %p, name: %s, bodyLength: %lu)", ctx, module_name, strlen(module_body)); + qts_log(msg); + } JSValue func_val = JS_Eval(ctx, module_body, strlen(module_body), module_name, JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_COMPILE_ONLY); if (JS_IsException(func_val)) { return NULL; @@ -1024,11 +1187,11 @@ EM_JS(MaybeAsync(char *), qts_host_normalize_module, (JSRuntime * rt, JSContext // See js_module_loader in quickjs/quickjs-libc.c:567 JSModuleDef *qts_load_module(JSContext *ctx, const char *module_name, void *_unused) { JSRuntime *rt = JS_GetRuntime(ctx); -#ifdef QTS_DEBUG_MODE - char msg[500]; - sprintf(msg, "qts_load_module(rt: %p, ctx: %p, name: %s)", rt, ctx, module_name); - QTS_DEBUG(msg) -#endif + IF_DEBUG_RT { + char msg[LOG_LEN]; + sprintf(msg, "qts_load_module(rt: %p, ctx: %p, name: %s)", rt, ctx, module_name); + qts_log(msg); + } char *module_source = qts_host_load_module_source(rt, ctx, module_name); if (module_source == NULL) { return NULL; @@ -1041,11 +1204,11 @@ JSModuleDef *qts_load_module(JSContext *ctx, const char *module_name, void *_unu char *qts_normalize_module(JSContext *ctx, const char *module_base_name, const char *module_name, void *_unused) { JSRuntime *rt = JS_GetRuntime(ctx); -#ifdef QTS_DEBUG_MODE - char msg[500]; - sprintf(msg, "qts_normalize_module(rt: %p, ctx: %p, base_name: %s, name: %s)", rt, ctx, module_base_name, module_name); - QTS_DEBUG(msg) -#endif + IF_DEBUG_RT { + char msg[LOG_LEN]; + sprintf(msg, "qts_normalize_module(rt: %p, ctx: %p, base_name: %s, name: %s)", rt, ctx, module_base_name, module_name); + qts_log(msg); + } char *em_module_name = qts_host_normalize_module(rt, ctx, module_base_name, module_name); char *js_module_name = js_strdup(ctx, em_module_name); free(em_module_name); @@ -1084,4 +1247,4 @@ JSValue *QTS_bjson_decode(JSContext *ctx, JSValueConst *data) { JSValue value = JS_ReadObject(ctx, buffer, length, 0); return jsvalue_to_heap(value); -} +} \ No newline at end of file diff --git a/doc/@jitl/quickjs-ffi-types/exports.md b/doc/@jitl/quickjs-ffi-types/exports.md index f50a56f7..880f8785 100644 --- a/doc/@jitl/quickjs-ffi-types/exports.md +++ b/doc/@jitl/quickjs-ffi-types/exports.md @@ -23,15 +23,19 @@ - [JSValueConstPointerPointer](exports.md#jsvalueconstpointerpointer) - [JSValuePointer](exports.md#jsvaluepointer) - [JSValuePointerPointer](exports.md#jsvaluepointerpointer) + - [JSValuePointerPointerPointer](exports.md#jsvaluepointerpointerpointer) - [JSVoidPointer](exports.md#jsvoidpointer) - [OwnedHeapCharPointer](exports.md#ownedheapcharpointer) - [QTS\_C\_To\_HostCallbackFuncPointer](exports.md#qts-c-to-hostcallbackfuncpointer) - [QTS\_C\_To\_HostInterruptFuncPointer](exports.md#qts-c-to-hostinterruptfuncpointer) - [QTS\_C\_To\_HostLoadModuleFuncPointer](exports.md#qts-c-to-hostloadmodulefuncpointer) - [QuickJSVariant](exports.md#quickjsvariant) + - [UInt32Pointer](exports.md#uint32pointer) - [Variables](exports.md#variables) - [EvalFlags](exports.md#evalflags) + - [GetOwnPropertyNamesFlags](exports.md#getownpropertynamesflags) - [IntrinsicsFlags](exports.md#intrinsicsflags) + - [IsEqualOp](exports.md#isequalop) - [JSPromiseStateEnum](exports.md#jspromisestateenum-1) - [Functions](exports.md#functions) - [assertSync()](exports.md#assertsync) @@ -60,7 +64,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L77) +[packages/quickjs-ffi-types/src/ffi-types.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L82) *** @@ -93,7 +97,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L89) +[packages/quickjs-ffi-types/src/ffi-types.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L94) *** @@ -141,7 +145,7 @@ State of a promise. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L114) +[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) *** @@ -178,7 +182,7 @@ Used internally for Javascript-to-C function calls. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L51) +[packages/quickjs-ffi-types/src/ffi-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L56) *** @@ -207,6 +211,18 @@ Used internally for Javascript-to-C function calls. *** +### JSValuePointerPointerPointer + +> **JSValuePointerPointerPointer**: `Pointer`\<`"*JSValue[]"`\> + +Used internally for Javascript-to-C function calls. + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L51) + +*** + ### JSVoidPointer > **JSVoidPointer**: `Pointer`\<`any`\> @@ -215,7 +231,7 @@ Opaque pointer that was allocated by js_malloc. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L94) +[packages/quickjs-ffi-types/src/ffi-types.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L99) *** @@ -228,7 +244,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L83) +[packages/quickjs-ffi-types/src/ffi-types.ts:88](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L88) *** @@ -240,7 +256,7 @@ Used internally for C-to-Javascript function calls. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L61) +[packages/quickjs-ffi-types/src/ffi-types.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L66) *** @@ -252,7 +268,7 @@ Used internally for C-to-Javascript interrupt handlers. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L66) +[packages/quickjs-ffi-types/src/ffi-types.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L71) *** @@ -264,7 +280,7 @@ Used internally for C-to-Javascript module loading. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L71) +[packages/quickjs-ffi-types/src/ffi-types.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L76) *** @@ -276,6 +292,16 @@ Used internally for C-to-Javascript module loading. [packages/quickjs-ffi-types/src/variant-types.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L49) +*** + +### UInt32Pointer + +> **UInt32Pointer**: `Pointer`\<`"uint32_t"`\> + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L101) + ## Variables ### EvalFlags @@ -342,7 +368,49 @@ module code #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L99) +[packages/quickjs-ffi-types/src/ffi-types.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L106) + +*** + +### GetOwnPropertyNamesFlags + +> **GetOwnPropertyNamesFlags**: `Object` + +Bitfield options for QTS_GetOwnPropertyNames + +#### Type declaration + +##### JS\_GPN\_ENUM\_ONLY + +> **JS\_GPN\_ENUM\_ONLY**: `number` + +##### JS\_GPN\_PRIVATE\_MASK + +> **JS\_GPN\_PRIVATE\_MASK**: `number` + +##### JS\_GPN\_SET\_ENUM + +> **JS\_GPN\_SET\_ENUM**: `number` + +##### JS\_GPN\_STRING\_MASK + +> **JS\_GPN\_STRING\_MASK**: `number` + +##### JS\_GPN\_SYMBOL\_MASK + +> **JS\_GPN\_SYMBOL\_MASK**: `number` + +##### QTS\_GPN\_NUMBER\_MASK + +> **QTS\_GPN\_NUMBER\_MASK**: `number` + +##### QTS\_STANDARD\_COMPLIANT\_NUMBER + +> **QTS\_STANDARD\_COMPLIANT\_NUMBER**: `number` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L121) *** @@ -350,7 +418,7 @@ module code > **IntrinsicsFlags**: `Object` -Bitfield options for QTS_NewContext intrinsices +Bitfield options for QTS_NewContext intrinsics #### Type declaration @@ -420,7 +488,31 @@ Bitfield options for QTS_NewContext intrinsices #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L104) +[packages/quickjs-ffi-types/src/ffi-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L111) + +*** + +### IsEqualOp + +> **IsEqualOp**: `Object` + +#### Type declaration + +##### IsSameValue + +> **IsSameValue**: [`IsEqualOp`](exports.md#isequalop) + +##### IsSameValueZero + +> **IsSameValueZero**: [`IsEqualOp`](exports.md#isequalop) + +##### IsStrictlyEqual + +> **IsStrictlyEqual**: [`IsEqualOp`](exports.md#isequalop) + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126) *** @@ -444,7 +536,7 @@ Bitfield options for QTS_NewContext intrinsices #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L114) +[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) ## Functions @@ -477,7 +569,7 @@ Bitfield options for QTS_NewContext intrinsices #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L119) +[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) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md index de526cdf..db50ca6a 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md @@ -37,18 +37,25 @@ library. - [QTS\_FreeVoidPointer](QuickJSAsyncFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSAsyncFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSAsyncFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSAsyncFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSAsyncFFI.md#qts-getownpropertynames) + - [QTS\_GetOwnPropertyNames\_MaybeAsync](QuickJSAsyncFFI.md#qts-getownpropertynames-maybeasync) - [QTS\_GetProp](QuickJSAsyncFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSAsyncFFI.md#qts-getpropnumber) + - [QTS\_GetPropNumber\_MaybeAsync](QuickJSAsyncFFI.md#qts-getpropnumber-maybeasync) - [QTS\_GetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-getprop-maybeasync) - [QTS\_GetString](QuickJSAsyncFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetSymbolDescriptionOrKey\_MaybeAsync](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey-maybeasync) - [QTS\_GetTrue](QuickJSAsyncFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSAsyncFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSAsyncFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSAsyncFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSAsyncFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSAsyncFFI.md#qts-newarray) @@ -75,6 +82,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSAsyncFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSAsyncFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSAsyncFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSAsyncFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSAsyncFFI.md#qts-setprop) - [QTS\_SetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-setprop-maybeasync) - [QTS\_TestStringArg](QuickJSAsyncFFI.md#qts-teststringarg) @@ -97,7 +105,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L35) +[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) *** @@ -117,7 +125,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:209](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L209) +[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) *** @@ -131,7 +139,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -145,7 +153,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L206) +[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) *** @@ -159,7 +167,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -185,7 +193,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -211,7 +219,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L152) +[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) *** @@ -245,7 +253,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -265,7 +273,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L160) +[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) *** @@ -285,7 +293,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L164) +[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) *** @@ -305,7 +313,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:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) *** @@ -333,7 +341,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L168) +[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) *** @@ -361,7 +369,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -383,7 +391,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L102) +[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) *** @@ -405,7 +413,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -425,7 +433,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:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -443,7 +451,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -461,7 +469,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -481,7 +489,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -501,7 +509,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -521,7 +529,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:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -541,7 +549,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:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L83) *** @@ -561,7 +569,25 @@ 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:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L87) + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### 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) *** @@ -575,7 +601,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -595,7 +621,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -613,7 +639,29 @@ 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:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`number` + +#### 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) *** @@ -633,7 +681,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L184) +[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) *** @@ -647,7 +695,59 @@ 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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) + +*** + +### QTS\_GetOwnPropertyNames\_MaybeAsync + +> **QTS\_GetOwnPropertyNames\_MaybeAsync**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### 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) *** @@ -669,7 +769,51 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L112) +[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) + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) + +*** + +### QTS\_GetPropNumber\_MaybeAsync + +> **QTS\_GetPropNumber\_MaybeAsync**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### 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) *** @@ -691,7 +835,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L117) +[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) *** @@ -711,7 +855,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L75) +[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) *** @@ -731,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L92) +[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) *** @@ -751,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:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L100) *** @@ -765,7 +909,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -779,7 +923,31 @@ 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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **b**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### 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) *** @@ -799,7 +967,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:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) *** @@ -817,7 +985,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L101) +[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) *** @@ -835,7 +1003,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:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) *** @@ -857,7 +1025,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L67) +[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) *** @@ -877,7 +1045,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -895,7 +1063,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L38) +[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) *** @@ -915,7 +1083,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L72) +[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) *** @@ -937,7 +1105,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L208) +[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) *** @@ -955,7 +1123,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:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) *** @@ -975,7 +1143,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -995,7 +1163,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L193) +[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) *** @@ -1009,7 +1177,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -1029,7 +1197,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -1051,7 +1219,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:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L91) *** @@ -1071,7 +1239,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L201) +[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) *** @@ -1091,7 +1259,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L197) +[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) *** @@ -1105,7 +1273,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -1125,7 +1293,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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) *** @@ -1145,7 +1313,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -1163,7 +1331,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:214](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L214) +[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) *** @@ -1181,7 +1349,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:257](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L257) *** @@ -1199,7 +1367,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1217,7 +1385,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:213](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L213) +[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) *** @@ -1237,7 +1405,7 @@ Set at compile time. #### Source -[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) +[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) *** @@ -1257,7 +1425,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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) *** @@ -1277,7 +1445,27 @@ 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:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### 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) *** @@ -1301,7 +1489,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L122) +[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) *** @@ -1325,7 +1513,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:128](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L128) +[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) *** @@ -1343,7 +1531,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L205) +[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) *** @@ -1363,7 +1551,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L37) +[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) *** @@ -1383,7 +1571,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:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L216) *** @@ -1403,7 +1591,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:221](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L221) +[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) *** @@ -1423,7 +1611,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:217](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L217) +[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) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md index 80f5b133..eb92840e 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md @@ -33,16 +33,21 @@ library. - [QTS\_FreeVoidPointer](QuickJSFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSFFI.md#qts-getownpropertynames) - [QTS\_GetProp](QuickJSFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSFFI.md#qts-getpropnumber) - [QTS\_GetString](QuickJSFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetTrue](QuickJSFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSFFI.md#qts-newarray) @@ -69,6 +74,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSFFI.md#qts-setprop) - [QTS\_TestStringArg](QuickJSFFI.md#qts-teststringarg) - [QTS\_Throw](QuickJSFFI.md#qts-throw) @@ -90,7 +96,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:34](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L34) +[packages/quickjs-ffi-types/src/ffi.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) *** @@ -110,7 +116,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L169) +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -124,7 +130,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L167) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -138,7 +144,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L166) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -152,7 +158,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -178,7 +184,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:124](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L124) +[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) *** @@ -212,7 +218,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L113) +[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) *** @@ -232,7 +238,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L132) +[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) *** @@ -252,7 +258,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:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -280,7 +286,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L136) +[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) *** @@ -302,7 +308,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:97](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L97) +[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) *** @@ -322,7 +328,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:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -340,7 +346,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -358,7 +364,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -378,7 +384,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -398,7 +404,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -418,7 +424,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -438,7 +444,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:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) *** @@ -458,7 +464,25 @@ 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:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### 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) *** @@ -472,7 +496,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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -492,7 +516,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L72) +[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -510,7 +534,29 @@ 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:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`number` + +#### 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) *** @@ -530,7 +576,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:144](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L144) +[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) *** @@ -544,7 +590,33 @@ 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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) *** @@ -566,7 +638,29 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L102) +[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) *** @@ -586,7 +680,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L74) +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** @@ -606,7 +700,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L91) +[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) *** @@ -620,7 +714,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -634,7 +728,31 @@ 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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **b**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### 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) *** @@ -654,7 +772,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:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -672,7 +790,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L96) +[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -690,7 +808,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:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -712,7 +830,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L66) +[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) *** @@ -732,7 +850,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -750,7 +868,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L37) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -770,7 +888,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L71) +[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -792,7 +910,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:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -810,7 +928,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:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -830,7 +948,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L61) +[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) *** @@ -850,7 +968,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:153](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L153) +[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) *** @@ -864,7 +982,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -884,7 +1002,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L73) +[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -906,7 +1024,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:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) *** @@ -926,7 +1044,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L161) +[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) *** @@ -946,7 +1064,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L157) +[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) *** @@ -960,7 +1078,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -980,7 +1098,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L131) +[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -1000,7 +1118,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L39) +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1018,7 +1136,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:174](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L174) +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1036,7 +1154,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:176](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L176) +[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) *** @@ -1054,7 +1172,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:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1072,7 +1190,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:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1092,7 +1210,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:175](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L175) +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** @@ -1112,7 +1230,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -1132,7 +1250,27 @@ 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:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### 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) *** @@ -1156,7 +1294,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L107) +[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) *** @@ -1174,7 +1312,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L165) +[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -1194,7 +1332,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:36](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L36) +[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -1214,7 +1352,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:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) *** @@ -1234,7 +1372,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L181) +[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) *** @@ -1254,7 +1392,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L177) +[packages/quickjs-ffi-types/src/ffi.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L206) *** diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md index c06b4a45..4623ca4d 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md @@ -94,13 +94,13 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-sourceMapJson.js", "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md index 82fea5cb..beeca5e2 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md @@ -87,6 +87,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md index 15d1c0ed..ebee4f29 100644 --- a/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md @@ -82,6 +82,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -89,7 +90,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md index 5b4f1aa5..01563189 100644 --- a/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md @@ -75,6 +75,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md index 35763705..0b243d0d 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md @@ -82,6 +82,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -89,7 +90,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md index aed65461..2f70a692 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md @@ -75,6 +75,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md index 9e8dd352..52805212 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md @@ -82,6 +82,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -89,7 +90,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md index e5335bd3..7cb244b7 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md @@ -75,6 +75,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md index 82d1fab3..f6f33a94 100644 --- a/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md @@ -94,13 +94,13 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-sourceMapJson.js", "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-wasmfile-debug-sync/README.md b/doc/@jitl/quickjs-wasmfile-debug-sync/README.md index 0cdd9d6d..b54dfe0e 100644 --- a/doc/@jitl/quickjs-wasmfile-debug-sync/README.md +++ b/doc/@jitl/quickjs-wasmfile-debug-sync/README.md @@ -87,6 +87,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/doc/README.md b/doc/README.md index d2bae266..95a382a3 100644 --- a/doc/README.md +++ b/doc/README.md @@ -565,8 +565,9 @@ build variant of quickjs-emscripten, and also the [DEBUG_SYNC] build variant. The debug sync build variant has extra instrumentation code for detecting memory leaks. -The class [TestQuickJSWASMModule] exposes the memory leak detection API, although -this API is only accurate when using `DEBUG_SYNC` variant. +The class [TestQuickJSWASMModule] exposes the memory leak detection API, +although this API is only accurate when using `DEBUG_SYNC` variant. You can also +enable [debug logging](#debugging) to help diagnose failures. ```typescript // Define your test suite in a function, so that you can test against @@ -748,40 +749,51 @@ You can use quickjs-emscripten directly from an HTML file in two ways: ### Debugging -- Switch to a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library: +Debug logging can be enabled globally, or for specific runtimes. You need to use a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library. - ```typescript - import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" +```typescript +import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" + +const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) +``` + +With quickjs-emscripten-core: - const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) - ``` +```typescript +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" + +const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) +``` - With quickjs-emscripten-core: +To enable debug logging globally, call [setDebugMode][setDebugMode]. This affects global Javascript parts of the library, like the module loader and asyncify internals, and is inherited by runtimes created after the call. - ```typescript - import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" - import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" +```typescript +import { setDebugMode } from "quickjs-emscripten" - const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) - ``` +setDebugMode(true) +``` -- Enable debug log messages from the Javascript part of this library with [setDebugMode][setDebugMode]: +With quickjs-emscripten-core: - ```typescript - import { setDebugMode } from "quickjs-emscripten" +```typescript +import { setDebugMode } from "quickjs-emscripten-core" - setDebugMode(true) - ``` +setDebugMode(true) +``` - With quickjs-emscripten-core: +To enable debug logging for a specific runtime, call [setDebugModeRt][setDebugModeRt]. This affects only the runtime and its associated contexts. - ```typescript - import { setDebugMode } from "quickjs-emscripten-core" +```typescript +const runtime = QuickJS.newRuntime() +runtime.setDebugMode(true) - setDebugMode(true) - ``` +const context = QuickJS.newContext() +context.runtime.setDebugMode(true) +``` [setDebugMode]: doc/quickjs-emscripten/exports.md#setdebugmode +[setDebugModeRt]: https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md#setdebugmode ### Supported Platforms diff --git a/doc/quickjs-emscripten-core/classes/DisposableFail.md b/doc/quickjs-emscripten-core/classes/DisposableFail.md new file mode 100644 index 00000000..3a615c2c --- /dev/null +++ b/doc/quickjs-emscripten-core/classes/DisposableFail.md @@ -0,0 +1,246 @@ +[quickjs-emscripten](../../packages.md) • **quickjs-emscripten-core** • [Readme](../README.md) \| [Exports](../exports.md) + +*** + +[quickjs-emscripten](../../packages.md) / [quickjs-emscripten-core](../exports.md) / DisposableFail + +# Class: DisposableFail\ + +## Contents + +- [Extends](DisposableFail.md#extends) +- [Type parameters](DisposableFail.md#type-parameters) +- [Constructors](DisposableFail.md#constructors) + - [new DisposableFail(error, onUnwrap)](DisposableFail.md#new-disposablefailerror-onunwrap) +- [Properties](DisposableFail.md#properties) + - [error](DisposableFail.md#error) +- [Accessors](DisposableFail.md#accessors) + - [alive](DisposableFail.md#alive) +- [Methods](DisposableFail.md#methods) + - [`[dispose]`()](DisposableFail.md#dispose) + - [dispose()](DisposableFail.md#dispose) + - [unwrap()](DisposableFail.md#unwrap) + - [unwrapOr()](DisposableFail.md#unwrapor) + - [fail()](DisposableFail.md#fail) + - [is()](DisposableFail.md#is) + - [success()](DisposableFail.md#success) + +## Extends + +- `AbstractDisposableResult` + +## Type parameters + +• **F** + +## Constructors + +### new DisposableFail(error, onUnwrap) + +> **new DisposableFail**\<`F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L426) + +## Properties + +### error + +> **`readonly`** **error**: `F` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:433](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L433) + +## Methods + +### `[dispose]`() + +> **[dispose]**(): `void` + +Just calls the standard .dispose() method of this class. + +#### Returns + +`void` + +#### Inherited from + +`AbstractDisposableResult.[dispose]` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L437) + +*** + +### unwrap() + +> **unwrap**(): `never` + +#### Returns + +`never` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:443](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L443) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`fallback`): `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **fallback**: `T` + +#### Returns + +`T` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:448](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L448) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Inherited from + +`AbstractDisposableResult.fail` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) + +*** + +### is() + +> **`static`** **is**\<`S`, `F`\>(`result`): `result is DisposableResult` + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **result**: [`SuccessOrFail`](../exports.md#successorfails-f)\<`S`, `F`\> + +#### Returns + +`result is DisposableResult` + +#### Inherited from + +`AbstractDisposableResult.is` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) + +*** + +### success() + +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +`AbstractDisposableResult.success` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) + +*** + +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/classes/DisposableSuccess.md b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md new file mode 100644 index 00000000..ff6d43a1 --- /dev/null +++ b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md @@ -0,0 +1,255 @@ +[quickjs-emscripten](../../packages.md) • **quickjs-emscripten-core** • [Readme](../README.md) \| [Exports](../exports.md) + +*** + +[quickjs-emscripten](../../packages.md) / [quickjs-emscripten-core](../exports.md) / DisposableSuccess + +# Class: DisposableSuccess\ + +## Contents + +- [Extends](DisposableSuccess.md#extends) +- [Type parameters](DisposableSuccess.md#type-parameters) +- [Constructors](DisposableSuccess.md#constructors) + - [new DisposableSuccess(value)](DisposableSuccess.md#new-disposablesuccessvalue) +- [Properties](DisposableSuccess.md#properties) + - [error?](DisposableSuccess.md#error) + - [value](DisposableSuccess.md#value) +- [Accessors](DisposableSuccess.md#accessors) + - [alive](DisposableSuccess.md#alive) +- [Methods](DisposableSuccess.md#methods) + - [`[dispose]`()](DisposableSuccess.md#dispose) + - [dispose()](DisposableSuccess.md#dispose) + - [unwrap()](DisposableSuccess.md#unwrap) + - [unwrapOr()](DisposableSuccess.md#unwrapor) + - [fail()](DisposableSuccess.md#fail) + - [is()](DisposableSuccess.md#is) + - [success()](DisposableSuccess.md#success) + +## Extends + +- `AbstractDisposableResult` + +## Type parameters + +• **S** + +## Constructors + +### new DisposableSuccess(value) + +> **new DisposableSuccess**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) + +## Properties + +### error? + +> **error**?: `undefined` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) + +*** + +### value + +> **`readonly`** **value**: `S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L406) + +## Methods + +### `[dispose]`() + +> **[dispose]**(): `void` + +Just calls the standard .dispose() method of this class. + +#### Returns + +`void` + +#### Inherited from + +`AbstractDisposableResult.[dispose]` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`_fallback`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **\_fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:420](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L420) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Inherited from + +`AbstractDisposableResult.fail` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) + +*** + +### is() + +> **`static`** **is**\<`S`, `F`\>(`result`): `result is DisposableResult` + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **result**: [`SuccessOrFail`](../exports.md#successorfails-f)\<`S`, `F`\> + +#### Returns + +`result is DisposableResult` + +#### Inherited from + +`AbstractDisposableResult.is` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) + +*** + +### success() + +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +`AbstractDisposableResult.success` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) + +*** + +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/classes/Lifetime.md b/doc/quickjs-emscripten-core/classes/Lifetime.md index 7aa464f9..e7143477 100644 --- a/doc/quickjs-emscripten-core/classes/Lifetime.md +++ b/doc/quickjs-emscripten-core/classes/Lifetime.md @@ -85,7 +85,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L82) +[packages/quickjs-emscripten-core/src/lifetime.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L83) ## Properties @@ -95,7 +95,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L71) +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -105,7 +105,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -115,7 +115,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -125,7 +125,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L83) +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -143,7 +143,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -161,7 +161,7 @@ the creator. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -179,7 +179,7 @@ false after the object has been [dispose](Lifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L91) +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -193,7 +193,7 @@ false after the object has been [dispose](Lifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L110) +[packages/quickjs-emscripten-core/src/lifetime.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L111) *** @@ -207,7 +207,7 @@ false after the object has been [dispose](Lifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L106) +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -228,7 +228,7 @@ If the lifetime has been [dispose](Lifetime.md#dispose-1)d already. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L101) +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -252,7 +252,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -280,7 +280,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:134](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L134) +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -300,7 +300,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L137) +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -324,7 +324,7 @@ Dispose of [value](Lifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L148) +[packages/quickjs-emscripten-core/src/lifetime.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L149) *** @@ -340,7 +340,7 @@ Create a new handle pointing to the same [value](Lifetime.md#value-1). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L117) +[packages/quickjs-emscripten-core/src/lifetime.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L118) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index ef0303d1..381ebb48 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -29,20 +29,27 @@ host functions as though they were synchronous. - [Methods](QuickJSAsyncContext.md#methods) - [`[dispose]`()](QuickJSAsyncContext.md#dispose) - [callFunction()](QuickJSAsyncContext.md#callfunction) + - [callMethod()](QuickJSAsyncContext.md#callmethod) - [decodeBinaryJSON()](QuickJSAsyncContext.md#decodebinaryjson) - [defineProp()](QuickJSAsyncContext.md#defineprop) - [dispose()](QuickJSAsyncContext.md#dispose) - [dump()](QuickJSAsyncContext.md#dump) - [encodeBinaryJSON()](QuickJSAsyncContext.md#encodebinaryjson) + - [eq()](QuickJSAsyncContext.md#eq) - [evalCode()](QuickJSAsyncContext.md#evalcode) - [evalCodeAsync()](QuickJSAsyncContext.md#evalcodeasync) + - [fail()](QuickJSAsyncContext.md#fail) - [getArrayBuffer()](QuickJSAsyncContext.md#getarraybuffer) - [getBigInt()](QuickJSAsyncContext.md#getbigint) + - [getIterator()](QuickJSAsyncContext.md#getiterator) + - [getLength()](QuickJSAsyncContext.md#getlength) - [getNumber()](QuickJSAsyncContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSAsyncContext.md#getownpropertynames) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) - [getString()](QuickJSAsyncContext.md#getstring) - [getSymbol()](QuickJSAsyncContext.md#getsymbol) + - [getWellKnownSymbol()](QuickJSAsyncContext.md#getwellknownsymbol) - [newArray()](QuickJSAsyncContext.md#newarray) - [newArrayBuffer()](QuickJSAsyncContext.md#newarraybuffer) - [newAsyncifiedFunction()](QuickJSAsyncContext.md#newasyncifiedfunction) @@ -56,7 +63,10 @@ host functions as though they were synchronous. - [newSymbolFor()](QuickJSAsyncContext.md#newsymbolfor) - [newUniqueSymbol()](QuickJSAsyncContext.md#newuniquesymbol) - [resolvePromise()](QuickJSAsyncContext.md#resolvepromise) + - [sameValue()](QuickJSAsyncContext.md#samevalue) + - [sameValueZero()](QuickJSAsyncContext.md#samevaluezero) - [setProp()](QuickJSAsyncContext.md#setprop) + - [success()](QuickJSAsyncContext.md#success) - [throw()](QuickJSAsyncContext.md#throw) - [typeof()](QuickJSAsyncContext.md#typeof) - [unwrapResult()](QuickJSAsyncContext.md#unwrapresult) @@ -102,7 +112,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L182) +[packages/quickjs-emscripten-core/src/context.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -136,7 +146,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L210) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -152,7 +162,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:268](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L268) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -170,7 +180,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -186,7 +196,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:242](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L242) +[packages/quickjs-emscripten-core/src/context.ts:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -202,7 +212,7 @@ You can set properties to create global variables. #### 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:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -218,7 +228,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:229](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L229) +[packages/quickjs-emscripten-core/src/context.ts:275](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L275) ## Methods @@ -238,15 +248,18 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> -[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). +[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) or +[`func.apply(thisVal, args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). Call a JSValue as a function. See [unwrapResult](QuickJSAsyncContext.md#unwrapresult), which will throw if the function returned an error, or @@ -254,7 +267,44 @@ return the result handle directly. If evaluation returned a handle containing a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to convert it to a native promise and [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to finish evaluating the promise. -#### Parameters +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **args?**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +A result. If the function threw synchronously, `result.error` be a +handle to the exception. Otherwise `result.value` will be a handle to the +value. + +Example: + +```typescript +using parseIntHandle = context.getProp(global, "parseInt") +using stringHandle = context.newString("42") +using resultHandle = context.callFunction(parseIntHandle, context.undefined, stringHandle).unwrap() +console.log(context.dump(resultHandle)) // 42 +``` + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1060](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1060) + +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) @@ -262,9 +312,39 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver • ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1065](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1065) + +*** + +### callMethod() + +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +`handle[key](...args)` + +Call a method on a JSValue. This is a convenience method that calls [getProp](QuickJSAsyncContext.md#getprop) and [callFunction](QuickJSAsyncContext.md#callfunction). + +#### Parameters + +• **thisHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **key**: [`QuickJSPropertyKey`](../exports.md#quickjspropertykey) + +• **args**: [`QuickJSHandle`](../exports.md#quickjshandle)[]= `[]` + #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> A result. If the function threw synchronously, `result.error` be a handle to the exception. Otherwise `result.value` will be a handle to the @@ -272,11 +352,11 @@ value. #### Inherited from -[`quickjs-emscripten-core.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) +[`quickjs-emscripten-core.QuickJSContext.callMethod`](QuickJSContext.md#callmethod) #### Source -[packages/quickjs-emscripten-core/src/context.ts:834](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L834) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -309,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1160) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -340,7 +420,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:785](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L785) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -365,7 +445,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -391,7 +471,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:972](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L972) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -425,13 +505,40 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1143) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) + +*** + +### eq() + +> **eq**(`handle`, `other`): `boolean` + +`handle === other` - IsStrictlyEqual. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.eq`](QuickJSContext.md#eq) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -475,7 +582,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> The last statement's value. If the code threw synchronously, `result.error` will be a handle to the exception. If execution was @@ -488,13 +595,13 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:894](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L894) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -510,7 +617,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source @@ -518,6 +625,28 @@ See [EvalFlags](../exports.md#evalflags) for number semantics *** +### fail() + +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.fail`](QuickJSContext.md#fail) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) + +*** + ### getArrayBuffer() > **getArrayBuffer**(`handle`): [`Lifetime`](Lifetime.md)\<`Uint8Array`, `never`, `never`\> @@ -538,7 +667,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -562,7 +691,78 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:633](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L633) +[packages/quickjs-emscripten-core/src/context.ts:682](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L682) + +*** + +### getIterator() + +> **getIterator**(`iterableHandle`): `QuickJSContextResult`\<`QuickJSIterator`\> + +`handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). +Returns a host iterator that wraps and proxies calls to a guest iterator handle. +Each step of the iteration returns a result, either an error or a handle to the next value. +Once the iterator is done, the handle is automatically disposed, and the iterator +is considered done if the handle is disposed. + +```typescript +for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { + using keyHandle = context.getProp(entriesHandle, 0) + using valueHandle = context.getProp(entriesHandle, 1) + console.log(context.dump(keyHandle), '->', context.dump(valueHandle)) +} +``` + +#### Parameters + +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`QuickJSContextResult`\<`QuickJSIterator`\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getIterator`](QuickJSContext.md#getiterator) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length` as a host number. + +Example use: +```typescript +const length = context.getLength(arrayHandle) ?? 0 +for (let i = 0; i < length; i++) { + using value = context.getProp(arrayHandle, i) + console.log(`array[${i}] =`, context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +a number if the handle has a numeric length property, otherwise `undefined`. + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getLength`](QuickJSContext.md#getlength) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -588,7 +788,61 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) +[packages/quickjs-emscripten-core/src/context.ts:653](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L653) + +*** + +### getOwnPropertyNames() + +> **getOwnPropertyNames**(`handle`, `options`): `QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), +but with extra, non-standard options for: + +- fetching array indexes as numbers (`numbers: true`) +- including symbols (`symbols: true`) +- only iterating over enumerable properties (`onlyEnumerable: true`) + +The default behavior is to emulate the standard: +```typescript +context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) +``` + +Note when passing an explicit options object, you must set at least one +option, and `strings` are not included unless specified. + +Example use: +```typescript +for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { + using value = context.getProp(handle, prop) + console.log(context.dump(prop), '->', context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions`= `undefined` + +#### Returns + +`QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +an an array of handles of the property names. The array itself is disposable for your convenience. + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getOwnPropertyNames`](QuickJSContext.md#getownpropertynames) + +#### Throws + +QuickJSEmptyGetOwnPropertyNames if no options are set. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:908](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L908) *** @@ -622,7 +876,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:667](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L667) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -652,7 +906,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:749](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L749) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -676,7 +930,7 @@ Converts `handle` to a Javascript string. #### 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) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -701,7 +955,31 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:621](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L621) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) + +*** + +### getWellKnownSymbol() + +> **getWellKnownSymbol**(`name`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Access a well-known symbol that is a property of the global Symbol object, like `Symbol.iterator`. + +#### Parameters + +• **name**: `string` + +#### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getWellKnownSymbol`](QuickJSContext.md#getwellknownsymbol) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -722,7 +1000,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:382](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L382) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -746,7 +1024,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:390](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L390) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -802,7 +1080,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -830,7 +1108,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:559](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L559) +[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) #### newError(message) @@ -850,7 +1128,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:560](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L560) +[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -866,7 +1144,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:561](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L561) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -983,7 +1261,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:553](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L553) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1007,7 +1285,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L307) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1034,7 +1312,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:368](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L368) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1059,7 +1337,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:403](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L403) +[packages/quickjs-emscripten-core/src/context.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L452) #### newPromise(promise) @@ -1085,7 +1363,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:411](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L411) +[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(newPromiseFn) @@ -1110,7 +1388,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L418) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1134,7 +1412,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1159,7 +1437,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1184,13 +1462,13 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:325](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L325) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1204,7 +1482,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from @@ -1216,7 +1494,61 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:706](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L706) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) + +*** + +### sameValue() + +> **sameValue**(`handle`, `other`): `boolean` + +`Object.is(a, b)` +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.sameValue`](QuickJSContext.md#samevalue) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) + +*** + +### sameValueZero() + +> **sameValueZero**(`handle`, `other`): `boolean` + +SameValueZero comparison. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.sameValueZero`](QuickJSContext.md#samevaluezero) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1253,7 +1585,33 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:770](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L770) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.success`](QuickJSContext.md#success) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1277,7 +1635,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:931](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L931) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1305,7 +1663,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:595](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L595) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1336,7 +1694,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:1015](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1015) +[packages/quickjs-emscripten-core/src/context.ts:1278](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1278) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md index a8fdb7ca..d6c4945f 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md @@ -41,13 +41,16 @@ Configure ES module loading with [setModuleLoader](QuickJSAsyncRuntime.md#setmod - [`[dispose]`()](QuickJSAsyncRuntime.md#dispose) - [assertOwned()](QuickJSAsyncRuntime.md#assertowned) - [computeMemoryUsage()](QuickJSAsyncRuntime.md#computememoryusage) + - [debugLog()](QuickJSAsyncRuntime.md#debuglog) - [dispose()](QuickJSAsyncRuntime.md#dispose) - [dumpMemoryUsage()](QuickJSAsyncRuntime.md#dumpmemoryusage) - [executePendingJobs()](QuickJSAsyncRuntime.md#executependingjobs) - [hasPendingJob()](QuickJSAsyncRuntime.md#haspendingjob) + - [isDebugMode()](QuickJSAsyncRuntime.md#isdebugmode) - [newContext()](QuickJSAsyncRuntime.md#newcontext) - [removeInterruptHandler()](QuickJSAsyncRuntime.md#removeinterrupthandler) - [removeModuleLoader()](QuickJSAsyncRuntime.md#removemoduleloader) + - [setDebugMode()](QuickJSAsyncRuntime.md#setdebugmode) - [setInterruptHandler()](QuickJSAsyncRuntime.md#setinterrupthandler) - [setMaxStackSize()](QuickJSAsyncRuntime.md#setmaxstacksize) - [setMemoryLimit()](QuickJSAsyncRuntime.md#setmemorylimit) @@ -93,7 +96,7 @@ false after the object has been [dispose](QuickJSAsyncRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L122) +[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) ## Methods @@ -113,7 +116,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -141,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:326](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L326) +[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) *** @@ -165,7 +168,34 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSAsyncRuntime #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:295](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L295) +[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) + +*** + +### debugLog() + +> **debugLog**(...`msg`): `void` + +In debug mode, log the result of calling `msg()`. + +We take a function instead of a log message to avoid expensive string +manipulation if debug logging is disabled. + +#### Parameters + +• ...**msg**: `unknown`[] + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSRuntime.debugLog`](QuickJSRuntime.md#debuglog) + +#### 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) *** @@ -185,7 +215,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L126) +[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) *** @@ -206,7 +236,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSAsy #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:306](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L306) +[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) *** @@ -244,7 +274,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:240](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L240) +[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) *** @@ -267,7 +297,27 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L191) +[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) + +*** + +### isDebugMode() + +> **isDebugMode**(): `boolean` + +#### Returns + +`boolean` + +true if debug logging is enabled + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSRuntime.isDebugMode`](QuickJSRuntime.md#isdebugmode) + +#### 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) *** @@ -316,7 +366,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L216) +[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) *** @@ -336,7 +386,34 @@ Remove the the loader set by [setModuleLoader](QuickJSAsyncRuntime.md#setmodulel #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L178) +[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) + +*** + +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable or disable debug logging. + +If this module is a DEBUG variant, more logs will be printed from the C +code. + +#### Parameters + +• **enabled**: `boolean` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSRuntime.setDebugMode`](QuickJSRuntime.md#setdebugmode) + +#### 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) *** @@ -364,7 +441,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSAsyncR #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L204) +[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) *** @@ -417,7 +494,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:280](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L280) +[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index 2cfd6a25..0e9bf229 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -54,19 +54,26 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [Methods](QuickJSContext.md#methods) - [`[dispose]`()](QuickJSContext.md#dispose) - [callFunction()](QuickJSContext.md#callfunction) + - [callMethod()](QuickJSContext.md#callmethod) - [decodeBinaryJSON()](QuickJSContext.md#decodebinaryjson) - [defineProp()](QuickJSContext.md#defineprop) - [dispose()](QuickJSContext.md#dispose) - [dump()](QuickJSContext.md#dump) - [encodeBinaryJSON()](QuickJSContext.md#encodebinaryjson) + - [eq()](QuickJSContext.md#eq) - [evalCode()](QuickJSContext.md#evalcode) + - [fail()](QuickJSContext.md#fail) - [getArrayBuffer()](QuickJSContext.md#getarraybuffer) - [getBigInt()](QuickJSContext.md#getbigint) + - [getIterator()](QuickJSContext.md#getiterator) + - [getLength()](QuickJSContext.md#getlength) - [getNumber()](QuickJSContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSContext.md#getownpropertynames) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) - [getString()](QuickJSContext.md#getstring) - [getSymbol()](QuickJSContext.md#getsymbol) + - [getWellKnownSymbol()](QuickJSContext.md#getwellknownsymbol) - [newArray()](QuickJSContext.md#newarray) - [newArrayBuffer()](QuickJSContext.md#newarraybuffer) - [newBigInt()](QuickJSContext.md#newbigint) @@ -79,7 +86,10 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [newSymbolFor()](QuickJSContext.md#newsymbolfor) - [newUniqueSymbol()](QuickJSContext.md#newuniquesymbol) - [resolvePromise()](QuickJSContext.md#resolvepromise) + - [sameValue()](QuickJSContext.md#samevalue) + - [sameValueZero()](QuickJSContext.md#samevaluezero) - [setProp()](QuickJSContext.md#setprop) + - [success()](QuickJSContext.md#success) - [throw()](QuickJSContext.md#throw) - [typeof()](QuickJSContext.md#typeof) - [unwrapResult()](QuickJSContext.md#unwrapresult) @@ -130,7 +140,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L182) +[packages/quickjs-emscripten-core/src/context.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -142,7 +152,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L152) +[packages/quickjs-emscripten-core/src/context.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L187) ## Accessors @@ -160,7 +170,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L210) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -176,7 +186,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:268](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L268) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -194,7 +204,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -210,7 +220,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:242](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L242) +[packages/quickjs-emscripten-core/src/context.ts:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -226,7 +236,7 @@ You can set properties to create global variables. #### 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:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -242,7 +252,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:229](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L229) +[packages/quickjs-emscripten-core/src/context.ts:275](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L275) ## Methods @@ -266,15 +276,18 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> -[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). +[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) or +[`func.apply(thisVal, args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). Call a JSValue as a function. See [unwrapResult](QuickJSContext.md#unwrapresult), which will throw if the function returned an error, or @@ -282,29 +295,92 @@ return the result handle directly. If evaluation returned a handle containing a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it to a native promise and [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to finish evaluating the promise. -#### Parameters +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) • **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) -• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +• **args?**: [`QuickJSHandle`](../exports.md#quickjshandle)[] -#### Returns +##### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> A result. If the function threw synchronously, `result.error` be a handle to the exception. Otherwise `result.value` will be a handle to the value. -#### Implementation of +Example: + +```typescript +using parseIntHandle = context.getProp(global, "parseInt") +using stringHandle = context.newString("42") +using resultHandle = context.callFunction(parseIntHandle, context.undefined, stringHandle).unwrap() +console.log(context.dump(resultHandle)) // 42 +``` + +##### Implementation of [`quickjs-emscripten-core.LowLevelJavascriptVm.callFunction`](../interfaces/LowLevelJavascriptVm.md#callfunction) +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1060](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1060) + +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Implementation of + +`LowLevelJavascriptVm.callFunction` + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1065](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1065) + +*** + +### callMethod() + +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +`handle[key](...args)` + +Call a method on a JSValue. This is a convenience method that calls [getProp](QuickJSContext.md#getprop) and [callFunction](QuickJSContext.md#callfunction). + +#### Parameters + +• **thisHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **key**: [`QuickJSPropertyKey`](../exports.md#quickjspropertykey) + +• **args**: [`QuickJSHandle`](../exports.md#quickjshandle)[]= `[]` + +#### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +A result. If the function threw synchronously, `result.error` be a +handle to the exception. Otherwise `result.value` will be a handle to the +value. + #### Source -[packages/quickjs-emscripten-core/src/context.ts:834](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L834) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -333,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1160) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -364,7 +440,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:785](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L785) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -393,7 +469,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -415,7 +491,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:972](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L972) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -445,13 +521,36 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1143](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1143) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) + +*** + +### eq() + +> **eq**(`handle`, `other`): `boolean` + +`handle === other` - IsStrictlyEqual. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -495,7 +594,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> The last statement's value. If the code threw synchronously, `result.error` will be a handle to the exception. If execution was @@ -508,7 +607,25 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:894](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L894) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) + +*** + +### fail() + +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -528,7 +645,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -548,7 +665,70 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:633](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L633) +[packages/quickjs-emscripten-core/src/context.ts:682](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L682) + +*** + +### getIterator() + +> **getIterator**(`iterableHandle`): `QuickJSContextResult`\<`QuickJSIterator`\> + +`handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). +Returns a host iterator that wraps and proxies calls to a guest iterator handle. +Each step of the iteration returns a result, either an error or a handle to the next value. +Once the iterator is done, the handle is automatically disposed, and the iterator +is considered done if the handle is disposed. + +```typescript +for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { + using keyHandle = context.getProp(entriesHandle, 0) + using valueHandle = context.getProp(entriesHandle, 1) + console.log(context.dump(keyHandle), '->', context.dump(valueHandle)) +} +``` + +#### Parameters + +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`QuickJSContextResult`\<`QuickJSIterator`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length` as a host number. + +Example use: +```typescript +const length = context.getLength(arrayHandle) ?? 0 +for (let i = 0; i < length; i++) { + using value = context.getProp(arrayHandle, i) + console.log(`array[${i}] =`, context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +a number if the handle has a numeric length property, otherwise `undefined`. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -574,7 +754,57 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) +[packages/quickjs-emscripten-core/src/context.ts:653](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L653) + +*** + +### getOwnPropertyNames() + +> **getOwnPropertyNames**(`handle`, `options`): `QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), +but with extra, non-standard options for: + +- fetching array indexes as numbers (`numbers: true`) +- including symbols (`symbols: true`) +- only iterating over enumerable properties (`onlyEnumerable: true`) + +The default behavior is to emulate the standard: +```typescript +context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) +``` + +Note when passing an explicit options object, you must set at least one +option, and `strings` are not included unless specified. + +Example use: +```typescript +for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { + using value = context.getProp(handle, prop) + console.log(context.dump(prop), '->', context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions`= `undefined` + +#### Returns + +`QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +an an array of handles of the property names. The array itself is disposable for your convenience. + +#### Throws + +QuickJSEmptyGetOwnPropertyNames if no options are set. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:908](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L908) *** @@ -604,7 +834,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:667](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L667) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -634,7 +864,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:749](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L749) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -658,7 +888,7 @@ Converts `handle` to a Javascript string. #### 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) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -679,7 +909,27 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:621](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L621) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) + +*** + +### getWellKnownSymbol() + +> **getWellKnownSymbol**(`name`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Access a well-known symbol that is a property of the global Symbol object, like `Symbol.iterator`. + +#### Parameters + +• **name**: `string` + +#### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -696,7 +946,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:382](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L382) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -716,7 +966,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:390](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L390) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -736,7 +986,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -760,7 +1010,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:559](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L559) +[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) #### newError(message) @@ -776,7 +1026,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:560](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L560) +[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -788,7 +1038,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:561](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L561) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -905,7 +1155,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:553](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L553) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -929,7 +1179,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L307) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -956,7 +1206,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:368](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L368) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -977,7 +1227,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:403](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L403) +[packages/quickjs-emscripten-core/src/context.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L452) #### newPromise(promise) @@ -999,7 +1249,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:411](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L411) +[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(newPromiseFn) @@ -1020,7 +1270,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L418) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1044,7 +1294,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1065,7 +1315,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:337](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L337) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1086,13 +1336,13 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:325](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L325) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1106,7 +1356,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks @@ -1114,7 +1364,53 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:706](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L706) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) + +*** + +### sameValue() + +> **sameValue**(`handle`, `other`): `boolean` + +`Object.is(a, b)` +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) + +*** + +### sameValueZero() + +> **sameValueZero**(`handle`, `other`): `boolean` + +SameValueZero comparison. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1151,7 +1447,29 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:770](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L770) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1171,7 +1489,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:931](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L931) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1199,7 +1517,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:595](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L595) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1226,7 +1544,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:1015](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1015) +[packages/quickjs-emscripten-core/src/context.ts:1278](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1278) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSDeferredPromise.md b/doc/quickjs-emscripten-core/classes/QuickJSDeferredPromise.md index 0fdf1fca..6dea485c 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSDeferredPromise.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSDeferredPromise.md @@ -172,7 +172,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md index d1e88655..f8bf2eff 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md @@ -42,13 +42,16 @@ Configure ES module loading with [setModuleLoader](QuickJSRuntime.md#setmodulelo - [`[dispose]`()](QuickJSRuntime.md#dispose) - [assertOwned()](QuickJSRuntime.md#assertowned) - [computeMemoryUsage()](QuickJSRuntime.md#computememoryusage) + - [debugLog()](QuickJSRuntime.md#debuglog) - [dispose()](QuickJSRuntime.md#dispose) - [dumpMemoryUsage()](QuickJSRuntime.md#dumpmemoryusage) - [executePendingJobs()](QuickJSRuntime.md#executependingjobs) - [hasPendingJob()](QuickJSRuntime.md#haspendingjob) + - [isDebugMode()](QuickJSRuntime.md#isdebugmode) - [newContext()](QuickJSRuntime.md#newcontext) - [removeInterruptHandler()](QuickJSRuntime.md#removeinterrupthandler) - [removeModuleLoader()](QuickJSRuntime.md#removemoduleloader) + - [setDebugMode()](QuickJSRuntime.md#setdebugmode) - [setInterruptHandler()](QuickJSRuntime.md#setinterrupthandler) - [setMaxStackSize()](QuickJSRuntime.md#setmaxstacksize) - [setMemoryLimit()](QuickJSRuntime.md#setmemorylimit) @@ -76,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:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L79) +[packages/quickjs-emscripten-core/src/runtime.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L78) ## Accessors @@ -94,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L122) +[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) ## Methods @@ -118,7 +121,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -142,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:326](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L326) +[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) *** @@ -162,7 +165,30 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSRuntime.md#d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:295](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L295) +[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) + +*** + +### debugLog() + +> **debugLog**(...`msg`): `void` + +In debug mode, log the result of calling `msg()`. + +We take a function instead of a log message to avoid expensive string +manipulation if debug logging is disabled. + +#### Parameters + +• ...**msg**: `unknown`[] + +#### Returns + +`void` + +#### 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) *** @@ -186,7 +212,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L126) +[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) *** @@ -203,7 +229,7 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSRun #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:306](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L306) +[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) *** @@ -237,7 +263,7 @@ functions or rejected promises. Those errors are available by calling #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:240](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L240) +[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) *** @@ -256,7 +282,23 @@ true if there is at least one pendingJob queued up. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L191) +[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) + +*** + +### isDebugMode() + +> **isDebugMode**(): `boolean` + +#### Returns + +`boolean` + +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) *** @@ -280,7 +322,7 @@ You should dispose a created context before disposing this runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L137) +[packages/quickjs-emscripten-core/src/runtime.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L140) *** @@ -297,7 +339,7 @@ See [setInterruptHandler](QuickJSRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L216) +[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) *** @@ -313,7 +355,30 @@ Remove the the loader set by [setModuleLoader](QuickJSRuntime.md#setmoduleloader #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L178) +[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) + +*** + +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable or disable debug logging. + +If this module is a DEBUG variant, more logs will be printed from the C +code. + +#### Parameters + +• **enabled**: `boolean` + +#### Returns + +`void` + +#### 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) *** @@ -337,7 +402,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSRuntim #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L204) +[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) *** @@ -358,7 +423,7 @@ To remove the limit, set to `0`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L314) +[packages/quickjs-emscripten-core/src/runtime.ts:315](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L315) *** @@ -379,7 +444,7 @@ To remove the limit, set to `-1`. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:280](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L280) +[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) *** @@ -404,7 +469,7 @@ The loader can be removed with [removeModuleLoader](QuickJSRuntime.md#removemodu #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:169](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L169) +[packages/quickjs-emscripten-core/src/runtime.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L172) *** diff --git a/doc/quickjs-emscripten-core/classes/Scope.md b/doc/quickjs-emscripten-core/classes/Scope.md index 20793314..682fafd8 100644 --- a/doc/quickjs-emscripten-core/classes/Scope.md +++ b/doc/quickjs-emscripten-core/classes/Scope.md @@ -63,7 +63,7 @@ false after the object has been [dispose](Scope.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L307) +[packages/quickjs-emscripten-core/src/lifetime.ts:308](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L308) ## Methods @@ -87,7 +87,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -111,7 +111,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:311](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L311) +[packages/quickjs-emscripten-core/src/lifetime.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L312) *** @@ -135,7 +135,7 @@ Track `lifetime` so that it is disposed when this scope is disposed. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:302](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L302) +[packages/quickjs-emscripten-core/src/lifetime.ts:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L303) *** @@ -165,7 +165,7 @@ Do not use with async functions. Instead, use [withScopeAsync](Scope.md#withscop #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L247) +[packages/quickjs-emscripten-core/src/lifetime.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L248) *** @@ -192,7 +192,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:284](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L284) +[packages/quickjs-emscripten-core/src/lifetime.ts:285](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L285) *** @@ -220,7 +220,7 @@ block returns. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L260) +[packages/quickjs-emscripten-core/src/lifetime.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L261) *** diff --git a/doc/quickjs-emscripten-core/classes/StaticLifetime.md b/doc/quickjs-emscripten-core/classes/StaticLifetime.md index b117faf2..6b93e251 100644 --- a/doc/quickjs-emscripten-core/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten-core/classes/StaticLifetime.md @@ -64,7 +64,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L172) +[packages/quickjs-emscripten-core/src/lifetime.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L173) ## Properties @@ -78,7 +78,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L71) +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -92,7 +92,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -106,7 +106,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -120,7 +120,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L83) +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -142,7 +142,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -164,7 +164,7 @@ A Lifetime that lives forever. Used for constants. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -182,7 +182,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L91) +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -196,7 +196,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L177) +[packages/quickjs-emscripten-core/src/lifetime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L178) *** @@ -210,7 +210,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L106) +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -231,7 +231,7 @@ If the lifetime has been [dispose](StaticLifetime.md#dispose-1)d already. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L101) +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -251,7 +251,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -283,7 +283,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:134](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L134) +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -307,7 +307,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L137) +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -327,7 +327,7 @@ Dispose of [value](StaticLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L187) +[packages/quickjs-emscripten-core/src/lifetime.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L188) *** @@ -347,7 +347,7 @@ Create a new handle pointing to the same [value](StaticLifetime.md#value-1). #### 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) +[packages/quickjs-emscripten-core/src/lifetime.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L183) *** diff --git a/doc/quickjs-emscripten-core/classes/UsingDisposable.md b/doc/quickjs-emscripten-core/classes/UsingDisposable.md index c445bdab..6ac48e47 100644 --- a/doc/quickjs-emscripten-core/classes/UsingDisposable.md +++ b/doc/quickjs-emscripten-core/classes/UsingDisposable.md @@ -54,7 +54,7 @@ Base abstract class that helps implement [Disposable](../interfaces/Disposable.m #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L38) +[packages/quickjs-emscripten-core/src/lifetime.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L39) ## Methods @@ -74,7 +74,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -94,7 +94,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L42) +[packages/quickjs-emscripten-core/src/lifetime.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L43) *** diff --git a/doc/quickjs-emscripten-core/classes/WeakLifetime.md b/doc/quickjs-emscripten-core/classes/WeakLifetime.md index c5109c8a..c3e9d495 100644 --- a/doc/quickjs-emscripten-core/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten-core/classes/WeakLifetime.md @@ -74,7 +74,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L198) +[packages/quickjs-emscripten-core/src/lifetime.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L199) ## Properties @@ -88,7 +88,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L71) +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -102,7 +102,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -116,7 +116,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -130,7 +130,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L83) +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -152,7 +152,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -174,7 +174,7 @@ Used for function arguments. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -192,7 +192,7 @@ false after the object has been [dispose](WeakLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L91) +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -206,7 +206,7 @@ false after the object has been [dispose](WeakLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L110) +[packages/quickjs-emscripten-core/src/lifetime.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L111) *** @@ -220,7 +220,7 @@ false after the object has been [dispose](WeakLifetime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L106) +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -241,7 +241,7 @@ If the lifetime has been [dispose](WeakLifetime.md#dispose-1)d already. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L101) +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -261,7 +261,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L46) +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -293,7 +293,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:134](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L134) +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -317,7 +317,7 @@ the result of `map(this)`. ##### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L137) +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -337,7 +337,7 @@ Dispose of [value](WeakLifetime.md#value-1) and perform cleanup. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L208) +[packages/quickjs-emscripten-core/src/lifetime.ts:209](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L209) *** @@ -357,7 +357,7 @@ Create a new handle pointing to the same [value](WeakLifetime.md#value-1). #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L117) +[packages/quickjs-emscripten-core/src/lifetime.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L118) *** diff --git a/doc/quickjs-emscripten-core/exports.md b/doc/quickjs-emscripten-core/exports.md index f92748b6..ae015ee7 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -14,6 +14,8 @@ - [Type Aliases](exports.md#type-aliases) - [AsyncFunctionImplementation](exports.md#asyncfunctionimplementation) - [BorrowedHeapCharPointer](exports.md#borrowedheapcharpointer) + - [DisposableArray\](exports.md#disposablearrayt) + - [DisposableResult\](exports.md#disposableresults-f) - [EitherFFI](exports.md#eitherffi) - [EitherModule](exports.md#eithermodule) - [ExecutePendingJobsResult](exports.md#executependingjobsresult) @@ -38,6 +40,7 @@ - [JSValueConstPointerPointer](exports.md#jsvalueconstpointerpointer) - [JSValuePointer](exports.md#jsvaluepointer) - [JSValuePointerPointer](exports.md#jsvaluepointerpointer) + - [JSValuePointerPointerPointer](exports.md#jsvaluepointerpointerpointer) - [JSVoidPointer](exports.md#jsvoidpointer) - [OrLoader\](exports.md#orloadert) - [OwnedHeapCharPointer](exports.md#ownedheapcharpointer) @@ -51,21 +54,27 @@ - [QuickJSVariant](exports.md#quickjsvariant) - [StaticJSValue](exports.md#staticjsvalue) - [SuccessOrFail\](exports.md#successorfails-f) + - [UInt32Pointer](exports.md#uint32pointer) - [VmCallResult\](exports.md#vmcallresultvmhandle) - [VmFunctionImplementation\](exports.md#vmfunctionimplementationvmhandle) - [Variables](exports.md#variables) - [DefaultIntrinsics](exports.md#defaultintrinsics) + - [DisposableResult](exports.md#disposableresult) - [EvalFlags](exports.md#evalflags) + - [GetOwnPropertyNamesFlags](exports.md#getownpropertynamesflags) - [IntrinsicsFlags](exports.md#intrinsicsflags) + - [IsEqualOp](exports.md#isequalop) - [JSPromiseStateEnum](exports.md#jspromisestateenum-1) - [Functions](exports.md#functions) - [assertSync()](exports.md#assertsync) + - [createDisposableArray()](exports.md#createdisposablearray) - [isFail()](exports.md#isfail) - [isSuccess()](exports.md#issuccess) - [memoizePromiseFactory()](exports.md#memoizepromisefactory) - [newQuickJSAsyncWASMModuleFromVariant()](exports.md#newquickjsasyncwasmmodulefromvariant) - [newQuickJSWASMModuleFromVariant()](exports.md#newquickjswasmmodulefromvariant) - [newVariant()](exports.md#newvariant) + - [setDebugMode()](exports.md#setdebugmode) - [shouldInterruptAfterDeadline()](exports.md#shouldinterruptafterdeadline) ## Namespaces @@ -74,6 +83,8 @@ ## Classes +- [DisposableFail](classes/DisposableFail.md) +- [DisposableSuccess](classes/DisposableSuccess.md) - [Lifetime](classes/Lifetime.md) - [QuickJSAsyncContext](classes/QuickJSAsyncContext.md) - [QuickJSAsyncRuntime](classes/QuickJSAsyncRuntime.md) @@ -149,7 +160,42 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:66 +[packages/quickjs-ffi-types/src/ffi-types.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L82) + +*** + +### DisposableArray\ + +> **DisposableArray**\<`T`\>: `T`[] & [`Disposable`](interfaces/Disposable.md) + +An `Array` that also implements [Disposable](interfaces/Disposable.md): + +- Considered [Disposable#alive](interfaces/Disposable.md#alive) if any of its elements are `alive`. +- When [Disposable#dispose](interfaces/Disposable.md#dispose-1)d, it will dispose of all its elements that are `alive`. + +#### Type parameters + +• **T** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L329) + +*** + +### DisposableResult\ + +> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -159,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:66 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:496 +[packages/quickjs-ffi-types/src/variant-types.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L50) *** @@ -169,13 +215,13 @@ packages/quickjs-ffi-types/dist/index.d.ts:496 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:304 +[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) *** ### ExecutePendingJobsResult -> **ExecutePendingJobsResult**: [`SuccessOrFail`](exports.md#successorfails-f)\<`number`, [`QuickJSHandle`](exports.md#quickjshandle) & `Object`\> +> **ExecutePendingJobsResult**: [`DisposableResult`](exports.md#disposableresult)\<`number`, [`QuickJSHandle`](exports.md#quickjshandle) & `Object`\> Used as an optional for the results of executing pendingJobs. On success, `value` contains the number of async jobs executed @@ -185,7 +231,7 @@ by the runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:36](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L36) +[packages/quickjs-emscripten-core/src/runtime.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L35) *** @@ -210,7 +256,7 @@ Determines if a VM's execution should be interrupted. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:28](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L28) +[packages/quickjs-emscripten-core/src/runtime.ts:27](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L27) *** @@ -292,7 +338,7 @@ Language features that can be enabled or disabled in a QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/types.ts:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L145) +[packages/quickjs-emscripten-core/src/types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L146) *** @@ -305,7 +351,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:76 +[packages/quickjs-ffi-types/src/ffi-types.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L94) *** @@ -317,7 +363,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:76 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:20 +[packages/quickjs-ffi-types/src/ffi-types.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L19) *** @@ -329,7 +375,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:20 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:24 +[packages/quickjs-ffi-types/src/ffi-types.ts:24](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L24) *** @@ -341,7 +387,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:24 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:28 +[packages/quickjs-ffi-types/src/ffi-types.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L29) *** @@ -351,7 +397,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L68) +[packages/quickjs-emscripten-core/src/types.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L69) *** @@ -361,7 +407,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L69) +[packages/quickjs-emscripten-core/src/types.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L70) *** @@ -371,7 +417,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L67) +[packages/quickjs-emscripten-core/src/types.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L68) *** @@ -381,7 +427,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L86) +[packages/quickjs-emscripten-core/src/types.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L87) *** @@ -391,7 +437,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L87) +[packages/quickjs-emscripten-core/src/types.ts:88](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L88) *** @@ -401,7 +447,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -[packages/quickjs-emscripten-core/src/types.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L85) +[packages/quickjs-emscripten-core/src/types.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L86) *** @@ -426,7 +472,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +[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) *** @@ -438,7 +484,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:140 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:16 +[packages/quickjs-ffi-types/src/ffi-types.ts:14](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L14) *** @@ -494,7 +540,7 @@ See [JSValueConst](exports.md#jsvalueconst) and [StaticJSValue](exports.md#stati #### Source -packages/quickjs-ffi-types/dist/index.d.ts:38 +[packages/quickjs-ffi-types/src/ffi-types.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L41) *** @@ -506,7 +552,7 @@ Used internally for Javascript-to-C function calls. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:46 +[packages/quickjs-ffi-types/src/ffi-types.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L56) *** @@ -519,7 +565,7 @@ See [JSValue](exports.md#jsvalue). #### Source -packages/quickjs-ffi-types/dist/index.d.ts:33 +[packages/quickjs-ffi-types/src/ffi-types.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L35) *** @@ -531,7 +577,19 @@ Used internally for Javascript-to-C function calls. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:42 +[packages/quickjs-ffi-types/src/ffi-types.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L46) + +*** + +### JSValuePointerPointerPointer + +> **JSValuePointerPointerPointer**: `Pointer`\<`"*JSValue[]"`\> + +Used internally for Javascript-to-C function calls. + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L51) *** @@ -543,7 +601,7 @@ Opaque pointer that was allocated by js_malloc. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:80 +[packages/quickjs-ffi-types/src/ffi-types.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L99) *** @@ -570,7 +628,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:71 +[packages/quickjs-ffi-types/src/ffi-types.ts:88](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L88) *** @@ -596,7 +654,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:71 #### Source -[packages/quickjs-emscripten-core/src/types.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L286) +[packages/quickjs-emscripten-core/src/types.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L333) *** @@ -622,7 +680,7 @@ Used internally for C-to-Javascript function calls. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:53 +[packages/quickjs-ffi-types/src/ffi-types.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L66) *** @@ -634,7 +692,7 @@ Used internally for C-to-Javascript interrupt handlers. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:57 +[packages/quickjs-ffi-types/src/ffi-types.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L71) *** @@ -646,7 +704,7 @@ Used internally for C-to-Javascript module loading. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:61 +[packages/quickjs-ffi-types/src/ffi-types.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L76) *** @@ -662,7 +720,7 @@ You must dispose of any handles you create by calling the `.dispose()` method. #### Source -[packages/quickjs-emscripten-core/src/types.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L52) +[packages/quickjs-emscripten-core/src/types.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L53) *** @@ -675,7 +733,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L43) +[packages/quickjs-emscripten-core/src/context.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L69) *** @@ -685,7 +743,7 @@ Property key for getting or setting a property on a handle with #### Source -packages/quickjs-ffi-types/dist/index.d.ts:495 +[packages/quickjs-ffi-types/src/variant-types.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L49) *** @@ -721,6 +779,16 @@ Used as an optional. *** +### UInt32Pointer + +> **UInt32Pointer**: `Pointer`\<`"uint32_t"`\> + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L101) + +*** + ### VmCallResult\ > **VmCallResult**\<`VmHandle`\>: [`SuccessOrFail`](exports.md#successorfails-f)\<`VmHandle`, `VmHandle`\> @@ -827,7 +895,17 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q #### Source -[packages/quickjs-emscripten-core/src/types.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L172) +[packages/quickjs-emscripten-core/src/types.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L173) + +*** + +### DisposableResult + +> **DisposableResult**: *typeof* `AbstractDisposableResult` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -895,7 +973,49 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:89 +[packages/quickjs-ffi-types/src/ffi-types.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L106) + +*** + +### GetOwnPropertyNamesFlags + +> **GetOwnPropertyNamesFlags**: `Object` + +Bitfield options for QTS_GetOwnPropertyNames + +#### Type declaration + +##### JS\_GPN\_ENUM\_ONLY + +> **JS\_GPN\_ENUM\_ONLY**: `number` + +##### JS\_GPN\_PRIVATE\_MASK + +> **JS\_GPN\_PRIVATE\_MASK**: `number` + +##### JS\_GPN\_SET\_ENUM + +> **JS\_GPN\_SET\_ENUM**: `number` + +##### JS\_GPN\_STRING\_MASK + +> **JS\_GPN\_STRING\_MASK**: `number` + +##### JS\_GPN\_SYMBOL\_MASK + +> **JS\_GPN\_SYMBOL\_MASK**: `number` + +##### QTS\_GPN\_NUMBER\_MASK + +> **QTS\_GPN\_NUMBER\_MASK**: `number` + +##### QTS\_STANDARD\_COMPLIANT\_NUMBER + +> **QTS\_STANDARD\_COMPLIANT\_NUMBER**: `number` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L121) *** @@ -903,7 +1023,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:89 > **IntrinsicsFlags**: `Object` -Bitfield options for QTS_NewContext intrinsices +Bitfield options for QTS_NewContext intrinsics #### Type declaration @@ -973,7 +1093,31 @@ Bitfield options for QTS_NewContext intrinsices #### Source -packages/quickjs-ffi-types/dist/index.d.ts:117 +[packages/quickjs-ffi-types/src/ffi-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L111) + +*** + +### IsEqualOp + +> **IsEqualOp**: `Object` + +#### Type declaration + +##### IsSameValue + +> **IsSameValue**: [`IsEqualOp`](exports.md#isequalop) + +##### IsSameValueZero + +> **IsSameValueZero**: [`IsEqualOp`](exports.md#isequalop) + +##### IsStrictlyEqual + +> **IsStrictlyEqual**: [`IsEqualOp`](exports.md#isequalop) + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126) *** @@ -985,19 +1129,19 @@ packages/quickjs-ffi-types/dist/index.d.ts:117 ##### Fulfilled -> **`readonly`** **Fulfilled**: `1` +> **`readonly`** **Fulfilled**: `1` = `1` ##### Pending -> **`readonly`** **Pending**: `0` +> **`readonly`** **Pending**: `0` = `0` ##### Rejected -> **`readonly`** **Rejected**: `2` +> **`readonly`** **Rejected**: `2` = `2` #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +[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) ## Functions @@ -1030,7 +1174,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:140 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:85 +[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) + +*** + +### createDisposableArray() + +> **createDisposableArray**\<`T`\>(`items`?): [`DisposableArray`](exports.md#disposablearrayt)\<`T`\> + +Create an array that also implements [Disposable](interfaces/Disposable.md). + +#### Type parameters + +• **T** extends [`Disposable`](interfaces/Disposable.md) + +#### Parameters + +• **items?**: `Iterable`\<`T`\> + +#### Returns + +[`DisposableArray`](exports.md#disposablearrayt)\<`T`\> + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:334](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L334) *** @@ -1216,6 +1384,29 @@ This may be necessary in Cloudflare Workers, which can't compile WebAssembly mod *** +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable (or disable) debug logging and object creation tracking globally. +This setting is inherited by newly created QuickJSRuntime instances. +To get debug logging in the WebAssembly module, you need to use a debug build variant. +See [the quickjs-emscripten-core README](https://github.com/justjake/quickjs-emscripten/tree/main/doc/quickjs-emscripten-core) for more about build variants. + +#### Parameters + +• **enabled**: `boolean`= `true` + +#### Returns + +`void` + +#### Source + +[packages/quickjs-emscripten-core/src/debug.ts:13](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/debug.ts#L13) + +*** + ### shouldInterruptAfterDeadline() > **shouldInterruptAfterDeadline**(`deadline`): [`InterruptHandler`](exports.md#interrupthandler) diff --git a/doc/quickjs-emscripten-core/interfaces/AsyncRuntimeOptions.md b/doc/quickjs-emscripten-core/interfaces/AsyncRuntimeOptions.md index 16527266..252d061a 100644 --- a/doc/quickjs-emscripten-core/interfaces/AsyncRuntimeOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/AsyncRuntimeOptions.md @@ -35,7 +35,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -49,7 +49,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -63,7 +63,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -77,7 +77,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -87,7 +87,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L136) +[packages/quickjs-emscripten-core/src/types.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L137) *** @@ -101,7 +101,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -115,7 +115,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -129,7 +129,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten-core/interfaces/ContextEvalOptions.md b/doc/quickjs-emscripten-core/interfaces/ContextEvalOptions.md index bd85cec7..1781940d 100644 --- a/doc/quickjs-emscripten-core/interfaces/ContextEvalOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/ContextEvalOptions.md @@ -25,7 +25,7 @@ don't include the stack frames before this eval in the Error() backtraces #### Source -[packages/quickjs-emscripten-core/src/types.ts:262](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L262) +[packages/quickjs-emscripten-core/src/types.ts:263](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L263) *** @@ -39,7 +39,7 @@ with JS_EvalFunction(). #### Source -[packages/quickjs-emscripten-core/src/types.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L260) +[packages/quickjs-emscripten-core/src/types.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L261) *** @@ -51,7 +51,7 @@ Force "strict" mode #### Source -[packages/quickjs-emscripten-core/src/types.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L252) +[packages/quickjs-emscripten-core/src/types.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L253) *** @@ -63,7 +63,7 @@ Force "strip" mode #### Source -[packages/quickjs-emscripten-core/src/types.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L254) +[packages/quickjs-emscripten-core/src/types.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L255) *** @@ -78,7 +78,7 @@ Global code (default), or "module" code? #### Source -[packages/quickjs-emscripten-core/src/types.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L250) +[packages/quickjs-emscripten-core/src/types.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L251) *** diff --git a/doc/quickjs-emscripten-core/interfaces/ContextOptions.md b/doc/quickjs-emscripten-core/interfaces/ContextOptions.md index 5ad0f015..0c3cf454 100644 --- a/doc/quickjs-emscripten-core/interfaces/ContextOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/ContextOptions.md @@ -37,7 +37,7 @@ const contextWithoutDateOrEval = runtime.newContext({ #### Source -[packages/quickjs-emscripten-core/src/types.ts:228](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L228) +[packages/quickjs-emscripten-core/src/types.ts:229](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L229) *** diff --git a/doc/quickjs-emscripten-core/interfaces/Disposable.md b/doc/quickjs-emscripten-core/interfaces/Disposable.md index a8af1660..0c13b986 100644 --- a/doc/quickjs-emscripten-core/interfaces/Disposable.md +++ b/doc/quickjs-emscripten-core/interfaces/Disposable.md @@ -26,7 +26,7 @@ Use [Scope](../classes/Scope.md) to manage cleaning up multiple disposables. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:22](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L22) +[packages/quickjs-emscripten-core/src/lifetime.ts:23](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L23) ## Methods @@ -42,7 +42,7 @@ A method that is used to release resources held by an object. Called by the sema #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:27](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L27) +[packages/quickjs-emscripten-core/src/lifetime.ts:28](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L28) *** @@ -58,7 +58,7 @@ Dispose of the underlying resources used by this object. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:16](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L16) +[packages/quickjs-emscripten-core/src/lifetime.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L17) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModule.md index 59fc33c5..b9200602 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/dist/index.d.ts:261 +[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) *** @@ -59,7 +59,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +[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) *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +[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) *** @@ -79,7 +79,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +[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) *** @@ -89,7 +89,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +[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) *** @@ -99,7 +99,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +[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) *** @@ -109,7 +109,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +[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) *** @@ -119,7 +119,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +[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) *** @@ -129,7 +129,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +[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) *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +[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) *** @@ -149,7 +149,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +[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) *** @@ -165,7 +165,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +[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) *** @@ -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:220 +[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) ## Methods @@ -204,7 +204,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +[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) *** @@ -222,7 +222,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +[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) *** @@ -240,7 +240,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +[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) *** @@ -273,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +[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) *** @@ -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:222 +[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) *** @@ -317,7 +317,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +[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) *** @@ -361,7 +361,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +[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) *** @@ -385,7 +385,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +[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) *** @@ -410,7 +410,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoader.md index 7bc58c2d..e31d5f43 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/dist/index.d.ts:306 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md b/doc/quickjs-emscripten-core/interfaces/EmscriptenModuleLoaderOptions.md index f4c4251e..c8e525b5 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/dist/index.d.ts:218 +[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) *** @@ -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:220 +[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) ## 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:222 +[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) *** @@ -109,7 +109,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +[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) *** @@ -129,7 +129,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/JSModuleLoader.md b/doc/quickjs-emscripten-core/interfaces/JSModuleLoader.md index e27f43e3..1faf3a53 100644 --- a/doc/quickjs-emscripten-core/interfaces/JSModuleLoader.md +++ b/doc/quickjs-emscripten-core/interfaces/JSModuleLoader.md @@ -22,7 +22,7 @@ Load module (sync) ## Source -[packages/quickjs-emscripten-core/src/types.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L82) +[packages/quickjs-emscripten-core/src/types.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L83) *** diff --git a/doc/quickjs-emscripten-core/interfaces/JSModuleLoaderAsync.md b/doc/quickjs-emscripten-core/interfaces/JSModuleLoaderAsync.md index a0972daa..01a7be19 100644 --- a/doc/quickjs-emscripten-core/interfaces/JSModuleLoaderAsync.md +++ b/doc/quickjs-emscripten-core/interfaces/JSModuleLoaderAsync.md @@ -22,7 +22,7 @@ Load module (async) ## Source -[packages/quickjs-emscripten-core/src/types.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L75) +[packages/quickjs-emscripten-core/src/types.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L76) *** diff --git a/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizer.md b/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizer.md index 0d292926..a7f0bae8 100644 --- a/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizer.md +++ b/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizer.md @@ -26,7 +26,7 @@ ## Source -[packages/quickjs-emscripten-core/src/types.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L99) +[packages/quickjs-emscripten-core/src/types.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L100) > **JSModuleNormalizer**(`baseModuleName`, `requestedName`, `vm`): [`JSModuleNormalizeResult`](../exports.md#jsmodulenormalizeresult) \| `Promise`\<[`JSModuleNormalizeResult`](../exports.md#jsmodulenormalizeresult)\> @@ -44,7 +44,7 @@ ## Source -[packages/quickjs-emscripten-core/src/types.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L92) +[packages/quickjs-emscripten-core/src/types.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L93) *** diff --git a/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizerAsync.md b/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizerAsync.md index 477ba6db..87171ee9 100644 --- a/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizerAsync.md +++ b/doc/quickjs-emscripten-core/interfaces/JSModuleNormalizerAsync.md @@ -26,7 +26,7 @@ ## Source -[packages/quickjs-emscripten-core/src/types.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L92) +[packages/quickjs-emscripten-core/src/types.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L93) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncEmscriptenModule.md index 99997810..5d3924f3 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/dist/index.d.ts:261 +[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) *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +[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) *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +[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) *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +[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) *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +[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) *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +[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) *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +[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) *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +[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) *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +[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) *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +[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) *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +[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) *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:259 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:302 +[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) *** @@ -219,7 +219,7 @@ Implement this field #### Source -packages/quickjs-ffi-types/dist/index.d.ts:301 +[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) *** @@ -235,7 +235,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +[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) *** @@ -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:220 +[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) ## Methods @@ -278,7 +278,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +[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) *** @@ -300,7 +300,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +[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) *** @@ -322,7 +322,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +[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) *** @@ -359,7 +359,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +[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) *** @@ -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:222 +[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) *** @@ -407,7 +407,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +[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) *** @@ -451,7 +451,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +[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) *** @@ -475,7 +475,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +[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) *** @@ -504,7 +504,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md index 0e292d1c..cbcad748 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md @@ -37,18 +37,25 @@ library. - [QTS\_FreeVoidPointer](QuickJSAsyncFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSAsyncFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSAsyncFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSAsyncFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSAsyncFFI.md#qts-getownpropertynames) + - [QTS\_GetOwnPropertyNames\_MaybeAsync](QuickJSAsyncFFI.md#qts-getownpropertynames-maybeasync) - [QTS\_GetProp](QuickJSAsyncFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSAsyncFFI.md#qts-getpropnumber) + - [QTS\_GetPropNumber\_MaybeAsync](QuickJSAsyncFFI.md#qts-getpropnumber-maybeasync) - [QTS\_GetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-getprop-maybeasync) - [QTS\_GetString](QuickJSAsyncFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetSymbolDescriptionOrKey\_MaybeAsync](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey-maybeasync) - [QTS\_GetTrue](QuickJSAsyncFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSAsyncFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSAsyncFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSAsyncFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSAsyncFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSAsyncFFI.md#qts-newarray) @@ -75,6 +82,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSAsyncFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSAsyncFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSAsyncFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSAsyncFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSAsyncFFI.md#qts-setprop) - [QTS\_SetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-setprop-maybeasync) - [QTS\_TestStringArg](QuickJSAsyncFFI.md#qts-teststringarg) @@ -97,7 +105,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +[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) *** @@ -107,7 +115,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:390 #### Parameters -• **argv**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **argv**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **index**: `number` @@ -117,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:390 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:451 +[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) *** @@ -131,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:451 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:449 +[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) *** @@ -145,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:449 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:448 +[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) *** @@ -159,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:448 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:397 +[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) *** @@ -171,9 +179,9 @@ packages/quickjs-ffi-types/dist/index.d.ts:397 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **func\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **this\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **argc**: `number` @@ -185,7 +193,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:397 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:434 +[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) *** @@ -197,9 +205,9 @@ packages/quickjs-ffi-types/dist/index.d.ts:434 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **func\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **this\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **argc**: `number` @@ -211,7 +219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:434 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:435 +[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) *** @@ -223,15 +231,15 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **get**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **get**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **set**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **set**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **configurable**: `boolean` @@ -245,7 +253,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:433 +[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) *** @@ -257,7 +265,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -265,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:437 +[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) *** @@ -277,7 +285,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -285,7 +293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:438 +[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) *** @@ -297,7 +305,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -305,7 +313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:411 +[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) *** @@ -333,7 +341,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:411 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:439 +[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) *** @@ -361,7 +369,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:439 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:440 +[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) *** @@ -383,7 +391,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:440 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:427 +[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) *** @@ -405,7 +413,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:427 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:428 +[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) *** @@ -425,7 +433,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:428 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:410 +[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) *** @@ -443,7 +451,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:410 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:406 +[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) *** @@ -461,7 +469,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:406 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:404 +[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) *** @@ -481,7 +489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:404 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:407 +[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) *** @@ -501,7 +509,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:407 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:408 +[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) *** @@ -521,7 +529,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:408 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:409 +[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) *** @@ -533,7 +541,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:409 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -541,7 +549,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:409 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:420 +[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) *** @@ -553,7 +561,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:420 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -561,7 +569,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:420 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:421 +[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) + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### 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) *** @@ -575,7 +601,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:421 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:401 +[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) *** @@ -587,7 +613,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:401 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -595,7 +621,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:401 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:417 +[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) *** @@ -613,7 +639,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:417 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:443 +[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) + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`number` + +#### 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) *** @@ -625,7 +673,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **module\_func\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **module\_func\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -633,7 +681,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:441 +[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) *** @@ -647,7 +695,59 @@ packages/quickjs-ffi-types/dist/index.d.ts:441 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:400 +[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) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) + +*** + +### QTS\_GetOwnPropertyNames\_MaybeAsync + +> **QTS\_GetOwnPropertyNames\_MaybeAsync**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### 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) *** @@ -659,9 +759,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:400 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: `number` #### Returns @@ -669,7 +791,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:400 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:429 +[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) + +*** + +### QTS\_GetPropNumber\_MaybeAsync + +> **QTS\_GetPropNumber\_MaybeAsync**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### 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) *** @@ -681,9 +825,9 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -691,7 +835,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:430 +[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) *** @@ -703,7 +847,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -711,7 +855,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:419 +[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) *** @@ -723,7 +867,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:419 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -731,7 +875,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:419 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:423 +[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) *** @@ -743,7 +887,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:423 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -751,7 +895,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:423 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:424 +[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) *** @@ -765,7 +909,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:424 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:402 +[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) *** @@ -779,7 +923,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:402 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:399 +[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) + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **b**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### 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) *** @@ -791,7 +959,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:399 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -799,7 +967,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:399 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:425 +[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) *** @@ -817,7 +985,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:425 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:426 +[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) *** @@ -835,7 +1003,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:414 +[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) *** @@ -857,7 +1025,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:414 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:415 +[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) *** @@ -877,7 +1045,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:415 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:405 +[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) *** @@ -895,7 +1063,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:405 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:392 +[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) *** @@ -915,7 +1083,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:392 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:416 +[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) *** @@ -937,7 +1105,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:416 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:450 +[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) *** @@ -955,7 +1123,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:450 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:412 +[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) *** @@ -967,7 +1135,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:412 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **proto**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **proto**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -975,7 +1143,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:412 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:413 +[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) *** @@ -995,7 +1163,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:413 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:444 +[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) *** @@ -1009,7 +1177,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:444 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:403 +[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) *** @@ -1029,7 +1197,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:403 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:418 +[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) *** @@ -1051,7 +1219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:418 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:422 +[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) *** @@ -1063,7 +1231,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:422 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **promise**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **promise**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1071,7 +1239,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:422 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:446 +[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) *** @@ -1083,7 +1251,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **promise**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **promise**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1091,7 +1259,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:445 +[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) *** @@ -1105,7 +1273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:445 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:396 +[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) *** @@ -1125,7 +1293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:396 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:436 +[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) *** @@ -1145,7 +1313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:436 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:394 +[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) *** @@ -1163,7 +1331,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:394 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:453 +[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) *** @@ -1181,7 +1349,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:453 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:455 +[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) *** @@ -1199,7 +1367,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:455 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:395 +[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) *** @@ -1217,7 +1385,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:395 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:452 +[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) *** @@ -1237,7 +1405,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:452 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:454 +[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) *** @@ -1257,7 +1425,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:454 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:398 +[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) *** @@ -1277,7 +1445,27 @@ packages/quickjs-ffi-types/dist/index.d.ts:398 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:393 +[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) + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### 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) *** @@ -1289,11 +1477,11 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1301,7 +1489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:431 +[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) *** @@ -1313,11 +1501,11 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1325,7 +1513,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:432 +[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) *** @@ -1343,7 +1531,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:432 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:447 +[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) *** @@ -1355,7 +1543,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **error**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **error**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1363,7 +1551,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:391 +[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) *** @@ -1375,7 +1563,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:391 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1383,7 +1571,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:391 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:442 +[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) *** @@ -1395,7 +1583,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1403,7 +1591,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:457 +[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) *** @@ -1415,7 +1603,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1423,7 +1611,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:456 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncVariant.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncVariant.md index 1040ee10..c52c3889 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncVariant.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncVariant.md @@ -36,7 +36,7 @@ build variant to newQuickJSWASMModule or newQuickJSAsyncWASMModule. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:492 +[packages/quickjs-ffi-types/src/variant-types.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L45) *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:492 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:493 +[packages/quickjs-ffi-types/src/variant-types.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L46) *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:493 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:491 +[packages/quickjs-ffi-types/src/variant-types.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L44) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten-core/interfaces/QuickJSEmscriptenModule.md index 574ecf01..f3621bfe 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/dist/index.d.ts:261 +[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) *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +[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) *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +[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) *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +[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) *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +[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) *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +[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) *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +[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) *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +[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) *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +[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) *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +[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) *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +[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) *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:259 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:297 +[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) *** @@ -215,7 +215,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:297 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:296 +[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) *** @@ -231,7 +231,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +[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) *** @@ -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:220 +[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) ## Methods @@ -274,7 +274,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +[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) *** @@ -296,7 +296,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +[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) *** @@ -318,7 +318,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +[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) *** @@ -355,7 +355,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +[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) *** @@ -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:222 +[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) *** @@ -403,7 +403,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +[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) *** @@ -447,7 +447,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +[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) *** @@ -471,7 +471,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +[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) *** @@ -500,7 +500,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +[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) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md index d2f7fbad..4251716a 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md @@ -33,16 +33,21 @@ library. - [QTS\_FreeVoidPointer](QuickJSFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSFFI.md#qts-getownpropertynames) - [QTS\_GetProp](QuickJSFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSFFI.md#qts-getpropnumber) - [QTS\_GetString](QuickJSFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetTrue](QuickJSFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSFFI.md#qts-newarray) @@ -69,6 +74,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSFFI.md#qts-setprop) - [QTS\_TestStringArg](QuickJSFFI.md#qts-teststringarg) - [QTS\_Throw](QuickJSFFI.md#qts-throw) @@ -90,7 +96,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:318 +[packages/quickjs-ffi-types/src/ffi.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) *** @@ -100,7 +106,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:318 #### Parameters -• **argv**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **argv**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **index**: `number` @@ -110,7 +116,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:318 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:372 +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -124,7 +130,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:372 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:370 +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -138,7 +144,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:370 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:369 +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -152,7 +158,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:369 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:325 +[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -164,9 +170,9 @@ packages/quickjs-ffi-types/dist/index.d.ts:325 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **func\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **func\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **this\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **argc**: `number` @@ -178,7 +184,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:325 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:358 +[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) *** @@ -190,15 +196,15 @@ packages/quickjs-ffi-types/dist/index.d.ts:358 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **get**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **get**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **set**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **set**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) • **configurable**: `boolean` @@ -212,7 +218,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:358 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:357 +[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) *** @@ -224,7 +230,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:357 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -232,7 +238,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:357 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:360 +[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) *** @@ -244,7 +250,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:360 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -252,7 +258,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:360 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:339 +[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -280,7 +286,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:339 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:361 +[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) *** @@ -302,7 +308,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:361 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:354 +[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) *** @@ -322,7 +328,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:354 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:338 +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -340,7 +346,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:338 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:334 +[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -358,7 +364,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:334 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:332 +[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -378,7 +384,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:332 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:335 +[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -398,7 +404,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:335 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:336 +[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -418,7 +424,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:336 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:337 +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -430,7 +436,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:337 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -438,7 +444,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:337 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:348 +[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) *** @@ -450,7 +456,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:348 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -458,7 +464,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:348 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:349 +[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### 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) *** @@ -472,7 +496,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:349 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:329 +[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -484,7 +508,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:329 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -492,7 +516,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:329 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:345 +[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -510,7 +534,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:345 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:364 +[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +#### Returns + +`number` + +#### 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) *** @@ -522,7 +568,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:364 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **module\_func\_obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **module\_func\_obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -530,7 +576,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:364 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:362 +[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) *** @@ -544,7 +590,33 @@ packages/quickjs-ffi-types/dist/index.d.ts:362 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:328 +[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) *** @@ -556,9 +628,9 @@ packages/quickjs-ffi-types/dist/index.d.ts:328 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -566,7 +638,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:328 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:355 +[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### 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) *** @@ -578,7 +672,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:355 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -586,7 +680,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:355 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:347 +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** @@ -598,7 +692,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:347 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -606,7 +700,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:347 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:351 +[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) *** @@ -620,7 +714,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:351 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:330 +[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -634,7 +728,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:330 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:327 +[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **b**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### 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) *** @@ -646,7 +764,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:327 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -654,7 +772,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:327 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:352 +[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -672,7 +790,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:352 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:353 +[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -690,7 +808,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:353 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:342 +[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -712,7 +830,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:342 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:343 +[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) *** @@ -732,7 +850,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:343 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:333 +[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -750,7 +868,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:333 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:320 +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -770,7 +888,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:320 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:344 +[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -792,7 +910,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:344 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:371 +[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -810,7 +928,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:371 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:340 +[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -822,7 +940,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:340 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **proto**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **proto**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -830,7 +948,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:340 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:341 +[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) *** @@ -850,7 +968,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:341 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:365 +[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) *** @@ -864,7 +982,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:365 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:331 +[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -884,7 +1002,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:331 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:346 +[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -906,7 +1024,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:346 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:350 +[packages/quickjs-ffi-types/src/ffi.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) *** @@ -918,7 +1036,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **promise**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **promise**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -926,7 +1044,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:367 +[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) *** @@ -938,7 +1056,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:367 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **promise**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **promise**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -946,7 +1064,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:367 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:366 +[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) *** @@ -960,7 +1078,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:366 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:324 +[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -980,7 +1098,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:324 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:359 +[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -1000,7 +1118,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:359 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:322 +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1018,7 +1136,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:322 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:374 +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1036,7 +1154,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:374 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:376 +[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) *** @@ -1054,7 +1172,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:376 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:323 +[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1072,7 +1190,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:323 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:373 +[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1092,7 +1210,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:373 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:375 +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** @@ -1112,7 +1230,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:375 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:326 +[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -1132,7 +1250,27 @@ packages/quickjs-ffi-types/dist/index.d.ts:326 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:321 +[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### 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) *** @@ -1144,11 +1282,11 @@ packages/quickjs-ffi-types/dist/index.d.ts:321 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **this\_val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_name**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) -• **prop\_value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1156,7 +1294,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:321 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:356 +[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) *** @@ -1174,7 +1312,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:356 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:368 +[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -1186,7 +1324,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:368 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **error**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **error**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1194,7 +1332,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:368 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:319 +[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -1206,7 +1344,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:319 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **value**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1214,7 +1352,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:319 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:363 +[packages/quickjs-ffi-types/src/ffi.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) *** @@ -1226,7 +1364,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:363 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **data**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **data**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1234,7 +1372,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:363 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:378 +[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) *** @@ -1246,7 +1384,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:378 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **val**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -1254,7 +1392,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:378 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:377 +[packages/quickjs-ffi-types/src/ffi.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L206) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSSyncVariant.md b/doc/quickjs-emscripten-core/interfaces/QuickJSSyncVariant.md index b050df93..d751c9f8 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSSyncVariant.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSSyncVariant.md @@ -36,7 +36,7 @@ build variant to newQuickJSWASMModule or newQuickJSAsyncWASMModule. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:478 +[packages/quickjs-ffi-types/src/variant-types.ts:30](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L30) *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:478 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:479 +[packages/quickjs-ffi-types/src/variant-types.ts:31](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L31) *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:479 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:477 +[packages/quickjs-ffi-types/src/variant-types.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/variant-types.ts#L29) *** diff --git a/doc/quickjs-emscripten-core/interfaces/RuntimeOptions.md b/doc/quickjs-emscripten-core/interfaces/RuntimeOptions.md index e8e84c0c..28800342 100644 --- a/doc/quickjs-emscripten-core/interfaces/RuntimeOptions.md +++ b/doc/quickjs-emscripten-core/interfaces/RuntimeOptions.md @@ -35,7 +35,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -49,7 +49,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -63,7 +63,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -77,7 +77,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -87,7 +87,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L132) +[packages/quickjs-emscripten-core/src/types.ts:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L133) *** @@ -101,7 +101,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -115,7 +115,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -129,7 +129,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten-core/interfaces/RuntimeOptionsBase.md b/doc/quickjs-emscripten-core/interfaces/RuntimeOptionsBase.md index 24f45834..bc775a17 100644 --- a/doc/quickjs-emscripten-core/interfaces/RuntimeOptionsBase.md +++ b/doc/quickjs-emscripten-core/interfaces/RuntimeOptionsBase.md @@ -31,7 +31,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -41,7 +41,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -51,7 +51,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -61,7 +61,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -71,7 +71,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -81,7 +81,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -91,7 +91,7 @@ #### Source -[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten-core/interfaces/SourceMapData.md b/doc/quickjs-emscripten-core/interfaces/SourceMapData.md index 5b317993..31350f94 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/dist/index.d.ts:177 +[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) *** @@ -32,7 +32,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:177 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:176 +[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) *** @@ -42,7 +42,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:176 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:175 +[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) *** @@ -52,7 +52,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:175 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:174 +[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) *** diff --git a/doc/quickjs-emscripten-core/namespaces/errors/README.md b/doc/quickjs-emscripten-core/namespaces/errors/README.md index fed5caa8..46c855dd 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/README.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/README.md @@ -14,6 +14,7 @@ Collects the informative errors this library may throw. - [QuickJSAsyncifyError](classes/QuickJSAsyncifyError.md) - [QuickJSAsyncifySuspended](classes/QuickJSAsyncifySuspended.md) +- [QuickJSEmptyGetOwnPropertyNames](classes/QuickJSEmptyGetOwnPropertyNames.md) - [QuickJSEmscriptenModuleError](classes/QuickJSEmscriptenModuleError.md) - [QuickJSMemoryLeakDetected](classes/QuickJSMemoryLeakDetected.md) - [QuickJSNotImplemented](classes/QuickJSNotImplemented.md) diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md new file mode 100644 index 00000000..3a6e4a62 --- /dev/null +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.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) / QuickJSEmptyGetOwnPropertyNames + +# Class: QuickJSEmptyGetOwnPropertyNames + +## Contents + +- [Extends](QuickJSEmptyGetOwnPropertyNames.md#extends) +- [Constructors](QuickJSEmptyGetOwnPropertyNames.md#constructors) + - [new QuickJSEmptyGetOwnPropertyNames(message)](QuickJSEmptyGetOwnPropertyNames.md#new-quickjsemptygetownpropertynamesmessage) +- [Properties](QuickJSEmptyGetOwnPropertyNames.md#properties) + - [name](QuickJSEmptyGetOwnPropertyNames.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSEmptyGetOwnPropertyNames(message) + +> **new QuickJSEmptyGetOwnPropertyNames**(`message`?): [`QuickJSEmptyGetOwnPropertyNames`](QuickJSEmptyGetOwnPropertyNames.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSEmptyGetOwnPropertyNames`](QuickJSEmptyGetOwnPropertyNames.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSEmptyGetOwnPropertyNames"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/doc/quickjs-emscripten/README.md b/doc/quickjs-emscripten/README.md index 3c48582e..025b8e45 100644 --- a/doc/quickjs-emscripten/README.md +++ b/doc/quickjs-emscripten/README.md @@ -585,8 +585,9 @@ build variant of quickjs-emscripten, and also the [DEBUG_SYNC] build variant. The debug sync build variant has extra instrumentation code for detecting memory leaks. -The class [TestQuickJSWASMModule] exposes the memory leak detection API, although -this API is only accurate when using `DEBUG_SYNC` variant. +The class [TestQuickJSWASMModule] exposes the memory leak detection API, +although this API is only accurate when using `DEBUG_SYNC` variant. You can also +enable [debug logging](#debugging) to help diagnose failures. ```typescript // Define your test suite in a function, so that you can test against @@ -768,40 +769,51 @@ You can use quickjs-emscripten directly from an HTML file in two ways: ### Debugging -- Switch to a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library: +Debug logging can be enabled globally, or for specific runtimes. You need to use a DEBUG build variant of the WebAssembly module to see debug log messages from the C part of this library. - ```typescript - import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" +```typescript +import { newQuickJSWASMModule, DEBUG_SYNC } from "quickjs-emscripten" + +const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) +``` + +With quickjs-emscripten-core: - const QuickJS = await newQuickJSWASMModule(DEBUG_SYNC) - ``` +```typescript +import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" +import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" + +const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) +``` - With quickjs-emscripten-core: +To enable debug logging globally, call [setDebugMode][setDebugMode]. This affects global Javascript parts of the library, like the module loader and asyncify internals, and is inherited by runtimes created after the call. - ```typescript - import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" - import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" +```typescript +import { setDebugMode } from "quickjs-emscripten" - const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) - ``` +setDebugMode(true) +``` -- Enable debug log messages from the Javascript part of this library with [setDebugMode][setDebugMode]: +With quickjs-emscripten-core: - ```typescript - import { setDebugMode } from "quickjs-emscripten" +```typescript +import { setDebugMode } from "quickjs-emscripten-core" - setDebugMode(true) - ``` +setDebugMode(true) +``` - With quickjs-emscripten-core: +To enable debug logging for a specific runtime, call [setDebugModeRt][setDebugModeRt]. This affects only the runtime and its associated contexts. - ```typescript - import { setDebugMode } from "quickjs-emscripten-core" +```typescript +const runtime = QuickJS.newRuntime() +runtime.setDebugMode(true) - setDebugMode(true) - ``` +const context = QuickJS.newContext() +context.runtime.setDebugMode(true) +``` [setDebugMode]: doc/quickjs-emscripten/exports.md#setdebugmode +[setDebugModeRt]: https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md#setdebugmode ### Supported Platforms diff --git a/doc/quickjs-emscripten/classes/DisposableFail.md b/doc/quickjs-emscripten/classes/DisposableFail.md new file mode 100644 index 00000000..e10ede00 --- /dev/null +++ b/doc/quickjs-emscripten/classes/DisposableFail.md @@ -0,0 +1,246 @@ +[quickjs-emscripten](../../packages.md) • **quickjs-emscripten** • [Readme](../README.md) \| [Exports](../exports.md) + +*** + +[quickjs-emscripten](../../packages.md) / [quickjs-emscripten](../exports.md) / DisposableFail + +# Class: DisposableFail\ + +## Contents + +- [Extends](DisposableFail.md#extends) +- [Type parameters](DisposableFail.md#type-parameters) +- [Constructors](DisposableFail.md#constructors) + - [new DisposableFail(error, onUnwrap)](DisposableFail.md#new-disposablefailerror-onunwrap) +- [Properties](DisposableFail.md#properties) + - [error](DisposableFail.md#error) +- [Accessors](DisposableFail.md#accessors) + - [alive](DisposableFail.md#alive) +- [Methods](DisposableFail.md#methods) + - [`[dispose]`()](DisposableFail.md#dispose) + - [dispose()](DisposableFail.md#dispose) + - [unwrap()](DisposableFail.md#unwrap) + - [unwrapOr()](DisposableFail.md#unwrapor) + - [fail()](DisposableFail.md#fail) + - [is()](DisposableFail.md#is) + - [success()](DisposableFail.md#success) + +## Extends + +- `AbstractDisposableResult` + +## Type parameters + +• **F** + +## Constructors + +### new DisposableFail(error, onUnwrap) + +> **new DisposableFail**\<`F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L426) + +## Properties + +### error + +> **`readonly`** **error**: `F` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:427](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L427) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:433](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L433) + +## Methods + +### `[dispose]`() + +> **[dispose]**(): `void` + +Just calls the standard .dispose() method of this class. + +#### Returns + +`void` + +#### Inherited from + +`AbstractDisposableResult.[dispose]` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L437) + +*** + +### unwrap() + +> **unwrap**(): `never` + +#### Returns + +`never` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:443](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L443) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`fallback`): `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **fallback**: `T` + +#### Returns + +`T` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:448](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L448) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Inherited from + +`AbstractDisposableResult.fail` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) + +*** + +### is() + +> **`static`** **is**\<`S`, `F`\>(`result`): `result is DisposableResult` + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **result**: [`SuccessOrFail`](../exports.md#successorfails-f)\<`S`, `F`\> + +#### Returns + +`result is DisposableResult` + +#### Inherited from + +`AbstractDisposableResult.is` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) + +*** + +### success() + +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +`AbstractDisposableResult.success` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) + +*** + +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/DisposableSuccess.md b/doc/quickjs-emscripten/classes/DisposableSuccess.md new file mode 100644 index 00000000..fad44ca8 --- /dev/null +++ b/doc/quickjs-emscripten/classes/DisposableSuccess.md @@ -0,0 +1,255 @@ +[quickjs-emscripten](../../packages.md) • **quickjs-emscripten** • [Readme](../README.md) \| [Exports](../exports.md) + +*** + +[quickjs-emscripten](../../packages.md) / [quickjs-emscripten](../exports.md) / DisposableSuccess + +# Class: DisposableSuccess\ + +## Contents + +- [Extends](DisposableSuccess.md#extends) +- [Type parameters](DisposableSuccess.md#type-parameters) +- [Constructors](DisposableSuccess.md#constructors) + - [new DisposableSuccess(value)](DisposableSuccess.md#new-disposablesuccessvalue) +- [Properties](DisposableSuccess.md#properties) + - [error?](DisposableSuccess.md#error) + - [value](DisposableSuccess.md#value) +- [Accessors](DisposableSuccess.md#accessors) + - [alive](DisposableSuccess.md#alive) +- [Methods](DisposableSuccess.md#methods) + - [`[dispose]`()](DisposableSuccess.md#dispose) + - [dispose()](DisposableSuccess.md#dispose) + - [unwrap()](DisposableSuccess.md#unwrap) + - [unwrapOr()](DisposableSuccess.md#unwrapor) + - [fail()](DisposableSuccess.md#fail) + - [is()](DisposableSuccess.md#is) + - [success()](DisposableSuccess.md#success) + +## Extends + +- `AbstractDisposableResult` + +## Type parameters + +• **S** + +## Constructors + +### new DisposableSuccess(value) + +> **new DisposableSuccess**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) + +## Properties + +### error? + +> **error**?: `undefined` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) + +*** + +### value + +> **`readonly`** **value**: `S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:402](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L402) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L406) + +## Methods + +### `[dispose]`() + +> **[dispose]**(): `void` + +Just calls the standard .dispose() method of this class. + +#### Returns + +`void` + +#### Inherited from + +`AbstractDisposableResult.[dispose]` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`_fallback`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **\_fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:420](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L420) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`F`\> + +#### Inherited from + +`AbstractDisposableResult.fail` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L384) + +*** + +### is() + +> **`static`** **is**\<`S`, `F`\>(`result`): `result is DisposableResult` + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **result**: [`SuccessOrFail`](../exports.md#successorfails-f)\<`S`, `F`\> + +#### Returns + +`result is DisposableResult` + +#### Inherited from + +`AbstractDisposableResult.is` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:391](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L391) + +*** + +### success() + +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +`AbstractDisposableResult.success` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:380](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L380) + +*** + +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 44559507..3fbcd4b1 100644 --- a/doc/quickjs-emscripten/classes/Lifetime.md +++ b/doc/quickjs-emscripten/classes/Lifetime.md @@ -85,17 +85,17 @@ the creator. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:592 +[packages/quickjs-emscripten-core/src/lifetime.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L83) ## Properties ### \_alive -> **`protected`** **\_alive**: `boolean` +> **`protected`** **\_alive**: `boolean` = `true` #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:582 +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -105,7 +105,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:582 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:583 +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -115,7 +115,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:583 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:581 +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -125,7 +125,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:581 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:578 +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -143,7 +143,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:578 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:579 +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -161,7 +161,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:579 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:580 +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -179,7 +179,7 @@ false after the object has been [dispose](Lifetime.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:593 +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -193,7 +193,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:593 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:602 +[packages/quickjs-emscripten-core/src/lifetime.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L111) *** @@ -207,7 +207,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:602 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:601 +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -228,7 +228,7 @@ If the lifetime has been [dispose](Lifetime.md#dispose-1)d already. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:600 +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -252,7 +252,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -280,7 +280,7 @@ the result of `map(this)`. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:611 +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -300,7 +300,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:611 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:612 +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -324,7 +324,7 @@ Dispose of [value](Lifetime.md#value-1) and perform cleanup. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:616 +[packages/quickjs-emscripten-core/src/lifetime.ts:149](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L149) *** @@ -340,7 +340,7 @@ Create a new handle pointing to the same [value](Lifetime.md#value-1). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:606 +[packages/quickjs-emscripten-core/src/lifetime.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L118) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index 71088c78..4ef767d3 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -29,20 +29,27 @@ host functions as though they were synchronous. - [Methods](QuickJSAsyncContext.md#methods) - [`[dispose]`()](QuickJSAsyncContext.md#dispose) - [callFunction()](QuickJSAsyncContext.md#callfunction) + - [callMethod()](QuickJSAsyncContext.md#callmethod) - [decodeBinaryJSON()](QuickJSAsyncContext.md#decodebinaryjson) - [defineProp()](QuickJSAsyncContext.md#defineprop) - [dispose()](QuickJSAsyncContext.md#dispose) - [dump()](QuickJSAsyncContext.md#dump) - [encodeBinaryJSON()](QuickJSAsyncContext.md#encodebinaryjson) + - [eq()](QuickJSAsyncContext.md#eq) - [evalCode()](QuickJSAsyncContext.md#evalcode) - [evalCodeAsync()](QuickJSAsyncContext.md#evalcodeasync) + - [fail()](QuickJSAsyncContext.md#fail) - [getArrayBuffer()](QuickJSAsyncContext.md#getarraybuffer) - [getBigInt()](QuickJSAsyncContext.md#getbigint) + - [getIterator()](QuickJSAsyncContext.md#getiterator) + - [getLength()](QuickJSAsyncContext.md#getlength) - [getNumber()](QuickJSAsyncContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSAsyncContext.md#getownpropertynames) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) - [getString()](QuickJSAsyncContext.md#getstring) - [getSymbol()](QuickJSAsyncContext.md#getsymbol) + - [getWellKnownSymbol()](QuickJSAsyncContext.md#getwellknownsymbol) - [newArray()](QuickJSAsyncContext.md#newarray) - [newArrayBuffer()](QuickJSAsyncContext.md#newarraybuffer) - [newAsyncifiedFunction()](QuickJSAsyncContext.md#newasyncifiedfunction) @@ -56,7 +63,10 @@ host functions as though they were synchronous. - [newSymbolFor()](QuickJSAsyncContext.md#newsymbolfor) - [newUniqueSymbol()](QuickJSAsyncContext.md#newuniquesymbol) - [resolvePromise()](QuickJSAsyncContext.md#resolvepromise) + - [sameValue()](QuickJSAsyncContext.md#samevalue) + - [sameValueZero()](QuickJSAsyncContext.md#samevaluezero) - [setProp()](QuickJSAsyncContext.md#setprop) + - [success()](QuickJSAsyncContext.md#success) - [throw()](QuickJSAsyncContext.md#throw) - [typeof()](QuickJSAsyncContext.md#typeof) - [unwrapResult()](QuickJSAsyncContext.md#unwrapresult) @@ -102,7 +112,7 @@ to create a new QuickJSContext. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:874 +[packages/quickjs-emscripten-core/src/context.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -118,7 +128,7 @@ The runtime that created this context. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:322 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:31](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L31) ## Accessors @@ -136,7 +146,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:883 +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -152,7 +162,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:883 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:906 +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -170,7 +180,7 @@ You can set properties to create global variables. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:912 +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -186,7 +196,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:912 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:898 +[packages/quickjs-emscripten-core/src/context.ts:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -202,7 +212,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:898 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:902 +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -218,7 +228,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:902 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:894 +[packages/quickjs-emscripten-core/src/context.ts:275](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L275) ## Methods @@ -238,15 +248,18 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) -[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). +> **callFunction**(`func`, `thisVal`, `args`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) or +[`func.apply(thisVal, args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). Call a JSValue as a function. See [unwrapResult](QuickJSAsyncContext.md#unwrapresult), which will throw if the function returned an error, or @@ -254,7 +267,44 @@ return the result handle directly. If evaluation returned a handle containing a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to convert it to a native promise and [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to finish evaluating the promise. -#### Parameters +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **args?**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +A result. If the function threw synchronously, `result.error` be a +handle to the exception. Otherwise `result.value` will be a handle to the +value. + +Example: + +```typescript +using parseIntHandle = context.getProp(global, "parseInt") +using stringHandle = context.newString("42") +using resultHandle = context.callFunction(parseIntHandle, context.undefined, stringHandle).unwrap() +console.log(context.dump(resultHandle)) // 42 +``` + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1060](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1060) + +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) @@ -262,9 +312,39 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver • ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Inherited from + +[`quickjs-emscripten.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1065](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1065) + +*** + +### callMethod() + +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +`handle[key](...args)` + +Call a method on a JSValue. This is a convenience method that calls [getProp](QuickJSAsyncContext.md#getprop) and [callFunction](QuickJSAsyncContext.md#callfunction). + +#### Parameters + +• **thisHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **key**: [`QuickJSPropertyKey`](../exports.md#quickjspropertykey) + +• **args**: [`QuickJSHandle`](../exports.md#quickjshandle)[]= `[]` + #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> A result. If the function threw synchronously, `result.error` be a handle to the exception. Otherwise `result.value` will be a handle to the @@ -272,11 +352,11 @@ value. #### Inherited from -[`quickjs-emscripten.QuickJSContext.callFunction`](QuickJSContext.md#callfunction) +[`quickjs-emscripten.QuickJSContext.callMethod`](QuickJSContext.md#callmethod) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1168 +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -309,7 +389,7 @@ socket.on("data", chunk => { #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1275 +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -340,7 +420,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1154 +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -365,7 +445,7 @@ will result in an error. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:890 +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -391,7 +471,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1228 +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -425,13 +505,40 @@ socket.write(dataLifetime?.value) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1262 +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) + +*** + +### eq() + +> **eq**(`handle`, `other`): `boolean` + +`handle === other` - IsStrictlyEqual. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.eq`](QuickJSContext.md#eq) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** ### evalCode() -> **evalCode**(`code`, `filename`?, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -464,7 +571,7 @@ create a time-based deadline. • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -475,7 +582,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> The last statement's value. If the code threw synchronously, `result.error` will be a handle to the exception. If execution was @@ -488,13 +595,13 @@ interrupted, the error will have name `InternalError` and message #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1202 +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`?, `options`?): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -502,7 +609,7 @@ Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -510,11 +617,33 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:334 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L44) + +*** + +### fail() + +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.fail`](QuickJSContext.md#fail) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -538,7 +667,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1102 +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -562,7 +691,78 @@ Converts `handle` to a Javascript bigint. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1098 +[packages/quickjs-emscripten-core/src/context.ts:682](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L682) + +*** + +### getIterator() + +> **getIterator**(`iterableHandle`): `QuickJSContextResult`\<`QuickJSIterator`\> + +`handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). +Returns a host iterator that wraps and proxies calls to a guest iterator handle. +Each step of the iteration returns a result, either an error or a handle to the next value. +Once the iterator is done, the handle is automatically disposed, and the iterator +is considered done if the handle is disposed. + +```typescript +for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { + using keyHandle = context.getProp(entriesHandle, 0) + using valueHandle = context.getProp(entriesHandle, 1) + console.log(context.dump(keyHandle), '->', context.dump(valueHandle)) +} +``` + +#### Parameters + +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`QuickJSContextResult`\<`QuickJSIterator`\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getIterator`](QuickJSContext.md#getiterator) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length` as a host number. + +Example use: +```typescript +const length = context.getLength(arrayHandle) ?? 0 +for (let i = 0; i < length; i++) { + using value = context.getProp(arrayHandle, i) + console.log(`array[${i}] =`, context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +a number if the handle has a numeric length property, otherwise `undefined`. + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getLength`](QuickJSContext.md#getlength) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -588,7 +788,61 @@ Converts `handle` into a Javascript number. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1085 +[packages/quickjs-emscripten-core/src/context.ts:653](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L653) + +*** + +### getOwnPropertyNames() + +> **getOwnPropertyNames**(`handle`, `options`): `QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), +but with extra, non-standard options for: + +- fetching array indexes as numbers (`numbers: true`) +- including symbols (`symbols: true`) +- only iterating over enumerable properties (`onlyEnumerable: true`) + +The default behavior is to emulate the standard: +```typescript +context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) +``` + +Note when passing an explicit options object, you must set at least one +option, and `strings` are not included unless specified. + +Example use: +```typescript +for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { + using value = context.getProp(handle, prop) + console.log(context.dump(prop), '->', context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions`= `undefined` + +#### Returns + +`QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +an an array of handles of the property names. The array itself is disposable for your convenience. + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getOwnPropertyNames`](QuickJSContext.md#getownpropertynames) + +#### Throws + +QuickJSEmptyGetOwnPropertyNames if no options are set. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:908](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L908) *** @@ -622,7 +876,7 @@ resultHandle.dispose(); #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1116 +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -652,7 +906,7 @@ Javascript string (which will be converted automatically). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1135 +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -676,7 +930,7 @@ Converts `handle` to a Javascript string. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1089 +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -701,7 +955,31 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1094 +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) + +*** + +### getWellKnownSymbol() + +> **getWellKnownSymbol**(`name`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Access a well-known symbol that is a property of the global Symbol object, like `Symbol.iterator`. + +#### Parameters + +• **name**: `string` + +#### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getWellKnownSymbol`](QuickJSContext.md#getwellknownsymbol) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -722,7 +1000,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:946 +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -746,7 +1024,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:950 +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -778,7 +1056,7 @@ See [Emscripten's docs on Asyncify](https://emscripten.org/docs/porting/asyncify #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:350 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L91) *** @@ -802,7 +1080,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:934 +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -830,7 +1108,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:934 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1068 +[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) #### newError(message) @@ -850,7 +1128,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1068 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1072 +[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -866,7 +1144,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1072 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1073 +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -983,7 +1261,7 @@ return deferred.handle #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1067 +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1007,7 +1285,7 @@ Converts a Javascript number into a QuickJS value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:916 +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1034,7 +1312,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:941 +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1059,7 +1337,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:957 +[packages/quickjs-emscripten-core/src/context.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L452) #### newPromise(promise) @@ -1085,7 +1363,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:965 +[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(newPromiseFn) @@ -1110,7 +1388,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:972 +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1134,7 +1412,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:920 +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1159,7 +1437,7 @@ All symbols created with the same key will be the same value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:930 +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1184,13 +1462,13 @@ No two symbols created with this function will be the same value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:925 +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1204,7 +1482,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from @@ -1216,7 +1494,61 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1127 +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) + +*** + +### sameValue() + +> **sameValue**(`handle`, `other`): `boolean` + +`Object.is(a, b)` +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.sameValue`](QuickJSContext.md#samevalue) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) + +*** + +### sameValueZero() + +> **sameValueZero**(`handle`, `other`): `boolean` + +SameValueZero comparison. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.sameValueZero`](QuickJSContext.md#samevaluezero) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1253,7 +1585,33 @@ properties. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1147 +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.success`](QuickJSContext.md#success) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1277,7 +1635,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1214 +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1305,7 +1663,7 @@ Does not support BigInt values correctly. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1080 +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1336,7 +1694,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1235 +[packages/quickjs-emscripten-core/src/context.ts:1278](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1278) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md index 0164dfba..1167449a 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md @@ -41,13 +41,16 @@ Configure ES module loading with [setModuleLoader](QuickJSAsyncRuntime.md#setmod - [`[dispose]`()](QuickJSAsyncRuntime.md#dispose) - [assertOwned()](QuickJSAsyncRuntime.md#assertowned) - [computeMemoryUsage()](QuickJSAsyncRuntime.md#computememoryusage) + - [debugLog()](QuickJSAsyncRuntime.md#debuglog) - [dispose()](QuickJSAsyncRuntime.md#dispose) - [dumpMemoryUsage()](QuickJSAsyncRuntime.md#dumpmemoryusage) - [executePendingJobs()](QuickJSAsyncRuntime.md#executependingjobs) - [hasPendingJob()](QuickJSAsyncRuntime.md#haspendingjob) + - [isDebugMode()](QuickJSAsyncRuntime.md#isdebugmode) - [newContext()](QuickJSAsyncRuntime.md#newcontext) - [removeInterruptHandler()](QuickJSAsyncRuntime.md#removeinterrupthandler) - [removeModuleLoader()](QuickJSAsyncRuntime.md#removemoduleloader) + - [setDebugMode()](QuickJSAsyncRuntime.md#setdebugmode) - [setInterruptHandler()](QuickJSAsyncRuntime.md#setinterrupthandler) - [setMaxStackSize()](QuickJSAsyncRuntime.md#setmaxstacksize) - [setMemoryLimit()](QuickJSAsyncRuntime.md#setmemorylimit) @@ -75,7 +78,7 @@ A context here may be allocated if one is needed by the runtime, eg for [compute #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:283 +[packages/quickjs-emscripten-core/src/runtime-asyncify.ts:26](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime-asyncify.ts#L26) ## Accessors @@ -93,7 +96,7 @@ false after the object has been [dispose](QuickJSAsyncRuntime.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:190 +[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) ## Methods @@ -113,7 +116,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -141,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:277 +[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) *** @@ -165,7 +168,34 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSAsyncRuntime #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:262 +[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) + +*** + +### debugLog() + +> **debugLog**(...`msg`): `void` + +In debug mode, log the result of calling `msg()`. + +We take a function instead of a log message to avoid expensive string +manipulation if debug logging is disabled. + +#### Parameters + +• ...**msg**: `unknown`[] + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten.QuickJSRuntime.debugLog`](QuickJSRuntime.md#debuglog) + +#### 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) *** @@ -185,7 +215,7 @@ Dispose of the underlying resources used by this object. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:191 +[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) *** @@ -206,13 +236,13 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSAsy #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:267 +[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) *** ### executePendingJobs() -> **executePendingJobs**(`maxJobsToExecute`?): [`ExecutePendingJobsResult`](../exports.md#executependingjobsresult) +> **executePendingJobs**(`maxJobsToExecute`): [`ExecutePendingJobsResult`](../exports.md#executependingjobsresult) Execute pendingJobs on the runtime until `maxJobsToExecute` jobs are executed (default all pendingJobs), the queue is exhausted, or the runtime @@ -223,7 +253,7 @@ pendingJobs. These do not execute immediately and need to triggered to run. #### Parameters -• **maxJobsToExecute?**: `number` \| `void` +• **maxJobsToExecute**: `number` \| `void`= `-1` When negative, run all pending jobs. Otherwise execute at most `maxJobsToExecute` before returning. @@ -244,7 +274,7 @@ functions or rejected promises. Those errors are available by calling #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:249 +[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) *** @@ -267,13 +297,33 @@ true if there is at least one pendingJob queued up. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:217 +[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) + +*** + +### isDebugMode() + +> **isDebugMode**(): `boolean` + +#### Returns + +`boolean` + +true if debug logging is enabled + +#### Inherited from + +[`quickjs-emscripten.QuickJSRuntime.isDebugMode`](QuickJSRuntime.md#isdebugmode) + +#### 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) *** ### newContext() -> **newContext**(`options`?): [`QuickJSAsyncContext`](QuickJSAsyncContext.md) +> **newContext**(`options`): [`QuickJSAsyncContext`](QuickJSAsyncContext.md) Create a new context within this runtime. Contexts have isolated globals, but you can explicitly share objects between contexts with the same @@ -283,7 +333,7 @@ You should dispose a created context before disposing this runtime. #### Parameters -• **options?**: [`ContextOptions`](../interfaces/ContextOptions.md) +• **options**: [`ContextOptions`](../interfaces/ContextOptions.md)= `{}` #### Returns @@ -295,7 +345,7 @@ You should dispose a created context before disposing this runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:301 +[packages/quickjs-emscripten-core/src/runtime-asyncify.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime-asyncify.ts#L49) *** @@ -316,7 +366,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:231 +[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) *** @@ -336,7 +386,34 @@ Remove the the loader set by [setModuleLoader](QuickJSAsyncRuntime.md#setmodulel #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:210 +[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) + +*** + +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable or disable debug logging. + +If this module is a DEBUG variant, more logs will be printed from the C +code. + +#### Parameters + +• **enabled**: `boolean` + +#### Returns + +`void` + +#### Inherited from + +[`quickjs-emscripten.QuickJSRuntime.setDebugMode`](QuickJSRuntime.md#setdebugmode) + +#### 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) *** @@ -364,7 +441,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSAsyncR #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:226 +[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) *** @@ -392,7 +469,7 @@ See the [pull request](https://github.com/justjake/quickjs-emscripten/pull/114) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:310 +[packages/quickjs-emscripten-core/src/runtime-asyncify.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime-asyncify.ts#L92) *** @@ -417,7 +494,7 @@ To remove the limit, set to `-1`. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:254 +[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) *** @@ -446,7 +523,7 @@ The loader can be removed with [removeModuleLoader](QuickJSAsyncRuntime.md#remov #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:302 +[packages/quickjs-emscripten-core/src/runtime-asyncify.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime-asyncify.ts#L75) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md b/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md index 433751ca..bdbe26f6 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncWASMModule.md @@ -50,7 +50,7 @@ Synchronous evalCode is not supported. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1458 +[packages/quickjs-emscripten-core/src/module-asyncify.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-asyncify.ts#L76) *** @@ -80,7 +80,7 @@ See the documentation for [QuickJSWASMModule#evalCode](QuickJSWASMModule.md#eval #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1470 +[packages/quickjs-emscripten-core/src/module-asyncify.ts:91](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-asyncify.ts#L91) *** @@ -104,13 +104,13 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1414 +[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) *** ### newContext() -> **newContext**(`options`?): [`QuickJSAsyncContext`](QuickJSAsyncContext.md) +> **newContext**(`options`): [`QuickJSAsyncContext`](QuickJSAsyncContext.md) A simplified API to create a new [QuickJSAsyncRuntime](QuickJSAsyncRuntime.md) and a [QuickJSAsyncContext](QuickJSAsyncContext.md) inside that runtime at the same time. The runtime will @@ -118,7 +118,7 @@ be disposed when the context is disposed. #### Parameters -• **options?**: [`ContextOptions`](../interfaces/ContextOptions.md) +• **options**: [`ContextOptions`](../interfaces/ContextOptions.md)= `{}` #### Returns @@ -130,13 +130,13 @@ be disposed when the context is disposed. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1456 +[packages/quickjs-emscripten-core/src/module-asyncify.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-asyncify.ts#L67) *** ### newRuntime() -> **newRuntime**(`options`?): [`QuickJSAsyncRuntime`](QuickJSAsyncRuntime.md) +> **newRuntime**(`options`): [`QuickJSAsyncRuntime`](QuickJSAsyncRuntime.md) Create a new async runtime inside this WebAssembly module. All runtimes inside a module are limited to a single async call at a time. For multiple @@ -144,7 +144,7 @@ concurrent async actions, create multiple WebAssembly modules. #### Parameters -• **options?**: [`AsyncRuntimeOptions`](../interfaces/AsyncRuntimeOptions.md) +• **options**: [`AsyncRuntimeOptions`](../interfaces/AsyncRuntimeOptions.md)= `{}` #### Returns @@ -156,7 +156,7 @@ concurrent async actions, create multiple WebAssembly modules. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1450 +[packages/quickjs-emscripten-core/src/module-asyncify.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-asyncify.ts#L41) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 2f8b8477..be34f1df 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -54,19 +54,26 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [Methods](QuickJSContext.md#methods) - [`[dispose]`()](QuickJSContext.md#dispose) - [callFunction()](QuickJSContext.md#callfunction) + - [callMethod()](QuickJSContext.md#callmethod) - [decodeBinaryJSON()](QuickJSContext.md#decodebinaryjson) - [defineProp()](QuickJSContext.md#defineprop) - [dispose()](QuickJSContext.md#dispose) - [dump()](QuickJSContext.md#dump) - [encodeBinaryJSON()](QuickJSContext.md#encodebinaryjson) + - [eq()](QuickJSContext.md#eq) - [evalCode()](QuickJSContext.md#evalcode) + - [fail()](QuickJSContext.md#fail) - [getArrayBuffer()](QuickJSContext.md#getarraybuffer) - [getBigInt()](QuickJSContext.md#getbigint) + - [getIterator()](QuickJSContext.md#getiterator) + - [getLength()](QuickJSContext.md#getlength) - [getNumber()](QuickJSContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSContext.md#getownpropertynames) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) - [getString()](QuickJSContext.md#getstring) - [getSymbol()](QuickJSContext.md#getsymbol) + - [getWellKnownSymbol()](QuickJSContext.md#getwellknownsymbol) - [newArray()](QuickJSContext.md#newarray) - [newArrayBuffer()](QuickJSContext.md#newarraybuffer) - [newBigInt()](QuickJSContext.md#newbigint) @@ -79,7 +86,10 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [newSymbolFor()](QuickJSContext.md#newsymbolfor) - [newUniqueSymbol()](QuickJSContext.md#newuniquesymbol) - [resolvePromise()](QuickJSContext.md#resolvepromise) + - [sameValue()](QuickJSContext.md#samevalue) + - [sameValueZero()](QuickJSContext.md#samevaluezero) - [setProp()](QuickJSContext.md#setprop) + - [success()](QuickJSContext.md#success) - [throw()](QuickJSContext.md#throw) - [typeof()](QuickJSContext.md#typeof) - [unwrapResult()](QuickJSContext.md#unwrapresult) @@ -130,7 +140,7 @@ to create a new QuickJSContext. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:874 +[packages/quickjs-emscripten-core/src/context.ts:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -142,7 +152,7 @@ The runtime that created this context. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:847 +[packages/quickjs-emscripten-core/src/context.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L187) ## Accessors @@ -160,7 +170,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:883 +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -176,7 +186,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:883 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:906 +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -194,7 +204,7 @@ You can set properties to create global variables. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:912 +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -210,7 +220,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:912 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:898 +[packages/quickjs-emscripten-core/src/context.ts:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -226,7 +236,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:898 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:902 +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -242,7 +252,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:902 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:894 +[packages/quickjs-emscripten-core/src/context.ts:275](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L275) ## Methods @@ -266,15 +276,18 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) -[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). +> **callFunction**(`func`, `thisVal`, `args`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +[`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) or +[`func.apply(thisVal, args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). Call a JSValue as a function. See [unwrapResult](QuickJSContext.md#unwrapresult), which will throw if the function returned an error, or @@ -282,29 +295,92 @@ return the result handle directly. If evaluation returned a handle containing a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it to a native promise and [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to finish evaluating the promise. -#### Parameters +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) • **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) -• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +• **args?**: [`QuickJSHandle`](../exports.md#quickjshandle)[] -#### Returns +##### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> A result. If the function threw synchronously, `result.error` be a handle to the exception. Otherwise `result.value` will be a handle to the value. -#### Implementation of +Example: + +```typescript +using parseIntHandle = context.getProp(global, "parseInt") +using stringHandle = context.newString("42") +using resultHandle = context.callFunction(parseIntHandle, context.undefined, stringHandle).unwrap() +console.log(context.dump(resultHandle)) // 42 +``` + +##### Implementation of [`quickjs-emscripten.LowLevelJavascriptVm.callFunction`](../interfaces/LowLevelJavascriptVm.md#callfunction) +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1060](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1060) + +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Implementation of + +`LowLevelJavascriptVm.callFunction` + +##### Source + +[packages/quickjs-emscripten-core/src/context.ts:1065](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1065) + +*** + +### callMethod() + +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +`handle[key](...args)` + +Call a method on a JSValue. This is a convenience method that calls [getProp](QuickJSContext.md#getprop) and [callFunction](QuickJSContext.md#callfunction). + +#### Parameters + +• **thisHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **key**: [`QuickJSPropertyKey`](../exports.md#quickjspropertykey) + +• **args**: [`QuickJSHandle`](../exports.md#quickjshandle)[]= `[]` + +#### Returns + +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +A result. If the function threw synchronously, `result.error` be a +handle to the exception. Otherwise `result.value` will be a handle to the +value. + #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1168 +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -333,7 +409,7 @@ socket.on("data", chunk => { #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1275 +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -364,7 +440,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1154 +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -393,7 +469,7 @@ will result in an error. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:890 +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -415,7 +491,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1228 +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -445,13 +521,36 @@ socket.write(dataLifetime?.value) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1262 +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) + +*** + +### eq() + +> **eq**(`handle`, `other`): `boolean` + +`handle === other` - IsStrictlyEqual. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** ### evalCode() -> **evalCode**(`code`, `filename`?, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -484,7 +583,7 @@ create a time-based deadline. • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -495,7 +594,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> The last statement's value. If the code threw synchronously, `result.error` will be a handle to the exception. If execution was @@ -508,7 +607,25 @@ interrupted, the error will have name `InternalError` and message #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1202 +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) + +*** + +### fail() + +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -528,7 +645,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1102 +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -548,7 +665,70 @@ Converts `handle` to a Javascript bigint. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1098 +[packages/quickjs-emscripten-core/src/context.ts:682](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L682) + +*** + +### getIterator() + +> **getIterator**(`iterableHandle`): `QuickJSContextResult`\<`QuickJSIterator`\> + +`handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). +Returns a host iterator that wraps and proxies calls to a guest iterator handle. +Each step of the iteration returns a result, either an error or a handle to the next value. +Once the iterator is done, the handle is automatically disposed, and the iterator +is considered done if the handle is disposed. + +```typescript +for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { + using keyHandle = context.getProp(entriesHandle, 0) + using valueHandle = context.getProp(entriesHandle, 1) + console.log(context.dump(keyHandle), '->', context.dump(valueHandle)) +} +``` + +#### Parameters + +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`QuickJSContextResult`\<`QuickJSIterator`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length` as a host number. + +Example use: +```typescript +const length = context.getLength(arrayHandle) ?? 0 +for (let i = 0; i < length; i++) { + using value = context.getProp(arrayHandle, i) + console.log(`array[${i}] =`, context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +a number if the handle has a numeric length property, otherwise `undefined`. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -574,7 +754,57 @@ Converts `handle` into a Javascript number. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1085 +[packages/quickjs-emscripten-core/src/context.ts:653](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L653) + +*** + +### getOwnPropertyNames() + +> **getOwnPropertyNames**(`handle`, `options`): `QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), +but with extra, non-standard options for: + +- fetching array indexes as numbers (`numbers: true`) +- including symbols (`symbols: true`) +- only iterating over enumerable properties (`onlyEnumerable: true`) + +The default behavior is to emulate the standard: +```typescript +context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) +``` + +Note when passing an explicit options object, you must set at least one +option, and `strings` are not included unless specified. + +Example use: +```typescript +for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { + using value = context.getProp(handle, prop) + console.log(context.dump(prop), '->', context.dump(value)) +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions`= `undefined` + +#### Returns + +`QuickJSContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> + +an an array of handles of the property names. The array itself is disposable for your convenience. + +#### Throws + +QuickJSEmptyGetOwnPropertyNames if no options are set. + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:908](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L908) *** @@ -604,7 +834,7 @@ resultHandle.dispose(); #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1116 +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -634,7 +864,7 @@ Javascript string (which will be converted automatically). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1135 +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -658,7 +888,7 @@ Converts `handle` to a Javascript string. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1089 +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -679,7 +909,27 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1094 +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) + +*** + +### getWellKnownSymbol() + +> **getWellKnownSymbol**(`name`): [`QuickJSHandle`](../exports.md#quickjshandle) + +Access a well-known symbol that is a property of the global Symbol object, like `Symbol.iterator`. + +#### Parameters + +• **name**: `string` + +#### Returns + +[`QuickJSHandle`](../exports.md#quickjshandle) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -696,7 +946,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:946 +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -716,7 +966,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:950 +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -736,7 +986,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:934 +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -760,7 +1010,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:934 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1068 +[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) #### newError(message) @@ -776,7 +1026,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1068 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1072 +[packages/quickjs-emscripten-core/src/context.ts:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -788,7 +1038,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1072 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1073 +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -905,7 +1155,7 @@ return deferred.handle #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1067 +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -929,7 +1179,7 @@ Converts a Javascript number into a QuickJS value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:916 +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -956,7 +1206,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:941 +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -977,7 +1227,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:957 +[packages/quickjs-emscripten-core/src/context.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L452) #### newPromise(promise) @@ -999,7 +1249,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:965 +[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(newPromiseFn) @@ -1020,7 +1270,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:972 +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1044,7 +1294,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:920 +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1065,7 +1315,7 @@ All symbols created with the same key will be the same value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:930 +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1086,13 +1336,13 @@ No two symbols created with this function will be the same value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:925 +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1106,7 +1356,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks @@ -1114,7 +1364,53 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1127 +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) + +*** + +### sameValue() + +> **sameValue**(`handle`, `other`): `boolean` + +`Object.is(a, b)` +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) + +*** + +### sameValueZero() + +> **sameValueZero**(`handle`, `other`): `boolean` + +SameValueZero comparison. +See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **other**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1151,7 +1447,29 @@ properties. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1147 +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1171,7 +1489,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1214 +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1199,7 +1517,7 @@ Does not support BigInt values correctly. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1080 +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1226,7 +1544,7 @@ If the result is an error, converts the error to a native object and throws the #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1235 +[packages/quickjs-emscripten-core/src/context.ts:1278](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1278) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSDeferredPromise.md b/doc/quickjs-emscripten/classes/QuickJSDeferredPromise.md index b103ad54..99bae90c 100644 --- a/doc/quickjs-emscripten/classes/QuickJSDeferredPromise.md +++ b/doc/quickjs-emscripten/classes/QuickJSDeferredPromise.md @@ -22,9 +22,9 @@ itself, (2) the `resolve` callback, and (3) the `reject` callback. and ensure that either [resolve](QuickJSDeferredPromise.md#resolve) or [reject](QuickJSDeferredPromise.md#reject) will be called. No other clean-up is necessary. -- In other cases, call [dispose](QuickJSDeferredPromise.md#dispose), which will dispose [handle](QuickJSDeferredPromise.md#handle) as well as the +- In other cases, call [dispose](QuickJSDeferredPromise.md#dispose-1), which will dispose [handle](QuickJSDeferredPromise.md#handle) as well as the QuickJS handles that back [resolve](QuickJSDeferredPromise.md#resolve) and [reject](QuickJSDeferredPromise.md#reject). For this object, - [dispose](QuickJSDeferredPromise.md#dispose) is idempotent. + [dispose](QuickJSDeferredPromise.md#dispose-1) is idempotent. ## Contents @@ -34,16 +34,16 @@ itself, (2) the `resolve` callback, and (3) the `reject` callback. - [new QuickJSDeferredPromise(args)](QuickJSDeferredPromise.md#new-quickjsdeferredpromiseargs) - [Properties](QuickJSDeferredPromise.md#properties) - [context](QuickJSDeferredPromise.md#context) - - [dispose](QuickJSDeferredPromise.md#dispose) - [handle](QuickJSDeferredPromise.md#handle) - [owner](QuickJSDeferredPromise.md#owner) - - [reject](QuickJSDeferredPromise.md#reject) - - [resolve](QuickJSDeferredPromise.md#resolve) - [settled](QuickJSDeferredPromise.md#settled) - [Accessors](QuickJSDeferredPromise.md#accessors) - [alive](QuickJSDeferredPromise.md#alive) - [Methods](QuickJSDeferredPromise.md#methods) - [`[dispose]`()](QuickJSDeferredPromise.md#dispose) + - [dispose()](QuickJSDeferredPromise.md#dispose) + - [reject()](QuickJSDeferredPromise.md#reject) + - [resolve()](QuickJSDeferredPromise.md#resolve) ## Extends @@ -84,7 +84,7 @@ this constructor directly. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:746 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L95) ## Properties @@ -94,157 +94,159 @@ packages/quickjs-emscripten-core/dist/index.d.ts:746 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:728 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L73) *** -### dispose +### handle -> **dispose**: () => `void` +> **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) -#### Returns +A handle of the Promise instance inside the QuickJSContext. +You must dispose [handle](QuickJSDeferredPromise.md#handle) or the entire QuickJSDeferredPromise once you +are finished with it. -`void` +#### Source -#### Implementation of +[packages/quickjs-emscripten-core/src/deferred-promise.ts:80](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L80) -[`quickjs-emscripten.Disposable.dispose`](../interfaces/Disposable.md#dispose-1) +*** -#### Overrides +### owner -[`quickjs-emscripten.UsingDisposable.dispose`](UsingDisposable.md#abstract-dispose) +> **owner**: [`QuickJSRuntime`](QuickJSRuntime.md) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:771 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L72) *** -### handle +### settled -> **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) +> **settled**: `Promise`\<`void`\> -A handle of the Promise instance inside the QuickJSContext. -You must dispose [handle](QuickJSDeferredPromise.md#handle) or the entire QuickJSDeferredPromise once you -are finished with it. +A native promise that will resolve once this deferred is settled. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:734 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L85) -*** +## Accessors -### owner +### alive -> **owner**: [`QuickJSRuntime`](QuickJSRuntime.md) +> **`get`** **alive**(): `boolean` -#### Source +#### Returns -packages/quickjs-emscripten-core/dist/index.d.ts:727 +`boolean` -*** +true if the object is alive -### reject +false after the object has been [dispose](QuickJSDeferredPromise.md#dispose-1)d -> **reject**: (`value`?) => `void` +#### Source -Reject [handle](QuickJSDeferredPromise.md#handle) with the given value, if any. -Calling this method after calling [dispose](QuickJSDeferredPromise.md#dispose) is a no-op. +[packages/quickjs-emscripten-core/src/deferred-promise.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L166) -Note that after rejecting a promise, you may need to call -[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to propagate the result to the promise's -callbacks. +## Methods -#### Parameters +### `[dispose]`() -• **value?**: [`QuickJSHandle`](../exports.md#quickjshandle) +> **[dispose]**(): `void` + +Just calls the standard .dispose() method of this class. #### Returns `void` -#### Source +#### Implementation of -packages/quickjs-emscripten-core/dist/index.d.ts:769 +[`quickjs-emscripten.Disposable.[dispose]`](../interfaces/Disposable.md#dispose) -*** +#### Inherited from -### resolve +[`quickjs-emscripten.UsingDisposable.[dispose]`](UsingDisposable.md#dispose) -> **resolve**: (`value`?) => `void` +#### Source -Resolve [handle](QuickJSDeferredPromise.md#handle) with the given value, if any. -Calling this method after calling [dispose](QuickJSDeferredPromise.md#dispose) is a no-op. +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) -Note that after resolving a promise, you may need to call -[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to propagate the result to the promise's -callbacks. +*** -#### Parameters +### dispose() -• **value?**: [`QuickJSHandle`](../exports.md#quickjshandle) +> **dispose**(): `void` + +Dispose of the underlying resources used by this object. #### Returns `void` -#### Source +#### Implementation of -packages/quickjs-emscripten-core/dist/index.d.ts:760 +[`quickjs-emscripten.Disposable.dispose`](../interfaces/Disposable.md#dispose-1) -*** +#### Overrides -### settled +[`quickjs-emscripten.UsingDisposable.dispose`](UsingDisposable.md#abstract-dispose) -> **settled**: `Promise`\<`void`\> +#### Source -A native promise that will resolve once this deferred is settled. +[packages/quickjs-emscripten-core/src/deferred-promise.ts:170](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L170) -#### Source +*** -packages/quickjs-emscripten-core/dist/index.d.ts:738 +### reject() -## Accessors +> **reject**(`value`?): `void` -### alive +Reject [handle](QuickJSDeferredPromise.md#handle) with the given value, if any. +Calling this method after calling [dispose](QuickJSDeferredPromise.md#dispose-1) is a no-op. -> **`get`** **alive**(): `boolean` +Note that after rejecting a promise, you may need to call +[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to propagate the result to the promise's +callbacks. -#### Returns +#### Parameters -`boolean` +• **value?**: [`QuickJSHandle`](../exports.md#quickjshandle) -true if the object is alive +#### Returns -false after the object has been [dispose](QuickJSDeferredPromise.md#dispose)d +`void` #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:770 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L147) -## Methods - -### `[dispose]`() +*** -> **[dispose]**(): `void` +### resolve() -Just calls the standard .dispose() method of this class. +> **resolve**(`value`?): `void` -#### Returns +Resolve [handle](QuickJSDeferredPromise.md#handle) with the given value, if any. +Calling this method after calling [dispose](QuickJSDeferredPromise.md#dispose-1) is a no-op. -`void` +Note that after resolving a promise, you may need to call +[QuickJSRuntime#executePendingJobs](QuickJSRuntime.md#executependingjobs) to propagate the result to the promise's +callbacks. -#### Implementation of +#### Parameters -[`quickjs-emscripten.Disposable.[dispose]`](../interfaces/Disposable.md#dispose) +• **value?**: [`QuickJSHandle`](../exports.md#quickjshandle) -#### Inherited from +#### Returns -[`quickjs-emscripten.UsingDisposable.[dispose]`](UsingDisposable.md#dispose) +`void` #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L120) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSRuntime.md b/doc/quickjs-emscripten/classes/QuickJSRuntime.md index a474a278..a6c48a82 100644 --- a/doc/quickjs-emscripten/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSRuntime.md @@ -42,13 +42,16 @@ Configure ES module loading with [setModuleLoader](QuickJSRuntime.md#setmodulelo - [`[dispose]`()](QuickJSRuntime.md#dispose) - [assertOwned()](QuickJSRuntime.md#assertowned) - [computeMemoryUsage()](QuickJSRuntime.md#computememoryusage) + - [debugLog()](QuickJSRuntime.md#debuglog) - [dispose()](QuickJSRuntime.md#dispose) - [dumpMemoryUsage()](QuickJSRuntime.md#dumpmemoryusage) - [executePendingJobs()](QuickJSRuntime.md#executependingjobs) - [hasPendingJob()](QuickJSRuntime.md#haspendingjob) + - [isDebugMode()](QuickJSRuntime.md#isdebugmode) - [newContext()](QuickJSRuntime.md#newcontext) - [removeInterruptHandler()](QuickJSRuntime.md#removeinterrupthandler) - [removeModuleLoader()](QuickJSRuntime.md#removemoduleloader) + - [setDebugMode()](QuickJSRuntime.md#setdebugmode) - [setInterruptHandler()](QuickJSRuntime.md#setinterrupthandler) - [setMaxStackSize()](QuickJSRuntime.md#setmaxstacksize) - [setMemoryLimit()](QuickJSRuntime.md#setmemorylimit) @@ -76,7 +79,7 @@ A context here may be allocated if one is needed by the runtime, eg for [compute #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:163 +[packages/quickjs-emscripten-core/src/runtime.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L78) ## Accessors @@ -94,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:190 +[packages/quickjs-emscripten-core/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) ## Methods @@ -118,7 +121,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -142,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:277 +[packages/quickjs-emscripten-core/src/runtime.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L327) *** @@ -162,7 +165,30 @@ For a human-digestible representation, see [dumpMemoryUsage](QuickJSRuntime.md#d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:262 +[packages/quickjs-emscripten-core/src/runtime.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L296) + +*** + +### debugLog() + +> **debugLog**(...`msg`): `void` + +In debug mode, log the result of calling `msg()`. + +We take a function instead of a log message to avoid expensive string +manipulation if debug logging is disabled. + +#### Parameters + +• ...**msg**: `unknown`[] + +#### Returns + +`void` + +#### 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) *** @@ -186,7 +212,7 @@ Dispose of the underlying resources used by this object. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:191 +[packages/quickjs-emscripten-core/src/runtime.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L129) *** @@ -203,13 +229,13 @@ For programmatic access to this information, see [computeMemoryUsage](QuickJSRun #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:267 +[packages/quickjs-emscripten-core/src/runtime.ts:307](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L307) *** ### executePendingJobs() -> **executePendingJobs**(`maxJobsToExecute`?): [`ExecutePendingJobsResult`](../exports.md#executependingjobsresult) +> **executePendingJobs**(`maxJobsToExecute`): [`ExecutePendingJobsResult`](../exports.md#executependingjobsresult) Execute pendingJobs on the runtime until `maxJobsToExecute` jobs are executed (default all pendingJobs), the queue is exhausted, or the runtime @@ -220,7 +246,7 @@ pendingJobs. These do not execute immediately and need to triggered to run. #### Parameters -• **maxJobsToExecute?**: `number` \| `void` +• **maxJobsToExecute**: `number` \| `void`= `-1` When negative, run all pending jobs. Otherwise execute at most `maxJobsToExecute` before returning. @@ -237,7 +263,7 @@ functions or rejected promises. Those errors are available by calling #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:249 +[packages/quickjs-emscripten-core/src/runtime.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L243) *** @@ -256,13 +282,29 @@ true if there is at least one pendingJob queued up. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:217 +[packages/quickjs-emscripten-core/src/runtime.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L194) + +*** + +### isDebugMode() + +> **isDebugMode**(): `boolean` + +#### Returns + +`boolean` + +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) *** ### newContext() -> **newContext**(`options`?): [`QuickJSContext`](QuickJSContext.md) +> **newContext**(`options`): [`QuickJSContext`](QuickJSContext.md) Create a new context within this runtime. Contexts have isolated globals, but you can explicitly share objects between contexts with the same @@ -272,7 +314,7 @@ You should dispose a created context before disposing this runtime. #### Parameters -• **options?**: [`ContextOptions`](../interfaces/ContextOptions.md) +• **options**: [`ContextOptions`](../interfaces/ContextOptions.md)= `{}` #### Returns @@ -280,7 +322,7 @@ You should dispose a created context before disposing this runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:199 +[packages/quickjs-emscripten-core/src/runtime.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L140) *** @@ -297,7 +339,7 @@ See [setInterruptHandler](QuickJSRuntime.md#setinterrupthandler). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:231 +[packages/quickjs-emscripten-core/src/runtime.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L219) *** @@ -313,7 +355,30 @@ Remove the the loader set by [setModuleLoader](QuickJSRuntime.md#setmoduleloader #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:210 +[packages/quickjs-emscripten-core/src/runtime.ts:181](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L181) + +*** + +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable or disable debug logging. + +If this module is a DEBUG variant, more logs will be printed from the C +code. + +#### Parameters + +• **enabled**: `boolean` + +#### Returns + +`void` + +#### 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) *** @@ -337,7 +402,7 @@ The interrupt handler can be removed with [removeInterruptHandler](QuickJSRuntim #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:226 +[packages/quickjs-emscripten-core/src/runtime.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L207) *** @@ -358,7 +423,7 @@ To remove the limit, set to `0`. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:272 +[packages/quickjs-emscripten-core/src/runtime.ts:315](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L315) *** @@ -379,7 +444,7 @@ To remove the limit, set to `-1`. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:254 +[packages/quickjs-emscripten-core/src/runtime.ts:281](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L281) *** @@ -404,7 +469,7 @@ The loader can be removed with [removeModuleLoader](QuickJSRuntime.md#removemodu #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:206 +[packages/quickjs-emscripten-core/src/runtime.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L172) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSWASMModule.md b/doc/quickjs-emscripten/classes/QuickJSWASMModule.md index 001b46d8..16001677 100644 --- a/doc/quickjs-emscripten/classes/QuickJSWASMModule.md +++ b/doc/quickjs-emscripten/classes/QuickJSWASMModule.md @@ -39,7 +39,7 @@ inside QuickJS, create a context with [newContext](QuickJSWASMModule.md#newconte ### evalCode() -> **evalCode**(`code`, `options`?): `unknown` +> **evalCode**(`code`, `options`): `unknown` One-off evaluate code without needing to create a [QuickJSRuntime](QuickJSRuntime.md) or [QuickJSContext](QuickJSContext.md) explicitly. @@ -60,7 +60,7 @@ you need to work with async code inside QuickJS, create a runtime and use • **code**: `string` -• **options?**: [`ModuleEvalOptions`](../interfaces/ModuleEvalOptions.md) +• **options**: [`ModuleEvalOptions`](../interfaces/ModuleEvalOptions.md)= `{}` #### Returns @@ -81,7 +81,7 @@ with name `"InternalError"` and message `"interrupted"`. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1404 +[packages/quickjs-emscripten-core/src/module.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L395) *** @@ -101,13 +101,13 @@ and provide the [CustomizeVariantOptions#wasmMemory](../interfaces/CustomizeVari #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1414 +[packages/quickjs-emscripten-core/src/module.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L426) *** ### newContext() -> **newContext**(`options`?): [`QuickJSContext`](QuickJSContext.md) +> **newContext**(`options`): [`QuickJSContext`](QuickJSContext.md) A simplified API to create a new [QuickJSRuntime](QuickJSRuntime.md) and a [QuickJSContext](QuickJSContext.md) inside that runtime at the same time. The runtime will @@ -115,7 +115,7 @@ be disposed when the context is disposed. #### Parameters -• **options?**: [`ContextOptions`](../interfaces/ContextOptions.md) +• **options**: [`ContextOptions`](../interfaces/ContextOptions.md)= `{}` #### Returns @@ -123,13 +123,13 @@ be disposed when the context is disposed. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1378 +[packages/quickjs-emscripten-core/src/module.ts:360](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L360) *** ### newRuntime() -> **newRuntime**(`options`?): [`QuickJSRuntime`](QuickJSRuntime.md) +> **newRuntime**(`options`): [`QuickJSRuntime`](QuickJSRuntime.md) Create a runtime. Use the runtime to set limits on CPU and memory usage and configure module @@ -137,7 +137,7 @@ loading for one or more [QuickJSContext](QuickJSContext.md)s inside the runtime. #### Parameters -• **options?**: [`RuntimeOptions`](../interfaces/RuntimeOptions.md) +• **options**: [`RuntimeOptions`](../interfaces/RuntimeOptions.md)= `{}` #### Returns @@ -145,7 +145,7 @@ loading for one or more [QuickJSContext](QuickJSContext.md)s inside the runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1372 +[packages/quickjs-emscripten-core/src/module.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L333) *** diff --git a/doc/quickjs-emscripten/classes/Scope.md b/doc/quickjs-emscripten/classes/Scope.md index 4ad5e7ec..038058ef 100644 --- a/doc/quickjs-emscripten/classes/Scope.md +++ b/doc/quickjs-emscripten/classes/Scope.md @@ -63,7 +63,7 @@ false after the object has been [dispose](Scope.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:665 +[packages/quickjs-emscripten-core/src/lifetime.ts:308](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L308) ## Methods @@ -87,7 +87,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -111,7 +111,7 @@ Dispose of the underlying resources used by this object. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:666 +[packages/quickjs-emscripten-core/src/lifetime.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L312) *** @@ -135,7 +135,7 @@ Track `lifetime` so that it is disposed when this scope is disposed. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:664 +[packages/quickjs-emscripten-core/src/lifetime.ts:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L303) *** @@ -165,7 +165,7 @@ Do not use with async functions. Instead, use [withScopeAsync](Scope.md#withscop #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:651 +[packages/quickjs-emscripten-core/src/lifetime.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L248) *** @@ -192,7 +192,7 @@ block returns. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:659 +[packages/quickjs-emscripten-core/src/lifetime.ts:285](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L285) *** @@ -220,7 +220,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:659 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:652 +[packages/quickjs-emscripten-core/src/lifetime.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L261) *** diff --git a/doc/quickjs-emscripten/classes/StaticLifetime.md b/doc/quickjs-emscripten/classes/StaticLifetime.md index 980d45ac..43563372 100644 --- a/doc/quickjs-emscripten/classes/StaticLifetime.md +++ b/doc/quickjs-emscripten/classes/StaticLifetime.md @@ -64,13 +64,13 @@ A Lifetime that lives forever. Used for constants. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:623 +[packages/quickjs-emscripten-core/src/lifetime.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L173) ## Properties ### \_alive -> **`protected`** **\_alive**: `boolean` +> **`protected`** **\_alive**: `boolean` = `true` #### Inherited from @@ -78,7 +78,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:623 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:582 +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -92,7 +92,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:582 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:583 +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -106,7 +106,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:583 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:581 +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -120,7 +120,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:581 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:578 +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -142,7 +142,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:578 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:579 +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -164,7 +164,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:579 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:580 +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -182,7 +182,7 @@ false after the object has been [dispose](StaticLifetime.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:593 +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -196,7 +196,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:593 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:624 +[packages/quickjs-emscripten-core/src/lifetime.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L178) *** @@ -210,7 +210,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:624 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:601 +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -231,7 +231,7 @@ If the lifetime has been [dispose](StaticLifetime.md#dispose-1)d already. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:600 +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -251,7 +251,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -283,7 +283,7 @@ the result of `map(this)`. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:611 +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -307,7 +307,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:611 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:612 +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -327,7 +327,7 @@ Dispose of [value](StaticLifetime.md#value-1) and perform cleanup. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:626 +[packages/quickjs-emscripten-core/src/lifetime.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L188) *** @@ -347,7 +347,7 @@ Create a new handle pointing to the same [value](StaticLifetime.md#value-1). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:625 +[packages/quickjs-emscripten-core/src/lifetime.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L183) *** diff --git a/doc/quickjs-emscripten/classes/TestQuickJSWASMModule.md b/doc/quickjs-emscripten/classes/TestQuickJSWASMModule.md index f256e383..8634c28c 100644 --- a/doc/quickjs-emscripten/classes/TestQuickJSWASMModule.md +++ b/doc/quickjs-emscripten/classes/TestQuickJSWASMModule.md @@ -51,7 +51,7 @@ freed all the memory you've ever allocated. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1660 +[packages/quickjs-emscripten-core/src/module-test.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L21) ## Properties @@ -61,7 +61,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1660 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1658 +[packages/quickjs-emscripten-core/src/module-test.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L19) *** @@ -71,7 +71,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1658 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1659 +[packages/quickjs-emscripten-core/src/module-test.ts:20](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L20) ## Methods @@ -85,7 +85,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1659 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1665 +[packages/quickjs-emscripten-core/src/module-test.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L62) *** @@ -99,7 +99,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1665 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1664 +[packages/quickjs-emscripten-core/src/module-test.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L51) *** @@ -123,7 +123,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1664 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1663 +[packages/quickjs-emscripten-core/src/module-test.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L47) *** @@ -141,7 +141,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1663 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1666 +[packages/quickjs-emscripten-core/src/module-test.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L79) *** @@ -163,7 +163,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1666 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1662 +[packages/quickjs-emscripten-core/src/module-test.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L35) *** @@ -185,7 +185,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:1662 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1661 +[packages/quickjs-emscripten-core/src/module-test.ts:23](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module-test.ts#L23) *** diff --git a/doc/quickjs-emscripten/classes/UsingDisposable.md b/doc/quickjs-emscripten/classes/UsingDisposable.md index 674cb3b4..686c807b 100644 --- a/doc/quickjs-emscripten/classes/UsingDisposable.md +++ b/doc/quickjs-emscripten/classes/UsingDisposable.md @@ -22,11 +22,11 @@ Base abstract class that helps implement [Disposable](../interfaces/Disposable.m ## Extended By -- [`Lifetime`](Lifetime.md) - [`QuickJSContext`](QuickJSContext.md) -- [`QuickJSDeferredPromise`](QuickJSDeferredPromise.md) - [`QuickJSRuntime`](QuickJSRuntime.md) +- [`Lifetime`](Lifetime.md) - [`Scope`](Scope.md) +- [`QuickJSDeferredPromise`](QuickJSDeferredPromise.md) ## Implements @@ -54,7 +54,7 @@ Base abstract class that helps implement [Disposable](../interfaces/Disposable.m #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:561 +[packages/quickjs-emscripten-core/src/lifetime.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L39) ## Methods @@ -74,7 +74,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -94,7 +94,7 @@ Dispose of the underlying resources used by this object. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:565 +[packages/quickjs-emscripten-core/src/lifetime.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L43) *** diff --git a/doc/quickjs-emscripten/classes/WeakLifetime.md b/doc/quickjs-emscripten/classes/WeakLifetime.md index df8320a1..41173dc4 100644 --- a/doc/quickjs-emscripten/classes/WeakLifetime.md +++ b/doc/quickjs-emscripten/classes/WeakLifetime.md @@ -74,13 +74,13 @@ Used for function arguments. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:636 +[packages/quickjs-emscripten-core/src/lifetime.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L199) ## Properties ### \_alive -> **`protected`** **\_alive**: `boolean` +> **`protected`** **\_alive**: `boolean` = `true` #### Inherited from @@ -88,7 +88,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:636 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:582 +[packages/quickjs-emscripten-core/src/lifetime.ts:72](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L72) *** @@ -102,7 +102,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:582 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:583 +[packages/quickjs-emscripten-core/src/lifetime.ts:73](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L73) *** @@ -116,7 +116,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:583 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:581 +[packages/quickjs-emscripten-core/src/lifetime.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L87) *** @@ -130,7 +130,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:581 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:578 +[packages/quickjs-emscripten-core/src/lifetime.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L84) *** @@ -152,7 +152,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:578 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:579 +[packages/quickjs-emscripten-core/src/lifetime.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L85) *** @@ -174,7 +174,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:579 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:580 +[packages/quickjs-emscripten-core/src/lifetime.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L86) ## Accessors @@ -192,7 +192,7 @@ false after the object has been [dispose](WeakLifetime.md#dispose-1)d #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:593 +[packages/quickjs-emscripten-core/src/lifetime.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L92) *** @@ -206,7 +206,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:593 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:602 +[packages/quickjs-emscripten-core/src/lifetime.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L111) *** @@ -220,7 +220,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:602 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:601 +[packages/quickjs-emscripten-core/src/lifetime.ts:107](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L107) *** @@ -241,7 +241,7 @@ If the lifetime has been [dispose](WeakLifetime.md#dispose-1)d already. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:600 +[packages/quickjs-emscripten-core/src/lifetime.ts:102](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L102) ## Methods @@ -261,7 +261,7 @@ Just calls the standard .dispose() method of this class. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:569 +[packages/quickjs-emscripten-core/src/lifetime.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L47) *** @@ -293,7 +293,7 @@ the result of `map(this)`. ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:611 +[packages/quickjs-emscripten-core/src/lifetime.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L135) #### consume(map) @@ -317,7 +317,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:611 ##### Source -packages/quickjs-emscripten-core/dist/index.d.ts:612 +[packages/quickjs-emscripten-core/src/lifetime.ts:138](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L138) *** @@ -337,7 +337,7 @@ Dispose of [value](WeakLifetime.md#value-1) and perform cleanup. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:637 +[packages/quickjs-emscripten-core/src/lifetime.ts:209](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L209) *** @@ -357,7 +357,7 @@ Create a new handle pointing to the same [value](WeakLifetime.md#value-1). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:606 +[packages/quickjs-emscripten-core/src/lifetime.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L118) *** diff --git a/doc/quickjs-emscripten/exports.md b/doc/quickjs-emscripten/exports.md index 7105b429..211cc711 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -14,6 +14,8 @@ - [Type Aliases](exports.md#type-aliases) - [AsyncFunctionImplementation](exports.md#asyncfunctionimplementation) - [BorrowedHeapCharPointer](exports.md#borrowedheapcharpointer) + - [DisposableArray\](exports.md#disposablearrayt) + - [DisposableResult\](exports.md#disposableresults-f) - [EitherFFI](exports.md#eitherffi) - [EitherModule](exports.md#eithermodule) - [ExecutePendingJobsResult](exports.md#executependingjobsresult) @@ -38,6 +40,7 @@ - [JSValueConstPointerPointer](exports.md#jsvalueconstpointerpointer) - [JSValuePointer](exports.md#jsvaluepointer) - [JSValuePointerPointer](exports.md#jsvaluepointerpointer) + - [JSValuePointerPointerPointer](exports.md#jsvaluepointerpointerpointer) - [JSVoidPointer](exports.md#jsvoidpointer) - [OrLoader\](exports.md#orloadert) - [OwnedHeapCharPointer](exports.md#ownedheapcharpointer) @@ -51,6 +54,7 @@ - [QuickJSVariant](exports.md#quickjsvariant) - [StaticJSValue](exports.md#staticjsvalue) - [SuccessOrFail\](exports.md#successorfails-f) + - [UInt32Pointer](exports.md#uint32pointer) - [VmCallResult\](exports.md#vmcallresultvmhandle) - [VmFunctionImplementation\](exports.md#vmfunctionimplementationvmhandle) - [Variables](exports.md#variables) @@ -59,8 +63,11 @@ - [DEBUG\_SYNC](exports.md#debug-sync) - [@jitl/quickjs-wasmfile-debug-sync](exports.md#jitlquickjs-wasmfile-debug-sync) - [DefaultIntrinsics](exports.md#defaultintrinsics) + - [DisposableResult](exports.md#disposableresult) - [EvalFlags](exports.md#evalflags) + - [GetOwnPropertyNamesFlags](exports.md#getownpropertynamesflags) - [IntrinsicsFlags](exports.md#intrinsicsflags) + - [IsEqualOp](exports.md#isequalop) - [JSPromiseStateEnum](exports.md#jspromisestateenum-1) - [RELEASE\_ASYNC](exports.md#release-async) - [@jitl/quickjs-wasmfile-release-asyncify](exports.md#jitlquickjs-wasmfile-release-asyncify) @@ -68,6 +75,7 @@ - [@jitl/quickjs-wasmfile-release-sync](exports.md#jitlquickjs-wasmfile-release-sync) - [Functions](exports.md#functions) - [assertSync()](exports.md#assertsync) + - [createDisposableArray()](exports.md#createdisposablearray) - [getQuickJS()](exports.md#getquickjs) - [getQuickJSSync()](exports.md#getquickjssync) - [isFail()](exports.md#isfail) @@ -80,6 +88,7 @@ - [newQuickJSWASMModule()](exports.md#newquickjswasmmodule) - [newQuickJSWASMModuleFromVariant()](exports.md#newquickjswasmmodulefromvariant) - [newVariant()](exports.md#newvariant) + - [setDebugMode()](exports.md#setdebugmode) - [shouldInterruptAfterDeadline()](exports.md#shouldinterruptafterdeadline) ## Namespaces @@ -88,6 +97,8 @@ ## Classes +- [DisposableFail](classes/DisposableFail.md) +- [DisposableSuccess](classes/DisposableSuccess.md) - [Lifetime](classes/Lifetime.md) - [QuickJSAsyncContext](classes/QuickJSAsyncContext.md) - [QuickJSAsyncRuntime](classes/QuickJSAsyncRuntime.md) @@ -150,7 +161,7 @@ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:313 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L18) *** @@ -163,7 +174,42 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:66 +packages/quickjs-ffi-types/dist/index.d.ts:70 + +*** + +### DisposableArray\ + +> **DisposableArray**\<`T`\>: `T`[] & [`Disposable`](interfaces/Disposable.md) + +An `Array` that also implements [Disposable](interfaces/Disposable.md): + +- Considered [Disposable#alive](interfaces/Disposable.md#alive) if any of its elements are `alive`. +- When [Disposable#dispose](interfaces/Disposable.md#dispose-1)d, it will dispose of all its elements that are `alive`. + +#### Type parameters + +• **T** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L329) + +*** + +### DisposableResult\ + +> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -173,7 +219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:66 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:496 +packages/quickjs-ffi-types/dist/index.d.ts:538 *** @@ -183,13 +229,13 @@ packages/quickjs-ffi-types/dist/index.d.ts:496 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:304 +packages/quickjs-ffi-types/dist/index.d.ts:332 *** ### ExecutePendingJobsResult -> **ExecutePendingJobsResult**: [`SuccessOrFail`](exports.md#successorfails-f)\<`number`, [`QuickJSHandle`](exports.md#quickjshandle) & `Object`\> +> **ExecutePendingJobsResult**: [`DisposableResult`](exports.md#disposableresult)\<`number`, [`QuickJSHandle`](exports.md#quickjshandle) & `Object`\> Used as an optional for the results of executing pendingJobs. On success, `value` contains the number of async jobs executed @@ -199,7 +245,7 @@ by the runtime. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:122 +[packages/quickjs-emscripten-core/src/runtime.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L35) *** @@ -224,7 +270,7 @@ Determines if a VM's execution should be interrupted. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:115 +[packages/quickjs-emscripten-core/src/runtime.ts:27](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L27) *** @@ -306,7 +352,7 @@ Language features that can be enabled or disabled in a QuickJSContext. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:443 +[packages/quickjs-emscripten-core/src/types.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L146) *** @@ -319,7 +365,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:76 +packages/quickjs-ffi-types/dist/index.d.ts:80 *** @@ -365,7 +411,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:28 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:394 +[packages/quickjs-emscripten-core/src/types.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L69) *** @@ -375,7 +421,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:394 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:395 +[packages/quickjs-emscripten-core/src/types.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L70) *** @@ -385,7 +431,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:395 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:393 +[packages/quickjs-emscripten-core/src/types.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L68) *** @@ -395,7 +441,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:393 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:405 +[packages/quickjs-emscripten-core/src/types.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L87) *** @@ -405,7 +451,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:405 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:406 +[packages/quickjs-emscripten-core/src/types.ts:88](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L88) *** @@ -415,7 +461,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:406 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:404 +[packages/quickjs-emscripten-core/src/types.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L86) *** @@ -428,7 +474,7 @@ You can unwrap a JSPromiseState with [QuickJSContext#unwrapResult](classes/Quick #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:673 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:11](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L11) *** @@ -440,7 +486,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +packages/quickjs-ffi-types/dist/index.d.ts:145 *** @@ -476,7 +522,7 @@ You can do so from Javascript by calling the .dispose() method. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:384 +[packages/quickjs-emscripten-core/src/types.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L43) *** @@ -495,7 +541,7 @@ quickjs-emscripten takes care of disposing JSValueConst references. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:368 +[packages/quickjs-emscripten-core/src/types.ts:26](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L26) *** @@ -520,7 +566,7 @@ Used internally for Javascript-to-C function calls. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:46 +packages/quickjs-ffi-types/dist/index.d.ts:50 *** @@ -549,6 +595,18 @@ packages/quickjs-ffi-types/dist/index.d.ts:42 *** +### JSValuePointerPointerPointer + +> **JSValuePointerPointerPointer**: `Pointer`\<`"*JSValue[]"`\> + +Used internally for Javascript-to-C function calls. + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:46 + +*** + ### JSVoidPointer > **JSVoidPointer**: `Pointer`\<`any`\> @@ -557,7 +615,7 @@ Opaque pointer that was allocated by js_malloc. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:80 +packages/quickjs-ffi-types/dist/index.d.ts:84 *** @@ -571,7 +629,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:80 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1532 +[packages/quickjs-emscripten-core/src/from-variant.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L117) *** @@ -584,7 +642,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:71 +packages/quickjs-ffi-types/dist/index.d.ts:75 *** @@ -610,7 +668,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:71 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:531 +[packages/quickjs-emscripten-core/src/types.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L333) *** @@ -624,7 +682,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:531 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1473 +[packages/quickjs-emscripten-core/src/from-variant.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L17) *** @@ -636,7 +694,7 @@ Used internally for C-to-Javascript function calls. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:53 +packages/quickjs-ffi-types/dist/index.d.ts:57 *** @@ -648,7 +706,7 @@ Used internally for C-to-Javascript interrupt handlers. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:57 +packages/quickjs-ffi-types/dist/index.d.ts:61 *** @@ -660,7 +718,7 @@ Used internally for C-to-Javascript module loading. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:61 +packages/quickjs-ffi-types/dist/index.d.ts:65 *** @@ -676,7 +734,7 @@ You must dispose of any handles you create by calling the `.dispose()` method. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:392 +[packages/quickjs-emscripten-core/src/types.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L53) *** @@ -689,7 +747,7 @@ Property key for getting or setting a property on a handle with #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:779 +[packages/quickjs-emscripten-core/src/context.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L69) *** @@ -699,7 +757,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:779 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:495 +packages/quickjs-ffi-types/dist/index.d.ts:537 *** @@ -712,7 +770,7 @@ be disposed. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:357 +[packages/quickjs-emscripten-core/src/types.ts:14](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L14) *** @@ -731,7 +789,17 @@ Used as an optional. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:17 +[packages/quickjs-emscripten-core/src/vm-interface.ts:5](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L5) + +*** + +### UInt32Pointer + +> **UInt32Pointer**: `Pointer`\<`"uint32_t"`\> + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:85 *** @@ -748,7 +816,7 @@ Used as an optional for results of a Vm call. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:33 +[packages/quickjs-emscripten-core/src/vm-interface.ts:26](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L26) *** @@ -783,7 +851,7 @@ It should not retain a reference to its return value or thrown error. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:46 +[packages/quickjs-emscripten-core/src/vm-interface.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L40) ## Variables @@ -847,47 +915,57 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q ##### BaseObjects -> **`readonly`** **BaseObjects**: `true` +> **`readonly`** **BaseObjects**: `true` = `true` ##### Date -> **`readonly`** **Date**: `true` +> **`readonly`** **Date**: `true` = `true` ##### Eval -> **`readonly`** **Eval**: `true` +> **`readonly`** **Eval**: `true` = `true` ##### JSON -> **`readonly`** **JSON**: `true` +> **`readonly`** **JSON**: `true` = `true` ##### MapSet -> **`readonly`** **MapSet**: `true` +> **`readonly`** **MapSet**: `true` = `true` ##### Promise -> **`readonly`** **Promise**: `true` +> **`readonly`** **Promise**: `true` = `true` ##### Proxy -> **`readonly`** **Proxy**: `true` +> **`readonly`** **Proxy**: `true` = `true` ##### RegExp -> **`readonly`** **RegExp**: `true` +> **`readonly`** **RegExp**: `true` = `true` ##### StringNormalize -> **`readonly`** **StringNormalize**: `true` +> **`readonly`** **StringNormalize**: `true` = `true` ##### TypedArrays -> **`readonly`** **TypedArrays**: `true` +> **`readonly`** **TypedArrays**: `true` = `true` + +#### Source + +[packages/quickjs-emscripten-core/src/types.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L173) + +*** + +### DisposableResult + +> **DisposableResult**: *typeof* `AbstractDisposableResult` #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:465 +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -955,7 +1033,49 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:89 +packages/quickjs-ffi-types/dist/index.d.ts:94 + +*** + +### GetOwnPropertyNamesFlags + +> **GetOwnPropertyNamesFlags**: `Object` + +Bitfield options for QTS_GetOwnPropertyNames + +#### Type declaration + +##### JS\_GPN\_ENUM\_ONLY + +> **JS\_GPN\_ENUM\_ONLY**: `number` + +##### JS\_GPN\_PRIVATE\_MASK + +> **JS\_GPN\_PRIVATE\_MASK**: `number` + +##### JS\_GPN\_SET\_ENUM + +> **JS\_GPN\_SET\_ENUM**: `number` + +##### JS\_GPN\_STRING\_MASK + +> **JS\_GPN\_STRING\_MASK**: `number` + +##### JS\_GPN\_SYMBOL\_MASK + +> **JS\_GPN\_SYMBOL\_MASK**: `number` + +##### QTS\_GPN\_NUMBER\_MASK + +> **QTS\_GPN\_NUMBER\_MASK**: `number` + +##### QTS\_STANDARD\_COMPLIANT\_NUMBER + +> **QTS\_STANDARD\_COMPLIANT\_NUMBER**: `number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:154 *** @@ -963,7 +1083,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:89 > **IntrinsicsFlags**: `Object` -Bitfield options for QTS_NewContext intrinsices +Bitfield options for QTS_NewContext intrinsics #### Type declaration @@ -1033,7 +1153,31 @@ Bitfield options for QTS_NewContext intrinsices #### Source -packages/quickjs-ffi-types/dist/index.d.ts:117 +packages/quickjs-ffi-types/dist/index.d.ts:122 + +*** + +### IsEqualOp + +> **IsEqualOp**: `Object` + +#### Type declaration + +##### IsSameValue + +> **IsSameValue**: [`IsEqualOp`](exports.md#isequalop) + +##### IsSameValueZero + +> **IsSameValueZero**: [`IsEqualOp`](exports.md#isequalop) + +##### IsStrictlyEqual + +> **IsStrictlyEqual**: [`IsEqualOp`](exports.md#isequalop) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:168 *** @@ -1057,7 +1201,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:117 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +packages/quickjs-ffi-types/dist/index.d.ts:145 *** @@ -1136,7 +1280,31 @@ packages/variant-quickjs-wasmfile-release-sync/dist/index.d.ts:18 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:85 +packages/quickjs-ffi-types/dist/index.d.ts:90 + +*** + +### createDisposableArray() + +> **createDisposableArray**\<`T`\>(`items`?): [`DisposableArray`](exports.md#disposablearrayt)\<`T`\> + +Create an array that also implements [Disposable](interfaces/Disposable.md). + +#### Type parameters + +• **T** extends [`Disposable`](interfaces/Disposable.md) + +#### Parameters + +• **items?**: `Iterable`\<`T`\> + +#### Returns + +[`DisposableArray`](exports.md#disposablearrayt)\<`T`\> + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:334](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L334) *** @@ -1209,7 +1377,7 @@ If called before `getQuickJS` resolves. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:26 +[packages/quickjs-emscripten-core/src/vm-interface.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L18) *** @@ -1233,7 +1401,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:26 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:23 +[packages/quickjs-emscripten-core/src/vm-interface.ts:14](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L14) *** @@ -1265,7 +1433,7 @@ const getDebugModule = memoizePromiseFactory(() => newQuickJSWASMModule(DEBUG_SY #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1531 +[packages/quickjs-emscripten-core/src/from-variant.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L100) *** @@ -1394,7 +1562,7 @@ const quickjs = new newQuickJSAsyncWASMModuleFromVariant( #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1520 +[packages/quickjs-emscripten-core/src/from-variant.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L76) *** @@ -1456,7 +1624,7 @@ const quickjs = new newQuickJSWASMModuleFromVariant( #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1495 +[packages/quickjs-emscripten-core/src/from-variant.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L38) *** @@ -1483,7 +1651,30 @@ This may be necessary in Cloudflare Workers, which can't compile WebAssembly mod #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1575 +[packages/quickjs-emscripten-core/src/from-variant.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L162) + +*** + +### setDebugMode() + +> **setDebugMode**(`enabled`): `void` + +Enable (or disable) debug logging and object creation tracking globally. +This setting is inherited by newly created QuickJSRuntime instances. +To get debug logging in the WebAssembly module, you need to use a debug build variant. +See [the quickjs-emscripten-core README](https://github.com/justjake/quickjs-emscripten/tree/main/doc/quickjs-emscripten-core) for more about build variants. + +#### Parameters + +• **enabled**: `boolean`= `true` + +#### Returns + +`void` + +#### Source + +[packages/quickjs-emscripten-core/src/debug.ts:13](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/debug.ts#L13) *** @@ -1506,7 +1697,7 @@ Interrupt execution if it's still running after this time. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1583 +[packages/quickjs-emscripten-core/src/interrupt-helpers.ts:9](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/interrupt-helpers.ts#L9) *** diff --git a/doc/quickjs-emscripten/interfaces/AsyncRuntimeOptions.md b/doc/quickjs-emscripten/interfaces/AsyncRuntimeOptions.md index 157b25e4..b070271a 100644 --- a/doc/quickjs-emscripten/interfaces/AsyncRuntimeOptions.md +++ b/doc/quickjs-emscripten/interfaces/AsyncRuntimeOptions.md @@ -35,7 +35,7 @@ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:420 +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -49,7 +49,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:420 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:415 +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -63,7 +63,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:415 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:416 +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -77,7 +77,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:416 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:417 +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -87,7 +87,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:417 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:437 +[packages/quickjs-emscripten-core/src/types.ts:137](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L137) *** @@ -101,7 +101,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:437 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:418 +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -115,7 +115,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:418 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:419 +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -129,7 +129,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:419 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:421 +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md b/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md index 1d027788..af30ce71 100644 --- a/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md +++ b/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md @@ -25,7 +25,7 @@ don't include the stack frames before this eval in the Error() backtraces #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:529 +[packages/quickjs-emscripten-core/src/types.ts:263](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L263) *** @@ -39,7 +39,7 @@ with JS_EvalFunction(). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:527 +[packages/quickjs-emscripten-core/src/types.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L261) *** @@ -51,7 +51,7 @@ Force "strict" mode #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:519 +[packages/quickjs-emscripten-core/src/types.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L253) *** @@ -63,7 +63,7 @@ Force "strip" mode #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:521 +[packages/quickjs-emscripten-core/src/types.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L255) *** @@ -78,7 +78,7 @@ Global code (default), or "module" code? #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:517 +[packages/quickjs-emscripten-core/src/types.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L251) *** diff --git a/doc/quickjs-emscripten/interfaces/ContextOptions.md b/doc/quickjs-emscripten/interfaces/ContextOptions.md index 2f28a6cd..6b005b9f 100644 --- a/doc/quickjs-emscripten/interfaces/ContextOptions.md +++ b/doc/quickjs-emscripten/interfaces/ContextOptions.md @@ -37,7 +37,7 @@ const contextWithoutDateOrEval = runtime.newContext({ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:498 +[packages/quickjs-emscripten-core/src/types.ts:229](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L229) *** diff --git a/doc/quickjs-emscripten/interfaces/CustomizeVariantOptions.md b/doc/quickjs-emscripten/interfaces/CustomizeVariantOptions.md index 499b4557..4a6e775a 100644 --- a/doc/quickjs-emscripten/interfaces/CustomizeVariantOptions.md +++ b/doc/quickjs-emscripten/interfaces/CustomizeVariantOptions.md @@ -29,7 +29,7 @@ The enumerable properties of this object will be passed verbatim, although they #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1567 +[packages/quickjs-emscripten-core/src/from-variant.ts:153](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L153) *** @@ -69,7 +69,7 @@ Often `''` (empty string) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1565 +[packages/quickjs-emscripten-core/src/from-variant.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L151) *** @@ -101,7 +101,7 @@ Debug logger #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1569 +[packages/quickjs-emscripten-core/src/from-variant.ts:155](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L155) *** @@ -113,7 +113,7 @@ If given, Emscripten will compile the WebAssembly.Module from these bytes. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1537 +[packages/quickjs-emscripten-core/src/from-variant.ts:123](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L123) *** @@ -125,7 +125,7 @@ If given, Emscripten will try to load the WebAssembly module data from this loca #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1535 +[packages/quickjs-emscripten-core/src/from-variant.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L121) *** @@ -137,7 +137,7 @@ If given, use the Memory when instantiating the WebAssembly.Instance. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1541 +[packages/quickjs-emscripten-core/src/from-variant.ts:127](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L127) *** @@ -149,7 +149,7 @@ If given, Emscripten will instantiate the WebAssembly.Instance from this existin #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1539 +[packages/quickjs-emscripten-core/src/from-variant.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L125) *** @@ -161,7 +161,7 @@ If given, we will provide the source map to Emscripten directly. This may only b #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1545 +[packages/quickjs-emscripten-core/src/from-variant.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L131) *** @@ -173,7 +173,7 @@ If given, Emscripten will try to load the source map for the WebAssembly module #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1543 +[packages/quickjs-emscripten-core/src/from-variant.ts:129](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/from-variant.ts#L129) *** diff --git a/doc/quickjs-emscripten/interfaces/Disposable.md b/doc/quickjs-emscripten/interfaces/Disposable.md index 0361307a..fd265106 100644 --- a/doc/quickjs-emscripten/interfaces/Disposable.md +++ b/doc/quickjs-emscripten/interfaces/Disposable.md @@ -26,7 +26,7 @@ Use [Scope](../classes/Scope.md) to manage cleaning up multiple disposables. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:547 +[packages/quickjs-emscripten-core/src/lifetime.ts:23](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L23) ## Methods @@ -42,7 +42,7 @@ A method that is used to release resources held by an object. Called by the sema #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:551 +[packages/quickjs-emscripten-core/src/lifetime.ts:28](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L28) *** @@ -58,7 +58,7 @@ Dispose of the underlying resources used by this object. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:542 +[packages/quickjs-emscripten-core/src/lifetime.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L17) *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModule.md b/doc/quickjs-emscripten/interfaces/EmscriptenModule.md index a9ddff91..3ae98434 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:261 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -59,7 +59,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -79,7 +79,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -89,7 +89,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -99,7 +99,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -109,7 +109,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -119,7 +119,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -129,7 +129,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -149,7 +149,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -165,7 +165,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -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:220 +packages/quickjs-ffi-types/dist/index.d.ts:248 ## Methods @@ -204,7 +204,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -222,7 +222,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -240,7 +240,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -273,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -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:222 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -317,7 +317,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +packages/quickjs-ffi-types/dist/index.d.ts:275 *** @@ -361,7 +361,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +packages/quickjs-ffi-types/dist/index.d.ts:242 *** @@ -385,7 +385,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +packages/quickjs-ffi-types/dist/index.d.ts:252 *** @@ -410,7 +410,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +packages/quickjs-ffi-types/dist/index.d.ts:269 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md index e4c096b7..5a7ed44d 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:306 +packages/quickjs-ffi-types/dist/index.d.ts:334 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md index 51d88849..a13ee856 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:218 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -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:220 +packages/quickjs-ffi-types/dist/index.d.ts:248 ## 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:222 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -109,7 +109,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +packages/quickjs-ffi-types/dist/index.d.ts:242 *** @@ -129,7 +129,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +packages/quickjs-ffi-types/dist/index.d.ts:252 *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleLoader.md b/doc/quickjs-emscripten/interfaces/JSModuleLoader.md index bb8b13a3..080c0be9 100644 --- a/doc/quickjs-emscripten/interfaces/JSModuleLoader.md +++ b/doc/quickjs-emscripten/interfaces/JSModuleLoader.md @@ -22,7 +22,7 @@ Load module (sync) ## Source -packages/quickjs-emscripten-core/dist/index.d.ts:402 +[packages/quickjs-emscripten-core/src/types.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L83) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md index 8475402a..fc9b7b85 100644 --- a/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md +++ b/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md @@ -22,7 +22,7 @@ Load module (async) ## Source -packages/quickjs-emscripten-core/dist/index.d.ts:398 +[packages/quickjs-emscripten-core/src/types.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L76) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md index 943ac8b3..c7b69275 100644 --- a/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md +++ b/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md @@ -26,7 +26,7 @@ ## Source -packages/quickjs-emscripten-core/dist/index.d.ts:411 +[packages/quickjs-emscripten-core/src/types.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L100) > **JSModuleNormalizer**(`baseModuleName`, `requestedName`, `vm`): [`JSModuleNormalizeResult`](../exports.md#jsmodulenormalizeresult) \| `Promise`\<[`JSModuleNormalizeResult`](../exports.md#jsmodulenormalizeresult)\> @@ -44,7 +44,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:411 ## Source -packages/quickjs-emscripten-core/dist/index.d.ts:408 +[packages/quickjs-emscripten-core/src/types.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L93) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md index 5e47325b..6a9d505b 100644 --- a/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md +++ b/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md @@ -26,7 +26,7 @@ ## Source -packages/quickjs-emscripten-core/dist/index.d.ts:408 +[packages/quickjs-emscripten-core/src/types.ts:93](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L93) *** diff --git a/doc/quickjs-emscripten/interfaces/JSPromiseStateFulfilled.md b/doc/quickjs-emscripten/interfaces/JSPromiseStateFulfilled.md index 7fa0fa7e..e05aeeb5 100644 --- a/doc/quickjs-emscripten/interfaces/JSPromiseStateFulfilled.md +++ b/doc/quickjs-emscripten/interfaces/JSPromiseStateFulfilled.md @@ -25,7 +25,7 @@ See [JSPromiseState](../exports.md#jspromisestate). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:693 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:36](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L36) *** @@ -37,7 +37,7 @@ Trying to get the promise state of a non-Promise value returns a fulfilled state #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:695 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L38) *** @@ -47,7 +47,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:695 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:691 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:34](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L34) *** @@ -57,7 +57,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:691 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:692 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:35](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L35) *** diff --git a/doc/quickjs-emscripten/interfaces/JSPromiseStatePending.md b/doc/quickjs-emscripten/interfaces/JSPromiseStatePending.md index 5308da4c..b0cfb9b1 100644 --- a/doc/quickjs-emscripten/interfaces/JSPromiseStatePending.md +++ b/doc/quickjs-emscripten/interfaces/JSPromiseStatePending.md @@ -24,7 +24,7 @@ See [JSPromiseState](../exports.md#jspromisestate). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:679 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L21) ## Accessors @@ -33,7 +33,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:679 > **`get`** **error**(): `Error` The error property here allows unwrapping a JSPromiseState with [QuickJSContext#unwrapResult](../classes/QuickJSContext.md#unwrapresult). -Unwrapping a pending promise will throw a [QuickJSPromisePending]([object Object]) error. +Unwrapping a pending promise will throw a QuickJSPromisePending error. #### Returns @@ -41,7 +41,7 @@ Unwrapping a pending promise will throw a [QuickJSPromisePending]([object Object #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:684 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:26](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L26) *** diff --git a/doc/quickjs-emscripten/interfaces/JSPromiseStateRejected.md b/doc/quickjs-emscripten/interfaces/JSPromiseStateRejected.md index 3baf2a93..50d6b6d9 100644 --- a/doc/quickjs-emscripten/interfaces/JSPromiseStateRejected.md +++ b/doc/quickjs-emscripten/interfaces/JSPromiseStateRejected.md @@ -23,7 +23,7 @@ See [JSPromiseState](../exports.md#jspromisestate). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:703 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L47) *** @@ -33,7 +33,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:703 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:702 +[packages/quickjs-emscripten-core/src/deferred-promise.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/deferred-promise.ts#L46) *** diff --git a/doc/quickjs-emscripten/interfaces/LowLevelJavascriptVm.md b/doc/quickjs-emscripten/interfaces/LowLevelJavascriptVm.md index e88f21e9..030a430e 100644 --- a/doc/quickjs-emscripten/interfaces/LowLevelJavascriptVm.md +++ b/doc/quickjs-emscripten/interfaces/LowLevelJavascriptVm.md @@ -45,7 +45,7 @@ From https://www.figma.com/blog/how-we-built-the-figma-plugin-system/ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:56 +[packages/quickjs-emscripten-core/src/vm-interface.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L54) *** @@ -55,7 +55,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:56 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:57 +[packages/quickjs-emscripten-core/src/vm-interface.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L55) ## Methods @@ -77,7 +77,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:57 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:68 +[packages/quickjs-emscripten-core/src/vm-interface.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L76) *** @@ -99,7 +99,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:68 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:67 +[packages/quickjs-emscripten-core/src/vm-interface.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L70) *** @@ -119,7 +119,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:67 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:69 +[packages/quickjs-emscripten-core/src/vm-interface.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L77) *** @@ -137,7 +137,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:69 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:59 +[packages/quickjs-emscripten-core/src/vm-interface.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L59) *** @@ -157,7 +157,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:59 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:65 +[packages/quickjs-emscripten-core/src/vm-interface.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L68) *** @@ -175,7 +175,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:65 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:60 +[packages/quickjs-emscripten-core/src/vm-interface.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L60) *** @@ -195,7 +195,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:60 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:64 +[packages/quickjs-emscripten-core/src/vm-interface.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L65) *** @@ -213,7 +213,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:64 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:61 +[packages/quickjs-emscripten-core/src/vm-interface.ts:62](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L62) *** @@ -231,7 +231,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:61 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:63 +[packages/quickjs-emscripten-core/src/vm-interface.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L64) *** @@ -249,7 +249,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:63 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:62 +[packages/quickjs-emscripten-core/src/vm-interface.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L63) *** @@ -271,7 +271,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:62 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:66 +[packages/quickjs-emscripten-core/src/vm-interface.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L69) *** @@ -289,7 +289,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:66 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:58 +[packages/quickjs-emscripten-core/src/vm-interface.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L57) *** diff --git a/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md b/doc/quickjs-emscripten/interfaces/ModuleEvalOptions.md index 2a3f285a..ad467e4f 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/dist/index.d.ts:1314 +[packages/quickjs-emscripten-core/src/module.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L82) *** @@ -39,7 +39,7 @@ Memory limit, in bytes, of WebAssembly heap memory used by the QuickJS VM. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1309 +[packages/quickjs-emscripten-core/src/module.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L76) *** @@ -51,7 +51,7 @@ Module loader for any `import` statements or expressions. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1318 +[packages/quickjs-emscripten-core/src/module.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L87) *** @@ -64,7 +64,7 @@ See [shouldInterruptAfterDeadline](../exports.md#shouldinterruptafterdeadline). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1305 +[packages/quickjs-emscripten-core/src/module.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/module.ts#L71) *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md index 1f824a38..3818ee38 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:261 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:259 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:302 +packages/quickjs-ffi-types/dist/index.d.ts:330 *** @@ -219,7 +219,7 @@ Implement this field #### Source -packages/quickjs-ffi-types/dist/index.d.ts:301 +packages/quickjs-ffi-types/dist/index.d.ts:329 *** @@ -235,7 +235,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -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:220 +packages/quickjs-ffi-types/dist/index.d.ts:248 ## Methods @@ -278,7 +278,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -300,7 +300,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -322,7 +322,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -359,7 +359,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -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:222 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -407,7 +407,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +packages/quickjs-ffi-types/dist/index.d.ts:275 *** @@ -451,7 +451,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +packages/quickjs-ffi-types/dist/index.d.ts:242 *** @@ -475,7 +475,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +packages/quickjs-ffi-types/dist/index.d.ts:252 *** @@ -504,7 +504,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +packages/quickjs-ffi-types/dist/index.d.ts:269 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md index cc0236d1..0d45618c 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md @@ -37,18 +37,25 @@ library. - [QTS\_FreeVoidPointer](QuickJSAsyncFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSAsyncFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSAsyncFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSAsyncFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSAsyncFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSAsyncFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSAsyncFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSAsyncFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSAsyncFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSAsyncFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSAsyncFFI.md#qts-getownpropertynames) + - [QTS\_GetOwnPropertyNames\_MaybeAsync](QuickJSAsyncFFI.md#qts-getownpropertynames-maybeasync) - [QTS\_GetProp](QuickJSAsyncFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSAsyncFFI.md#qts-getpropnumber) + - [QTS\_GetPropNumber\_MaybeAsync](QuickJSAsyncFFI.md#qts-getpropnumber-maybeasync) - [QTS\_GetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-getprop-maybeasync) - [QTS\_GetString](QuickJSAsyncFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetSymbolDescriptionOrKey\_MaybeAsync](QuickJSAsyncFFI.md#qts-getsymboldescriptionorkey-maybeasync) - [QTS\_GetTrue](QuickJSAsyncFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSAsyncFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSAsyncFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSAsyncFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSAsyncFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSAsyncFFI.md#qts-newarray) @@ -75,6 +82,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSAsyncFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSAsyncFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSAsyncFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSAsyncFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSAsyncFFI.md#qts-setprop) - [QTS\_SetProp\_MaybeAsync](QuickJSAsyncFFI.md#qts-setprop-maybeasync) - [QTS\_TestStringArg](QuickJSAsyncFFI.md#qts-teststringarg) @@ -97,7 +105,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +packages/quickjs-ffi-types/dist/index.d.ts:424 *** @@ -117,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:390 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:451 +packages/quickjs-ffi-types/dist/index.d.ts:493 *** @@ -131,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:451 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:449 +packages/quickjs-ffi-types/dist/index.d.ts:491 *** @@ -145,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:449 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:448 +packages/quickjs-ffi-types/dist/index.d.ts:490 *** @@ -159,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:448 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:397 +packages/quickjs-ffi-types/dist/index.d.ts:431 *** @@ -185,7 +193,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:397 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:434 +packages/quickjs-ffi-types/dist/index.d.ts:472 *** @@ -211,7 +219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:434 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:435 +packages/quickjs-ffi-types/dist/index.d.ts:473 *** @@ -245,7 +253,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:433 +packages/quickjs-ffi-types/dist/index.d.ts:469 *** @@ -265,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:437 +packages/quickjs-ffi-types/dist/index.d.ts:475 *** @@ -285,7 +293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:438 +packages/quickjs-ffi-types/dist/index.d.ts:476 *** @@ -305,7 +313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:411 +packages/quickjs-ffi-types/dist/index.d.ts:445 *** @@ -333,7 +341,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:411 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:439 +packages/quickjs-ffi-types/dist/index.d.ts:477 *** @@ -361,7 +369,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:439 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:440 +packages/quickjs-ffi-types/dist/index.d.ts:478 *** @@ -383,7 +391,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:440 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:427 +packages/quickjs-ffi-types/dist/index.d.ts:461 *** @@ -405,7 +413,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:427 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:428 +packages/quickjs-ffi-types/dist/index.d.ts:462 *** @@ -425,7 +433,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:428 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:410 +packages/quickjs-ffi-types/dist/index.d.ts:444 *** @@ -443,7 +451,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:410 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:406 +packages/quickjs-ffi-types/dist/index.d.ts:440 *** @@ -461,7 +469,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:438 *** @@ -481,7 +489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:404 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:407 +packages/quickjs-ffi-types/dist/index.d.ts:441 *** @@ -501,7 +509,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:407 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:408 +packages/quickjs-ffi-types/dist/index.d.ts:442 *** @@ -521,7 +529,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:408 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:409 +packages/quickjs-ffi-types/dist/index.d.ts:443 *** @@ -541,7 +549,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:409 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:420 +packages/quickjs-ffi-types/dist/index.d.ts:454 *** @@ -561,7 +569,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:420 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:421 +packages/quickjs-ffi-types/dist/index.d.ts:455 + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:488 *** @@ -575,7 +601,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:421 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:401 +packages/quickjs-ffi-types/dist/index.d.ts:435 *** @@ -595,7 +621,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:401 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:417 +packages/quickjs-ffi-types/dist/index.d.ts:451 *** @@ -613,7 +639,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:417 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:443 +packages/quickjs-ffi-types/dist/index.d.ts:483 + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:481 *** @@ -633,7 +681,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:441 +packages/quickjs-ffi-types/dist/index.d.ts:479 *** @@ -647,7 +695,59 @@ packages/quickjs-ffi-types/dist/index.d.ts:441 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:400 +packages/quickjs-ffi-types/dist/index.d.ts:434 + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:470 + +*** + +### QTS\_GetOwnPropertyNames\_MaybeAsync + +> **QTS\_GetOwnPropertyNames\_MaybeAsync**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:471 *** @@ -669,7 +769,51 @@ packages/quickjs-ffi-types/dist/index.d.ts:400 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:429 +packages/quickjs-ffi-types/dist/index.d.ts:463 + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:465 + +*** + +### QTS\_GetPropNumber\_MaybeAsync + +> **QTS\_GetPropNumber\_MaybeAsync**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) \| `Promise`\<[`JSValuePointer`](../exports.md#jsvaluepointer)\> + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:466 *** @@ -691,7 +835,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:430 +packages/quickjs-ffi-types/dist/index.d.ts:464 *** @@ -711,7 +855,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:419 +packages/quickjs-ffi-types/dist/index.d.ts:453 *** @@ -731,7 +875,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:419 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:423 +packages/quickjs-ffi-types/dist/index.d.ts:457 *** @@ -751,7 +895,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:423 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:424 +packages/quickjs-ffi-types/dist/index.d.ts:458 *** @@ -765,7 +909,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:424 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:402 +packages/quickjs-ffi-types/dist/index.d.ts:436 *** @@ -779,7 +923,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:402 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:399 +packages/quickjs-ffi-types/dist/index.d.ts:433 + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **b**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:482 *** @@ -799,7 +967,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:399 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:425 +packages/quickjs-ffi-types/dist/index.d.ts:459 *** @@ -817,7 +985,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:425 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:426 +packages/quickjs-ffi-types/dist/index.d.ts:460 *** @@ -835,7 +1003,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:414 +packages/quickjs-ffi-types/dist/index.d.ts:448 *** @@ -857,7 +1025,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:414 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:415 +packages/quickjs-ffi-types/dist/index.d.ts:449 *** @@ -877,7 +1045,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:415 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:405 +packages/quickjs-ffi-types/dist/index.d.ts:439 *** @@ -895,7 +1063,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:405 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:392 +packages/quickjs-ffi-types/dist/index.d.ts:426 *** @@ -915,7 +1083,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:392 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:416 +packages/quickjs-ffi-types/dist/index.d.ts:450 *** @@ -937,7 +1105,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:416 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:450 +packages/quickjs-ffi-types/dist/index.d.ts:492 *** @@ -955,7 +1123,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:450 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:412 +packages/quickjs-ffi-types/dist/index.d.ts:446 *** @@ -975,7 +1143,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:412 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:413 +packages/quickjs-ffi-types/dist/index.d.ts:447 *** @@ -995,7 +1163,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:413 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:444 +packages/quickjs-ffi-types/dist/index.d.ts:484 *** @@ -1009,7 +1177,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:444 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:403 +packages/quickjs-ffi-types/dist/index.d.ts:437 *** @@ -1029,7 +1197,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:403 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:418 +packages/quickjs-ffi-types/dist/index.d.ts:452 *** @@ -1051,7 +1219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:418 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:422 +packages/quickjs-ffi-types/dist/index.d.ts:456 *** @@ -1071,7 +1239,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:422 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:446 +packages/quickjs-ffi-types/dist/index.d.ts:486 *** @@ -1091,7 +1259,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:445 +packages/quickjs-ffi-types/dist/index.d.ts:485 *** @@ -1105,7 +1273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:445 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:396 +packages/quickjs-ffi-types/dist/index.d.ts:430 *** @@ -1125,7 +1293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:396 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:436 +packages/quickjs-ffi-types/dist/index.d.ts:474 *** @@ -1145,7 +1313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:436 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:394 +packages/quickjs-ffi-types/dist/index.d.ts:428 *** @@ -1163,7 +1331,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:394 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:453 +packages/quickjs-ffi-types/dist/index.d.ts:495 *** @@ -1181,7 +1349,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:453 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:455 +packages/quickjs-ffi-types/dist/index.d.ts:497 *** @@ -1199,7 +1367,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:455 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:395 +packages/quickjs-ffi-types/dist/index.d.ts:429 *** @@ -1217,7 +1385,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:395 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:452 +packages/quickjs-ffi-types/dist/index.d.ts:494 *** @@ -1237,7 +1405,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:452 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:454 +packages/quickjs-ffi-types/dist/index.d.ts:496 *** @@ -1257,7 +1425,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:454 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:398 +packages/quickjs-ffi-types/dist/index.d.ts:432 *** @@ -1277,7 +1445,27 @@ packages/quickjs-ffi-types/dist/index.d.ts:398 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:393 +packages/quickjs-ffi-types/dist/index.d.ts:427 + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:489 *** @@ -1301,7 +1489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:431 +packages/quickjs-ffi-types/dist/index.d.ts:467 *** @@ -1325,7 +1513,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:432 +packages/quickjs-ffi-types/dist/index.d.ts:468 *** @@ -1343,7 +1531,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:432 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:447 +packages/quickjs-ffi-types/dist/index.d.ts:487 *** @@ -1363,7 +1551,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:391 +packages/quickjs-ffi-types/dist/index.d.ts:425 *** @@ -1383,7 +1571,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:391 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:442 +packages/quickjs-ffi-types/dist/index.d.ts:480 *** @@ -1403,7 +1591,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:457 +packages/quickjs-ffi-types/dist/index.d.ts:499 *** @@ -1423,7 +1611,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:456 +packages/quickjs-ffi-types/dist/index.d.ts:498 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md index cab1c0c3..20da3711 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:492 +packages/quickjs-ffi-types/dist/index.d.ts:534 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:492 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:493 +packages/quickjs-ffi-types/dist/index.d.ts:535 *** @@ -60,7 +60,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:533 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md index 165762da..8220ecd3 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:261 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:261 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:252 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:252 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:253 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:253 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:251 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:251 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:257 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:257 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:258 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:258 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:255 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:255 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:256 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:256 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:254 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:254 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:260 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:260 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:259 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:259 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:297 +packages/quickjs-ffi-types/dist/index.d.ts:325 *** @@ -215,7 +215,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:297 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:296 +packages/quickjs-ffi-types/dist/index.d.ts:324 *** @@ -231,7 +231,7 @@ Compile this to WebAssembly.Module #### Source -packages/quickjs-ffi-types/dist/index.d.ts:218 +packages/quickjs-ffi-types/dist/index.d.ts:246 *** @@ -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:220 +packages/quickjs-ffi-types/dist/index.d.ts:248 ## Methods @@ -274,7 +274,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString #### Source -packages/quickjs-ffi-types/dist/index.d.ts:246 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -296,7 +296,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:246 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:249 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -318,7 +318,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:249 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:248 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -355,7 +355,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:248 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:250 +packages/quickjs-ffi-types/dist/index.d.ts:278 *** @@ -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:222 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -403,7 +403,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:222 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:247 +packages/quickjs-ffi-types/dist/index.d.ts:275 *** @@ -447,7 +447,7 @@ Often `''` (empty string) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:214 +packages/quickjs-ffi-types/dist/index.d.ts:242 *** @@ -471,7 +471,7 @@ Called by emscripten as dependencies blocking initialization are added or fulfil #### Source -packages/quickjs-ffi-types/dist/index.d.ts:224 +packages/quickjs-ffi-types/dist/index.d.ts:252 *** @@ -500,7 +500,7 @@ https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:241 +packages/quickjs-ffi-types/dist/index.d.ts:269 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md index 3b2eeaae..0239d3df 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md @@ -33,16 +33,21 @@ library. - [QTS\_FreeVoidPointer](QuickJSFFI.md#qts-freevoidpointer) - [QTS\_GetArrayBuffer](QuickJSFFI.md#qts-getarraybuffer) - [QTS\_GetArrayBufferLength](QuickJSFFI.md#qts-getarraybufferlength) + - [QTS\_GetDebugLogEnabled](QuickJSFFI.md#qts-getdebuglogenabled) - [QTS\_GetFalse](QuickJSFFI.md#qts-getfalse) - [QTS\_GetFloat64](QuickJSFFI.md#qts-getfloat64) - [QTS\_GetGlobalObject](QuickJSFFI.md#qts-getglobalobject) + - [QTS\_GetLength](QuickJSFFI.md#qts-getlength) - [QTS\_GetModuleNamespace](QuickJSFFI.md#qts-getmodulenamespace) - [QTS\_GetNull](QuickJSFFI.md#qts-getnull) + - [QTS\_GetOwnPropertyNames](QuickJSFFI.md#qts-getownpropertynames) - [QTS\_GetProp](QuickJSFFI.md#qts-getprop) + - [QTS\_GetPropNumber](QuickJSFFI.md#qts-getpropnumber) - [QTS\_GetString](QuickJSFFI.md#qts-getstring) - [QTS\_GetSymbolDescriptionOrKey](QuickJSFFI.md#qts-getsymboldescriptionorkey) - [QTS\_GetTrue](QuickJSFFI.md#qts-gettrue) - [QTS\_GetUndefined](QuickJSFFI.md#qts-getundefined) + - [QTS\_IsEqual](QuickJSFFI.md#qts-isequal) - [QTS\_IsGlobalSymbol](QuickJSFFI.md#qts-isglobalsymbol) - [QTS\_IsJobPending](QuickJSFFI.md#qts-isjobpending) - [QTS\_NewArray](QuickJSFFI.md#qts-newarray) @@ -69,6 +74,7 @@ library. - [QTS\_RuntimeEnableModuleLoader](QuickJSFFI.md#qts-runtimeenablemoduleloader) - [QTS\_RuntimeSetMaxStackSize](QuickJSFFI.md#qts-runtimesetmaxstacksize) - [QTS\_RuntimeSetMemoryLimit](QuickJSFFI.md#qts-runtimesetmemorylimit) + - [QTS\_SetDebugLogEnabled](QuickJSFFI.md#qts-setdebuglogenabled) - [QTS\_SetProp](QuickJSFFI.md#qts-setprop) - [QTS\_TestStringArg](QuickJSFFI.md#qts-teststringarg) - [QTS\_Throw](QuickJSFFI.md#qts-throw) @@ -90,7 +96,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:318 +packages/quickjs-ffi-types/dist/index.d.ts:346 *** @@ -110,7 +116,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:318 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:372 +packages/quickjs-ffi-types/dist/index.d.ts:406 *** @@ -124,7 +130,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:372 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:370 +packages/quickjs-ffi-types/dist/index.d.ts:404 *** @@ -138,7 +144,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:370 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:369 +packages/quickjs-ffi-types/dist/index.d.ts:403 *** @@ -152,7 +158,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:369 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:325 +packages/quickjs-ffi-types/dist/index.d.ts:353 *** @@ -178,7 +184,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:325 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:358 +packages/quickjs-ffi-types/dist/index.d.ts:388 *** @@ -212,7 +218,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:358 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:357 +packages/quickjs-ffi-types/dist/index.d.ts:386 *** @@ -232,7 +238,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:357 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:360 +packages/quickjs-ffi-types/dist/index.d.ts:390 *** @@ -252,7 +258,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:360 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:339 +packages/quickjs-ffi-types/dist/index.d.ts:367 *** @@ -280,7 +286,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:339 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:361 +packages/quickjs-ffi-types/dist/index.d.ts:391 *** @@ -302,7 +308,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:361 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:354 +packages/quickjs-ffi-types/dist/index.d.ts:382 *** @@ -322,7 +328,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:354 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:338 +packages/quickjs-ffi-types/dist/index.d.ts:366 *** @@ -340,7 +346,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:338 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:334 +packages/quickjs-ffi-types/dist/index.d.ts:362 *** @@ -358,7 +364,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:334 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:332 +packages/quickjs-ffi-types/dist/index.d.ts:360 *** @@ -378,7 +384,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:332 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:335 +packages/quickjs-ffi-types/dist/index.d.ts:363 *** @@ -398,7 +404,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:335 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:336 +packages/quickjs-ffi-types/dist/index.d.ts:364 *** @@ -418,7 +424,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:336 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:337 +packages/quickjs-ffi-types/dist/index.d.ts:365 *** @@ -438,7 +444,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:337 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:348 +packages/quickjs-ffi-types/dist/index.d.ts:376 *** @@ -458,7 +464,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:348 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:349 +packages/quickjs-ffi-types/dist/index.d.ts:377 + +*** + +### QTS\_GetDebugLogEnabled + +> **QTS\_GetDebugLogEnabled**: (`rt`) => `number` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:401 *** @@ -472,7 +496,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:349 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:329 +packages/quickjs-ffi-types/dist/index.d.ts:357 *** @@ -492,7 +516,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:329 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:345 +packages/quickjs-ffi-types/dist/index.d.ts:373 *** @@ -510,7 +534,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:345 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:364 +packages/quickjs-ffi-types/dist/index.d.ts:396 + +*** + +### QTS\_GetLength + +> **QTS\_GetLength**: (`ctx`, `out_len`, `value`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **value**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:394 *** @@ -530,7 +576,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:364 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:362 +packages/quickjs-ffi-types/dist/index.d.ts:392 *** @@ -544,7 +590,33 @@ packages/quickjs-ffi-types/dist/index.d.ts:362 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:328 +packages/quickjs-ffi-types/dist/index.d.ts:356 + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) + +• **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) + +• **obj**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **flags**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:387 *** @@ -566,7 +638,29 @@ packages/quickjs-ffi-types/dist/index.d.ts:328 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:355 +packages/quickjs-ffi-types/dist/index.d.ts:383 + +*** + +### QTS\_GetPropNumber + +> **QTS\_GetPropNumber**: (`ctx`, `this_val`, `prop_name`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **this\_val**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **prop\_name**: `number` + +#### Returns + +[`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:384 *** @@ -586,7 +680,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:355 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:347 +packages/quickjs-ffi-types/dist/index.d.ts:375 *** @@ -606,7 +700,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:347 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:351 +packages/quickjs-ffi-types/dist/index.d.ts:379 *** @@ -620,7 +714,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:351 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:330 +packages/quickjs-ffi-types/dist/index.d.ts:358 *** @@ -634,7 +728,31 @@ packages/quickjs-ffi-types/dist/index.d.ts:330 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:327 +packages/quickjs-ffi-types/dist/index.d.ts:355 + +*** + +### QTS\_IsEqual + +> **QTS\_IsEqual**: (`ctx`, `a`, `b`, `op`) => `number` + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **a**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **b**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) + +• **op**: [`IsEqualOp`](../exports.md#isequalop) + +#### Returns + +`number` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:395 *** @@ -654,7 +772,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:327 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:352 +packages/quickjs-ffi-types/dist/index.d.ts:380 *** @@ -672,7 +790,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:352 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:353 +packages/quickjs-ffi-types/dist/index.d.ts:381 *** @@ -690,7 +808,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:353 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:342 +packages/quickjs-ffi-types/dist/index.d.ts:370 *** @@ -712,7 +830,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:342 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:343 +packages/quickjs-ffi-types/dist/index.d.ts:371 *** @@ -732,7 +850,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:343 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:333 +packages/quickjs-ffi-types/dist/index.d.ts:361 *** @@ -750,7 +868,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:333 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:320 +packages/quickjs-ffi-types/dist/index.d.ts:348 *** @@ -770,7 +888,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:320 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:344 +packages/quickjs-ffi-types/dist/index.d.ts:372 *** @@ -792,7 +910,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:344 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:371 +packages/quickjs-ffi-types/dist/index.d.ts:405 *** @@ -810,7 +928,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:371 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:340 +packages/quickjs-ffi-types/dist/index.d.ts:368 *** @@ -830,7 +948,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:340 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:341 +packages/quickjs-ffi-types/dist/index.d.ts:369 *** @@ -850,7 +968,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:341 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:365 +packages/quickjs-ffi-types/dist/index.d.ts:397 *** @@ -864,7 +982,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:365 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:331 +packages/quickjs-ffi-types/dist/index.d.ts:359 *** @@ -884,7 +1002,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:331 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:346 +packages/quickjs-ffi-types/dist/index.d.ts:374 *** @@ -906,7 +1024,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:346 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:350 +packages/quickjs-ffi-types/dist/index.d.ts:378 *** @@ -926,7 +1044,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:367 +packages/quickjs-ffi-types/dist/index.d.ts:399 *** @@ -946,7 +1064,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:367 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:366 +packages/quickjs-ffi-types/dist/index.d.ts:398 *** @@ -960,7 +1078,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:366 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:324 +packages/quickjs-ffi-types/dist/index.d.ts:352 *** @@ -980,7 +1098,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:324 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:359 +packages/quickjs-ffi-types/dist/index.d.ts:389 *** @@ -1000,7 +1118,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:359 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:322 +packages/quickjs-ffi-types/dist/index.d.ts:350 *** @@ -1018,7 +1136,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:322 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:374 +packages/quickjs-ffi-types/dist/index.d.ts:408 *** @@ -1036,7 +1154,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:374 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:376 +packages/quickjs-ffi-types/dist/index.d.ts:410 *** @@ -1054,7 +1172,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:376 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:323 +packages/quickjs-ffi-types/dist/index.d.ts:351 *** @@ -1072,7 +1190,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:323 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:373 +packages/quickjs-ffi-types/dist/index.d.ts:407 *** @@ -1092,7 +1210,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:373 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:375 +packages/quickjs-ffi-types/dist/index.d.ts:409 *** @@ -1112,7 +1230,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:375 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:326 +packages/quickjs-ffi-types/dist/index.d.ts:354 *** @@ -1132,7 +1250,27 @@ packages/quickjs-ffi-types/dist/index.d.ts:326 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:321 +packages/quickjs-ffi-types/dist/index.d.ts:349 + +*** + +### QTS\_SetDebugLogEnabled + +> **QTS\_SetDebugLogEnabled**: (`rt`, `is_enabled`) => `void` + +#### Parameters + +• **rt**: [`JSRuntimePointer`](../exports.md#jsruntimepointer) + +• **is\_enabled**: `number` + +#### Returns + +`void` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:402 *** @@ -1156,7 +1294,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:321 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:356 +packages/quickjs-ffi-types/dist/index.d.ts:385 *** @@ -1174,7 +1312,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:356 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:368 +packages/quickjs-ffi-types/dist/index.d.ts:400 *** @@ -1194,7 +1332,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:368 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:319 +packages/quickjs-ffi-types/dist/index.d.ts:347 *** @@ -1214,7 +1352,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:319 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:363 +packages/quickjs-ffi-types/dist/index.d.ts:393 *** @@ -1234,7 +1372,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:363 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:378 +packages/quickjs-ffi-types/dist/index.d.ts:412 *** @@ -1254,7 +1392,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:378 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:377 +packages/quickjs-ffi-types/dist/index.d.ts:411 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md index 064b8cc6..5f0cc956 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:478 +packages/quickjs-ffi-types/dist/index.d.ts:520 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:478 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:479 +packages/quickjs-ffi-types/dist/index.d.ts:521 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:479 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:477 +packages/quickjs-ffi-types/dist/index.d.ts:519 *** diff --git a/doc/quickjs-emscripten/interfaces/RuntimeOptions.md b/doc/quickjs-emscripten/interfaces/RuntimeOptions.md index cd69b5a8..91d9af44 100644 --- a/doc/quickjs-emscripten/interfaces/RuntimeOptions.md +++ b/doc/quickjs-emscripten/interfaces/RuntimeOptions.md @@ -35,7 +35,7 @@ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:420 +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -49,7 +49,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:420 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:415 +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -63,7 +63,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:415 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:416 +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -77,7 +77,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:416 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:417 +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -87,7 +87,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:417 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:434 +[packages/quickjs-emscripten-core/src/types.ts:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L133) *** @@ -101,7 +101,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:434 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:418 +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -115,7 +115,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:418 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:419 +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -129,7 +129,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:419 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:421 +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md b/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md index a667f1c0..9b35030b 100644 --- a/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md +++ b/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md @@ -20,8 +20,8 @@ ## Extended By -- [`AsyncRuntimeOptions`](AsyncRuntimeOptions.md) - [`RuntimeOptions`](RuntimeOptions.md) +- [`AsyncRuntimeOptions`](AsyncRuntimeOptions.md) ## Properties @@ -31,7 +31,7 @@ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:420 +[packages/quickjs-emscripten-core/src/types.ts:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** @@ -41,7 +41,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:420 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:415 +[packages/quickjs-emscripten-core/src/types.ts:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -51,7 +51,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:415 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:416 +[packages/quickjs-emscripten-core/src/types.ts:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -61,7 +61,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:416 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:417 +[packages/quickjs-emscripten-core/src/types.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L115) *** @@ -71,7 +71,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:417 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:418 +[packages/quickjs-emscripten-core/src/types.ts:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -81,7 +81,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:418 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:419 +[packages/quickjs-emscripten-core/src/types.ts:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -91,7 +91,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:419 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:421 +[packages/quickjs-emscripten-core/src/types.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L120) *** diff --git a/doc/quickjs-emscripten/interfaces/SourceMapData.md b/doc/quickjs-emscripten/interfaces/SourceMapData.md index 4e54783c..f4318f17 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:177 +packages/quickjs-ffi-types/dist/index.d.ts:205 *** @@ -32,7 +32,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:177 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:176 +packages/quickjs-ffi-types/dist/index.d.ts:204 *** @@ -42,7 +42,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:176 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:175 +packages/quickjs-ffi-types/dist/index.d.ts:203 *** @@ -52,7 +52,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:175 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:174 +packages/quickjs-ffi-types/dist/index.d.ts:202 *** diff --git a/doc/quickjs-emscripten/interfaces/VmPropertyDescriptor.md b/doc/quickjs-emscripten/interfaces/VmPropertyDescriptor.md index 18ee43a6..3dbf98d6 100644 --- a/doc/quickjs-emscripten/interfaces/VmPropertyDescriptor.md +++ b/doc/quickjs-emscripten/interfaces/VmPropertyDescriptor.md @@ -30,7 +30,7 @@ From https://www.figma.com/blog/how-we-built-the-figma-plugin-system/ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:76 +[packages/quickjs-emscripten-core/src/vm-interface.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L85) *** @@ -40,7 +40,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:76 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:77 +[packages/quickjs-emscripten-core/src/vm-interface.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L86) *** @@ -58,7 +58,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:77 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:78 +[packages/quickjs-emscripten-core/src/vm-interface.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L87) *** @@ -78,7 +78,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:78 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:79 +[packages/quickjs-emscripten-core/src/vm-interface.ts:88](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L88) *** @@ -88,7 +88,7 @@ packages/quickjs-emscripten-core/dist/index.d.ts:79 #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:75 +[packages/quickjs-emscripten-core/src/vm-interface.ts:84](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/vm-interface.ts#L84) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/README.md b/doc/quickjs-emscripten/namespaces/errors/README.md index f1515484..9b6039da 100644 --- a/doc/quickjs-emscripten/namespaces/errors/README.md +++ b/doc/quickjs-emscripten/namespaces/errors/README.md @@ -6,230 +6,23 @@ # Namespace: errors -## Contents - -- [Type Aliases](README.md#type-aliases) - - [QuickJSAsyncifyError](README.md#quickjsasyncifyerror) - - [QuickJSAsyncifySuspended](README.md#quickjsasyncifysuspended) - - [QuickJSEmscriptenModuleError](README.md#quickjsemscriptenmoduleerror) - - [QuickJSMemoryLeakDetected](README.md#quickjsmemoryleakdetected) - - [QuickJSNotImplemented](README.md#quickjsnotimplemented) - - [QuickJSPromisePending](README.md#quickjspromisepending) - - [QuickJSUnknownIntrinsic](README.md#quickjsunknownintrinsic) - - [QuickJSUnwrapError](README.md#quickjsunwraperror) - - [QuickJSUseAfterFree](README.md#quickjsuseafterfree) - - [QuickJSWrongOwner](README.md#quickjswrongowner) -- [Variables](README.md#variables) - - [QuickJSAsyncifyError](README.md#quickjsasyncifyerror-1) - - [QuickJSAsyncifySuspended](README.md#quickjsasyncifysuspended-1) - - [QuickJSEmscriptenModuleError](README.md#quickjsemscriptenmoduleerror-1) - - [QuickJSMemoryLeakDetected](README.md#quickjsmemoryleakdetected-1) - - [QuickJSNotImplemented](README.md#quickjsnotimplemented-1) - - [QuickJSPromisePending](README.md#quickjspromisepending-1) - - [QuickJSUnknownIntrinsic](README.md#quickjsunknownintrinsic-1) - - [QuickJSUnwrapError](README.md#quickjsunwraperror-1) - - [QuickJSUseAfterFree](README.md#quickjsuseafterfree-1) - - [QuickJSWrongOwner](README.md#quickjswrongowner-1) - -## Type Aliases - -### QuickJSAsyncifyError - -> **QuickJSAsyncifyError**: `QuickJSAsyncifyError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1622 - -*** - -### QuickJSAsyncifySuspended - -> **QuickJSAsyncifySuspended**: `QuickJSAsyncifySuspended` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1624 - -*** - -### QuickJSEmscriptenModuleError - -> **QuickJSEmscriptenModuleError**: `QuickJSEmscriptenModuleError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1626 - -*** - -### QuickJSMemoryLeakDetected - -> **QuickJSMemoryLeakDetected**: `QuickJSMemoryLeakDetected` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1628 - -*** - -### QuickJSNotImplemented - -> **QuickJSNotImplemented**: `QuickJSNotImplemented` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1630 - -*** - -### QuickJSPromisePending - -> **QuickJSPromisePending**: `QuickJSPromisePending` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1632 - -*** - -### QuickJSUnknownIntrinsic - -> **QuickJSUnknownIntrinsic**: `QuickJSUnknownIntrinsic` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1634 - -*** - -### QuickJSUnwrapError - -> **QuickJSUnwrapError**: `QuickJSUnwrapError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1636 - -*** - -### QuickJSUseAfterFree - -> **QuickJSUseAfterFree**: `QuickJSUseAfterFree` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1638 - -*** - -### QuickJSWrongOwner - -> **QuickJSWrongOwner**: `QuickJSWrongOwner` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1640 - -## Variables - -### QuickJSAsyncifyError - -> **QuickJSAsyncifyError**: *typeof* `QuickJSAsyncifyError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1622 - -*** - -### QuickJSAsyncifySuspended - -> **QuickJSAsyncifySuspended**: *typeof* `QuickJSAsyncifySuspended` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1624 - -*** - -### QuickJSEmscriptenModuleError - -> **QuickJSEmscriptenModuleError**: *typeof* `QuickJSEmscriptenModuleError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1626 - -*** - -### QuickJSMemoryLeakDetected - -> **QuickJSMemoryLeakDetected**: *typeof* `QuickJSMemoryLeakDetected` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1628 - -*** - -### QuickJSNotImplemented - -> **QuickJSNotImplemented**: *typeof* `QuickJSNotImplemented` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1630 - -*** - -### QuickJSPromisePending - -> **QuickJSPromisePending**: *typeof* `QuickJSPromisePending` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1632 - -*** - -### QuickJSUnknownIntrinsic - -> **QuickJSUnknownIntrinsic**: *typeof* `QuickJSUnknownIntrinsic` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1634 - -*** - -### QuickJSUnwrapError - -> **QuickJSUnwrapError**: *typeof* `QuickJSUnwrapError` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1636 - -*** - -### QuickJSUseAfterFree - -> **QuickJSUseAfterFree**: *typeof* `QuickJSUseAfterFree` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1638 - -*** - -### QuickJSWrongOwner - -> **QuickJSWrongOwner**: *typeof* `QuickJSWrongOwner` - -#### Source - -packages/quickjs-emscripten-core/dist/index.d.ts:1640 +Collects the informative errors this library may throw. + +## Index + +### Classes + +- [QuickJSAsyncifyError](classes/QuickJSAsyncifyError.md) +- [QuickJSAsyncifySuspended](classes/QuickJSAsyncifySuspended.md) +- [QuickJSEmptyGetOwnPropertyNames](classes/QuickJSEmptyGetOwnPropertyNames.md) +- [QuickJSEmscriptenModuleError](classes/QuickJSEmscriptenModuleError.md) +- [QuickJSMemoryLeakDetected](classes/QuickJSMemoryLeakDetected.md) +- [QuickJSNotImplemented](classes/QuickJSNotImplemented.md) +- [QuickJSPromisePending](classes/QuickJSPromisePending.md) +- [QuickJSUnknownIntrinsic](classes/QuickJSUnknownIntrinsic.md) +- [QuickJSUnwrapError](classes/QuickJSUnwrapError.md) +- [QuickJSUseAfterFree](classes/QuickJSUseAfterFree.md) +- [QuickJSWrongOwner](classes/QuickJSWrongOwner.md) *** diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md new file mode 100644 index 00000000..16145711 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.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) / QuickJSAsyncifyError + +# Class: QuickJSAsyncifyError + +## Contents + +- [Extends](QuickJSAsyncifyError.md#extends) +- [Constructors](QuickJSAsyncifyError.md#constructors) + - [new QuickJSAsyncifyError(message)](QuickJSAsyncifyError.md#new-quickjsasyncifyerrormessage) +- [Properties](QuickJSAsyncifyError.md#properties) + - [name](QuickJSAsyncifyError.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSAsyncifyError(message) + +> **new QuickJSAsyncifyError**(`message`?): [`QuickJSAsyncifyError`](QuickJSAsyncifyError.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSAsyncifyError`](QuickJSAsyncifyError.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSAsyncifyError"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:29](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L29) + +*** + +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/QuickJSAsyncifySuspended.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md new file mode 100644 index 00000000..fb19558d --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.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) / QuickJSAsyncifySuspended + +# Class: QuickJSAsyncifySuspended + +## Contents + +- [Extends](QuickJSAsyncifySuspended.md#extends) +- [Constructors](QuickJSAsyncifySuspended.md#constructors) + - [new QuickJSAsyncifySuspended(message)](QuickJSAsyncifySuspended.md#new-quickjsasyncifysuspendedmessage) +- [Properties](QuickJSAsyncifySuspended.md#properties) + - [name](QuickJSAsyncifySuspended.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSAsyncifySuspended(message) + +> **new QuickJSAsyncifySuspended**(`message`?): [`QuickJSAsyncifySuspended`](QuickJSAsyncifySuspended.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSAsyncifySuspended`](QuickJSAsyncifySuspended.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSAsyncifySuspended"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:33](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L33) + +*** + +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/QuickJSEmptyGetOwnPropertyNames.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md new file mode 100644 index 00000000..a1d39aba --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.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) / QuickJSEmptyGetOwnPropertyNames + +# Class: QuickJSEmptyGetOwnPropertyNames + +## Contents + +- [Extends](QuickJSEmptyGetOwnPropertyNames.md#extends) +- [Constructors](QuickJSEmptyGetOwnPropertyNames.md#constructors) + - [new QuickJSEmptyGetOwnPropertyNames(message)](QuickJSEmptyGetOwnPropertyNames.md#new-quickjsemptygetownpropertynamesmessage) +- [Properties](QuickJSEmptyGetOwnPropertyNames.md#properties) + - [name](QuickJSEmptyGetOwnPropertyNames.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSEmptyGetOwnPropertyNames(message) + +> **new QuickJSEmptyGetOwnPropertyNames**(`message`?): [`QuickJSEmptyGetOwnPropertyNames`](QuickJSEmptyGetOwnPropertyNames.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSEmptyGetOwnPropertyNames`](QuickJSEmptyGetOwnPropertyNames.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSEmptyGetOwnPropertyNames"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L53) + +*** + +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/QuickJSEmscriptenModuleError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md new file mode 100644 index 00000000..4b72410f --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.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) / QuickJSEmscriptenModuleError + +# Class: QuickJSEmscriptenModuleError + +## Contents + +- [Extends](QuickJSEmscriptenModuleError.md#extends) +- [Constructors](QuickJSEmscriptenModuleError.md#constructors) + - [new QuickJSEmscriptenModuleError(message)](QuickJSEmscriptenModuleError.md#new-quickjsemscriptenmoduleerrormessage) +- [Properties](QuickJSEmscriptenModuleError.md#properties) + - [name](QuickJSEmscriptenModuleError.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSEmscriptenModuleError(message) + +> **new QuickJSEmscriptenModuleError**(`message`?): [`QuickJSEmscriptenModuleError`](QuickJSEmscriptenModuleError.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSEmscriptenModuleError`](QuickJSEmscriptenModuleError.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSEmscriptenModuleError"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L41) + +*** + +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/QuickJSMemoryLeakDetected.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md new file mode 100644 index 00000000..37f52310 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.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) / QuickJSMemoryLeakDetected + +# Class: QuickJSMemoryLeakDetected + +## Contents + +- [Extends](QuickJSMemoryLeakDetected.md#extends) +- [Constructors](QuickJSMemoryLeakDetected.md#constructors) + - [new QuickJSMemoryLeakDetected(message)](QuickJSMemoryLeakDetected.md#new-quickjsmemoryleakdetectedmessage) +- [Properties](QuickJSMemoryLeakDetected.md#properties) + - [name](QuickJSMemoryLeakDetected.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSMemoryLeakDetected(message) + +> **new QuickJSMemoryLeakDetected**(`message`?): [`QuickJSMemoryLeakDetected`](QuickJSMemoryLeakDetected.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSMemoryLeakDetected`](QuickJSMemoryLeakDetected.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSMemoryLeakDetected"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L37) + +*** + +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/QuickJSNotImplemented.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md new file mode 100644 index 00000000..6e079b5c --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.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) / QuickJSNotImplemented + +# Class: QuickJSNotImplemented + +## Contents + +- [Extends](QuickJSNotImplemented.md#extends) +- [Constructors](QuickJSNotImplemented.md#constructors) + - [new QuickJSNotImplemented(message)](QuickJSNotImplemented.md#new-quickjsnotimplementedmessage) +- [Properties](QuickJSNotImplemented.md#properties) + - [name](QuickJSNotImplemented.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSNotImplemented(message) + +> **new QuickJSNotImplemented**(`message`?): [`QuickJSNotImplemented`](QuickJSNotImplemented.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSNotImplemented`](QuickJSNotImplemented.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSNotImplemented"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:25](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L25) + +*** + +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/QuickJSPromisePending.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md new file mode 100644 index 00000000..dac6d304 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.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) / QuickJSPromisePending + +# Class: QuickJSPromisePending + +## Contents + +- [Extends](QuickJSPromisePending.md#extends) +- [Constructors](QuickJSPromisePending.md#constructors) + - [new QuickJSPromisePending(message)](QuickJSPromisePending.md#new-quickjspromisependingmessage) +- [Properties](QuickJSPromisePending.md#properties) + - [name](QuickJSPromisePending.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSPromisePending(message) + +> **new QuickJSPromisePending**(`message`?): [`QuickJSPromisePending`](QuickJSPromisePending.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSPromisePending`](QuickJSPromisePending.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSPromisePending"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L49) + +*** + +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/QuickJSUnknownIntrinsic.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md new file mode 100644 index 00000000..d1f7d950 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md @@ -0,0 +1,80 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten](../../../exports.md) / [errors](../README.md) / QuickJSUnknownIntrinsic + +# Class: QuickJSUnknownIntrinsic + +## Contents + +- [Extends](QuickJSUnknownIntrinsic.md#extends) +- [Constructors](QuickJSUnknownIntrinsic.md#constructors) + - [new QuickJSUnknownIntrinsic(message)](QuickJSUnknownIntrinsic.md#new-quickjsunknownintrinsicmessage) + - [new QuickJSUnknownIntrinsic(message)](QuickJSUnknownIntrinsic.md#new-quickjsunknownintrinsicmessage-1) +- [Properties](QuickJSUnknownIntrinsic.md#properties) + - [name](QuickJSUnknownIntrinsic.md#name) + +## Extends + +- `TypeError` + +## Constructors + +### new QuickJSUnknownIntrinsic(message) + +> **new QuickJSUnknownIntrinsic**(`message`?): [`QuickJSUnknownIntrinsic`](QuickJSUnknownIntrinsic.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSUnknownIntrinsic`](QuickJSUnknownIntrinsic.md) + +#### Inherited from + +`TypeError.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1136 + +### new QuickJSUnknownIntrinsic(message) + +> **new QuickJSUnknownIntrinsic**(`message`?): [`QuickJSUnknownIntrinsic`](QuickJSUnknownIntrinsic.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSUnknownIntrinsic`](QuickJSUnknownIntrinsic.md) + +#### Inherited from + +`TypeError.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSUnknownIntrinsic"` + +#### Overrides + +`TypeError.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L45) + +*** + +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/QuickJSUnwrapError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md new file mode 100644 index 00000000..2b7e83e1 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md @@ -0,0 +1,85 @@ +[quickjs-emscripten](../../../../packages.md) • **quickjs-emscripten** • [Readme](../../../README.md) \| [Exports](../../../exports.md) + +*** + +[quickjs-emscripten](../../../../packages.md) / [quickjs-emscripten](../../../exports.md) / [errors](../README.md) / QuickJSUnwrapError + +# Class: QuickJSUnwrapError + +Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md#unwrapresult) unwraps an error value that isn't an object. + +## Contents + +- [Extends](QuickJSUnwrapError.md#extends) +- [Constructors](QuickJSUnwrapError.md#constructors) + - [new QuickJSUnwrapError(cause, context)](QuickJSUnwrapError.md#new-quickjsunwraperrorcause-context) +- [Properties](QuickJSUnwrapError.md#properties) + - [cause](QuickJSUnwrapError.md#cause) + - [context?](QuickJSUnwrapError.md#context) + - [name](QuickJSUnwrapError.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSUnwrapError(cause, context) + +> **new QuickJSUnwrapError**(`cause`, `context`?): [`QuickJSUnwrapError`](QuickJSUnwrapError.md) + +#### Parameters + +• **cause**: `unknown` + +• **context?**: [`QuickJSContext`](../../../classes/QuickJSContext.md) + +#### Returns + +[`QuickJSUnwrapError`](QuickJSUnwrapError.md) + +#### Overrides + +`Error.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:8](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L8) + +## Properties + +### cause + +> **cause**: `unknown` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:9](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L9) + +*** + +### context? + +> **context**?: [`QuickJSContext`](../../../classes/QuickJSContext.md) + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:10](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L10) + +*** + +### name + +> **name**: `string` = `"QuickJSUnwrapError"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:7](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L7) + +*** + +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/QuickJSUseAfterFree.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md new file mode 100644 index 00000000..e896dbc1 --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.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) / QuickJSUseAfterFree + +# Class: QuickJSUseAfterFree + +## Contents + +- [Extends](QuickJSUseAfterFree.md#extends) +- [Constructors](QuickJSUseAfterFree.md#constructors) + - [new QuickJSUseAfterFree(message)](QuickJSUseAfterFree.md#new-quickjsuseafterfreemessage) +- [Properties](QuickJSUseAfterFree.md#properties) + - [name](QuickJSUseAfterFree.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSUseAfterFree(message) + +> **new QuickJSUseAfterFree**(`message`?): [`QuickJSUseAfterFree`](QuickJSUseAfterFree.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSUseAfterFree`](QuickJSUseAfterFree.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSUseAfterFree"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:21](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L21) + +*** + +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/QuickJSWrongOwner.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md new file mode 100644 index 00000000..6e35723f --- /dev/null +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.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) / QuickJSWrongOwner + +# Class: QuickJSWrongOwner + +## Contents + +- [Extends](QuickJSWrongOwner.md#extends) +- [Constructors](QuickJSWrongOwner.md#constructors) + - [new QuickJSWrongOwner(message)](QuickJSWrongOwner.md#new-quickjswrongownermessage) +- [Properties](QuickJSWrongOwner.md#properties) + - [name](QuickJSWrongOwner.md#name) + +## Extends + +- `Error` + +## Constructors + +### new QuickJSWrongOwner(message) + +> **new QuickJSWrongOwner**(`message`?): [`QuickJSWrongOwner`](QuickJSWrongOwner.md) + +#### Parameters + +• **message?**: `string` + +#### Returns + +[`QuickJSWrongOwner`](QuickJSWrongOwner.md) + +#### Inherited from + +`Error.constructor` + +#### Source + +node\_modules/typescript/lib/lib.es5.d.ts:1081 + +## Properties + +### name + +> **name**: `string` = `"QuickJSWrongOwner"` + +#### Overrides + +`Error.name` + +#### Source + +[packages/quickjs-emscripten-core/src/errors.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/errors.ts#L17) + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/package.json b/package.json index 616b65df..0435c286 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "smoketest-vite": "yarn tarball && ./scripts/smoketest-vite.ts", "check": "yarn build && yarn check:packages && yarn check:format && yarn check:types && yarn test && yarn lint", "test": "yarn for-each-package test", - "test:fast": "TEST_NO_ASYNC=true yarn test", + "test:fast": "TEST_FAST=true TEST_NO_ASYNC=true yarn test", "test:slow": "TEST_LEAK=1 yarn test", "check:types": "yarn for-each-package tsc", "check:format": "prettier --check .", @@ -44,7 +44,7 @@ "all:publish:stable": "yarn run check:packages && yarn for-each-publishable-package npm publish --access public", "all:publish:next": "yarn run check:packages && yarn for-each-publishable-package npm publish --access public --tag next", "all:version": "./scripts/set-version.ts", - "for-each-package-cmd": "yarn workspaces foreach --from 'packages/*' -Rpt", + "for-each-package-cmd": "yarn workspaces foreach --from 'packages/*' -Rpti", "for-each-publishable-package": "yarn for-each-package-cmd --exclude 'packages/internal-*'", "for-each-package": "yarn for-each-package-cmd run" }, @@ -73,7 +73,7 @@ "typedoc-plugin-markdown": "4.0.0-next.38", "typescript": "^5.3.3", "vite-tsconfig-paths": "^4.2.2", - "vitest": "^1.1.0" + "vitest": "2.0.5" }, "packageManager": "yarn@4.0.2" } diff --git a/packages/internal-tsconfig/tsconfig.json b/packages/internal-tsconfig/tsconfig.json index 9e0c23e6..6bc2677d 100644 --- a/packages/internal-tsconfig/tsconfig.json +++ b/packages/internal-tsconfig/tsconfig.json @@ -32,9 +32,11 @@ // "tsBuildInfoFile": "./build/tsbuildinfo", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ + "noEmitOnError": true, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + // "emitDeclarationOnly": true, /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, diff --git a/packages/internal-tsconfig/vite.base.config.mts b/packages/internal-tsconfig/vite.base.config.mts index b1a17da4..01d7a116 100644 --- a/packages/internal-tsconfig/vite.base.config.mts +++ b/packages/internal-tsconfig/vite.base.config.mts @@ -1,4 +1,4 @@ -import { defineConfig } from "vite" +import { defineConfig } from "vitest/config" import tsconfigPaths from "vite-tsconfig-paths" export default defineConfig({ @@ -7,4 +7,9 @@ export default defineConfig({ target: "es2020", }, plugins: [tsconfigPaths()], + test: { + onStackTrace(_error, _frame) { + return true + }, + }, }) diff --git a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts new file mode 100644 index 00000000..adcd8547 --- /dev/null +++ b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts @@ -0,0 +1,147 @@ +import type { QuickJSContextResult, QuickJSContext } from "./context" +import { DisposableResult, Lifetime, UsingDisposable } from "./lifetime" +import type { QuickJSRuntime } from "./runtime" +import type { QuickJSHandle } from "./types" + +/** + * Proxies the iteration protocol from the host to a guest iterator. + * The guest iterator is a QuickJS object with a `next` method. + * See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * + * If calling the `next` method or any other method of the iteration protocol throws an error, + * the iterator is disposed after returning the exception as the final value. + * + * When the iterator is done, the handle is disposed automatically. + * The caller is responsible for disposing each successive value. + * + * ```typescript + * for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) { + * const nextHandle = context.unwrapResult(nextResult) + * try { + * // Do something with nextHandle + * console.log(context.dump(nextHandle)) + * } finally { + * nextHandle.dispose() + * } + * } + * ``` + */ +export class QuickJSIterator + extends UsingDisposable + implements Disposable, IterableIterator> +{ + public owner: QuickJSRuntime + private _next: QuickJSHandle | undefined + private _isDone = false + + constructor( + public handle: QuickJSHandle, + public context: QuickJSContext, + ) { + super() + this.owner = context.runtime + } + + [Symbol.iterator]() { + return this + } + + next(value?: QuickJSHandle): IteratorResult, any> { + if (!this.alive || this._isDone) { + return { + done: true, + value: undefined, + } + } + + const nextMethod = (this._next ??= this.context.getProp(this.handle, "next")) + return this.callIteratorMethod(nextMethod, value) + } + + return(value?: QuickJSHandle): IteratorResult, any> { + if (!this.alive) { + return { + done: true, + value: undefined, + } + } + + const returnMethod = this.context.getProp(this.handle, "return") + if (returnMethod === this.context.undefined && value === undefined) { + // This may be an automatic call by the host Javascript engine, + // but the guest iterator doesn't have a `return` method. + // Don't call it then. + this.dispose() + return { + done: true, + value: undefined, + } + } + + const result = this.callIteratorMethod(returnMethod, value) + returnMethod.dispose() + this.dispose() + return result + } + + throw(e?: any): IteratorResult, any> { + if (!this.alive) { + return { + done: true, + value: undefined, + } + } + + const errorHandle = e instanceof Lifetime ? e : this.context.newError(e) + const throwMethod = this.context.getProp(this.handle, "throw") + const result = this.callIteratorMethod(throwMethod, e) + if (errorHandle.alive) { + errorHandle.dispose() + } + throwMethod.dispose() + this.dispose() + return result + } + + get alive() { + return this.handle.alive + } + + dispose() { + this._isDone = true + this.handle.dispose() + this._next?.dispose() + } + + private callIteratorMethod( + method: QuickJSHandle, + input?: QuickJSHandle, + ): IteratorResult, any> { + const callResult = input + ? this.context.callFunction(method, this.handle, input) + : this.context.callFunction(method, this.handle) + if (callResult.error) { + this.dispose() + return { + value: callResult, + } + } + + const done = this.context.getProp(callResult.value, "done").consume((v) => this.context.dump(v)) + if (done) { + callResult.value.dispose() + this.dispose() + return { + done, + value: undefined, + } + } + + const value = this.context.getProp(callResult.value, "value") + callResult.value.dispose() + return { + value: DisposableResult.success(value), + done: done as false, + } + } +} diff --git a/packages/quickjs-emscripten-core/src/context-asyncify.ts b/packages/quickjs-emscripten-core/src/context-asyncify.ts index ffd41ae9..02db51de 100644 --- a/packages/quickjs-emscripten-core/src/context-asyncify.ts +++ b/packages/quickjs-emscripten-core/src/context-asyncify.ts @@ -6,8 +6,8 @@ import type { JSRuntimePointer, JSValuePointer, } from "@jitl/quickjs-ffi-types" +import type { QuickJSContextResult } from "./context" import { QuickJSContext } from "./context" -import { debugLog } from "./debug" import type { Lifetime } from "./lifetime" import type { QuickJSModuleCallbacks } from "./module" import type { QuickJSAsyncRuntime } from "./runtime-asyncify" @@ -46,7 +46,7 @@ export class QuickJSAsyncContext extends QuickJSContext { filename: string = "eval.js", /** See {@link EvalFlags} for number semantics */ options?: number | ContextEvalOptions, - ): Promise> { + ): Promise> { const detectModule = (options === undefined ? 1 : 0) as EvalDetectModule const flags = evalOptionsToFlags(options) as EvalFlags let resultPtr = 0 as JSValuePointer @@ -64,15 +64,15 @@ export class QuickJSAsyncContext extends QuickJSContext { ), ) } catch (error) { - debugLog("QTS_Eval_MaybeAsync threw", error) + this.runtime.debugLog("QTS_Eval_MaybeAsync threw", error) throw error } const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr) if (errorPtr) { this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr) - return { error: this.memory.heapValueHandle(errorPtr) } + return this.fail(this.memory.heapValueHandle(errorPtr)) } - return { value: this.memory.heapValueHandle(resultPtr) } + return this.success(this.memory.heapValueHandle(resultPtr)) } /** diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 9cc15541..da43fbbd 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -1,4 +1,4 @@ -import { JSPromiseStateEnum } from "@jitl/quickjs-ffi-types" +import { IsEqualOp, JSPromiseStateEnum } from "@jitl/quickjs-ffi-types" import type { EvalFlags, EitherModule, @@ -10,15 +10,31 @@ import type { JSValuePointer, JSValuePointerPointer, EitherFFI, + UInt32Pointer, + JSValuePointerPointerPointer, + JSVoidPointer, } from "@jitl/quickjs-ffi-types" -import { debugLog } from "./debug" import type { JSPromiseState } from "./deferred-promise" import { QuickJSDeferredPromise } from "./deferred-promise" // eslint-disable-next-line @typescript-eslint/no-unused-vars import type { shouldInterruptAfterDeadline } from "./interrupt-helpers" -import { QuickJSPromisePending, QuickJSUnwrapError } from "./errors" -import type { Disposable } from "./lifetime" -import { Lifetime, Scope, StaticLifetime, UsingDisposable, WeakLifetime } from "./lifetime" +import { + QuickJSEmptyGetOwnPropertyNames, + QuickJSNotImplemented, + QuickJSPromisePending, + QuickJSUnwrapError, +} from "./errors" +import type { Disposable, DisposableArray, DisposableFail, DisposableSuccess } from "./lifetime" +import { + DisposableResult, + Lifetime, + Scope, + StaticLifetime, + UsingDisposable, + WeakLifetime, + createDisposableArray, +} from "./lifetime" +import type { HeapTypedArray } from "./memory" import { ModuleMemory } from "./memory" import type { ContextCallbacks, QuickJSModuleCallbacks } from "./module" import type { @@ -26,15 +42,24 @@ import type { // eslint-disable-next-line @typescript-eslint/no-unused-vars ExecutePendingJobsResult, } from "./runtime" -import type { ContextEvalOptions, JSValue, PromiseExecutor, QuickJSHandle } from "./types" -import { evalOptionsToFlags } from "./types" +import type { + ContextEvalOptions, + GetOwnPropertyNamesOptions, + JSValue, + PromiseExecutor, + QuickJSHandle, + StaticJSValue, +} from "./types" +import { evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" import type { LowLevelJavascriptVm, SuccessOrFail, - VmCallResult, VmFunctionImplementation, VmPropertyDescriptor, } from "./vm-interface" +import { QuickJSIterator } from "./QuickJSIterator" + +export type QuickJSContextResult = DisposableResult /** * Property key for getting or setting a property on a handle with @@ -107,6 +132,15 @@ class ContextMemory extends ModuleMemory implements Disposable { heapValueHandle(ptr: JSValuePointer): JSValue { return new Lifetime(ptr, this.copyJSValue, this.freeJSValue, this.owner) } + + /** Manage a heap pointer with the lifetime of the context */ + staticHeapValueHandle(ptr: JSValuePointer | JSValueConstPointer): StaticJSValue { + this.manage(this.heapValueHandle(ptr as JSValuePointer)) + // This isn't technically a static lifetime, but since it has the same + // lifetime as the VM, it's okay to fake one since when the VM is + // disposed, no other functions will accept the value. + return new StaticLifetime(ptr as JSValueConstPointer, this.owner) as StaticJSValue + } } /** @@ -174,6 +208,14 @@ export class QuickJSContext protected _global: QuickJSHandle | undefined = undefined /** @private */ protected _BigInt: QuickJSHandle | undefined = undefined + /** @private */ + protected uint32Out: HeapTypedArray + /** @private */ + protected _Symbol: QuickJSHandle | undefined = undefined + /** @private */ + protected _SymbolIterator: QuickJSHandle | undefined = undefined + /** @private */ + protected _SymbolAsyncIterator: QuickJSHandle | undefined = undefined /** * Use {@link QuickJSRuntime#newContext} or {@link QuickJSWASMModule#newContext} @@ -203,6 +245,9 @@ export class QuickJSContext this.getString = this.getString.bind(this) this.getNumber = this.getNumber.bind(this) this.resolvePromise = this.resolvePromise.bind(this) + this.uint32Out = this.memory.manage( + this.memory.newTypedArray(Uint32Array, 1), + ) } // @implement Disposable ---------------------------------------------------- @@ -290,12 +335,7 @@ export class QuickJSContext const ptr = this.ffi.QTS_GetGlobalObject(this.ctx.value) // Automatically clean up this reference when we dispose - this.memory.manage(this.memory.heapValueHandle(ptr)) - - // This isn't technically a static lifetime, but since it has the same - // lifetime as the VM, it's okay to fake one since when the VM is - // disposed, no other functions will accept the value. - this._global = new StaticLifetime(ptr, this.runtime) + this._global = this.memory.staticHeapValueHandle(ptr) return this._global } @@ -342,6 +382,14 @@ export class QuickJSContext return this.memory.heapValueHandle(ptr) } + /** + * Access a well-known symbol that is a property of the global Symbol object, like `Symbol.iterator`. + */ + getWellKnownSymbol(name: string): QuickJSHandle { + this._Symbol ??= this.memory.manage(this.getProp(this.global, "Symbol")) + return this.getProp(this._Symbol, name) + } + /** * Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) value. */ @@ -703,7 +751,7 @@ export class QuickJSContext * * @param promiseLikeHandle - A handle to a Promise-like value with a `.then(onSuccess, onError)` method. */ - resolvePromise(promiseLikeHandle: QuickJSHandle): Promise> { + resolvePromise(promiseLikeHandle: QuickJSHandle): Promise> { this.runtime.assertOwned(promiseLikeHandle) const vmResolveResult = Scope.withScope((scope) => { const vmPromise = scope.manage(this.getProp(this.global, "Promise")) @@ -714,29 +762,72 @@ export class QuickJSContext return Promise.resolve(vmResolveResult) } - return new Promise>((resolve) => { + return new Promise>((resolve) => { Scope.withScope((scope) => { const resolveHandle = scope.manage( this.newFunction("resolve", (value) => { - resolve({ value: value && value.dup() }) + resolve(this.success(value && value.dup())) }), ) const rejectHandle = scope.manage( this.newFunction("reject", (error) => { - resolve({ error: error && error.dup() }) + resolve(this.fail(error && error.dup())) }), ) const promiseHandle = scope.manage(vmResolveResult.value) const promiseThenHandle = scope.manage(this.getProp(promiseHandle, "then")) - this.unwrapResult( - this.callFunction(promiseThenHandle, promiseHandle, resolveHandle, rejectHandle), - ).dispose() + this.callFunction(promiseThenHandle, promiseHandle, resolveHandle, rejectHandle) + .unwrap() + .dispose() }) }) } + // Compare ----------------------------------------------------------- + + private isEqual( + a: QuickJSHandle, + b: QuickJSHandle, + equalityType: IsEqualOp = IsEqualOp.IsStrictlyEqual, + ): boolean { + if (a === b) { + return true + } + this.runtime.assertOwned(a) + this.runtime.assertOwned(b) + const result = this.ffi.QTS_IsEqual(this.ctx.value, a.value, b.value, equalityType) + if (result === -1) { + throw new QuickJSNotImplemented("WASM variant does not expose equality") + } + return Boolean(result) + } + + /** + * `handle === other` - IsStrictlyEqual. + * See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + */ + eq(handle: QuickJSHandle, other: QuickJSHandle): boolean { + return this.isEqual(handle, other, IsEqualOp.IsStrictlyEqual) + } + + /** + * `Object.is(a, b)` + * See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + */ + sameValue(handle: QuickJSHandle, other: QuickJSHandle): boolean { + return this.isEqual(handle, other, IsEqualOp.IsSameValue) + } + + /** + * SameValueZero comparison. + * See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness). + */ + sameValueZero(handle: QuickJSHandle, other: QuickJSHandle): boolean { + return this.isEqual(handle, other, IsEqualOp.IsSameValueZero) + } + // Properties --------------------------------------------------------------- /** @@ -748,14 +839,138 @@ export class QuickJSContext */ getProp(handle: QuickJSHandle, key: QuickJSPropertyKey): QuickJSHandle { this.runtime.assertOwned(handle) - const ptr = this.borrowPropertyKey(key).consume((quickJSKey) => - this.ffi.QTS_GetProp(this.ctx.value, handle.value, quickJSKey.value), - ) + let ptr: JSValuePointer + if (typeof key === "number" && key >= 0) { + // Index access fast path + ptr = this.ffi.QTS_GetPropNumber(this.ctx.value, handle.value, key) + } else { + ptr = this.borrowPropertyKey(key).consume((quickJSKey) => + this.ffi.QTS_GetProp(this.ctx.value, handle.value, quickJSKey.value), + ) + } const result = this.memory.heapValueHandle(ptr) return result } + /** + * `handle.length` as a host number. + * + * Example use: + * ```typescript + * const length = context.getLength(arrayHandle) ?? 0 + * for (let i = 0; i < length; i++) { + * using value = context.getProp(arrayHandle, i) + * console.log(`array[${i}] =`, context.dump(value)) + * } + * ``` + * + * @returns a number if the handle has a numeric length property, otherwise `undefined`. + */ + getLength(handle: QuickJSHandle): number | undefined { + this.runtime.assertOwned(handle) + const status = this.ffi.QTS_GetLength(this.ctx.value, this.uint32Out.value.ptr, handle.value) + if (status < 0) { + return undefined + } + return this.uint32Out.value.typedArray[0] + } + + /** + * `Object.getOwnPropertyNames(handle)`. + * Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames), + * but with extra, non-standard options for: + * + * - fetching array indexes as numbers (`numbers: true`) + * - including symbols (`symbols: true`) + * - only iterating over enumerable properties (`onlyEnumerable: true`) + * + * The default behavior is to emulate the standard: + * ```typescript + * context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) + * ``` + * + * Note when passing an explicit options object, you must set at least one + * option, and `strings` are not included unless specified. + * + * Example use: + * ```typescript + * for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { + * using value = context.getProp(handle, prop) + * console.log(context.dump(prop), '->', context.dump(value)) + * } + * ``` + * + * @returns an an array of handles of the property names. The array itself is disposable for your convenience. + * @throws QuickJSEmptyGetOwnPropertyNames if no options are set. + */ + getOwnPropertyNames( + handle: QuickJSHandle, + options: GetOwnPropertyNamesOptions = { + strings: true, + numbersAsStrings: true, + }, + ): QuickJSContextResult> { + this.runtime.assertOwned(handle) + handle.value // assert alive + const flags = getOwnPropertyNamesOptionsToFlags(options) + if (flags === 0) { + throw new QuickJSEmptyGetOwnPropertyNames("No options set, will return an empty array") + } + return Scope.withScope((scope) => { + const outPtr = scope.manage( + this.memory.newMutablePointerArray(1), + ) + const errorPtr = this.ffi.QTS_GetOwnPropertyNames( + this.ctx.value, + outPtr.value.ptr, + this.uint32Out.value.ptr, + handle.value, + flags, + ) + if (errorPtr) { + return this.fail(this.memory.heapValueHandle(errorPtr)) + } + const len = this.uint32Out.value.typedArray[0] + const ptr = outPtr.value.typedArray[0] + const pointerArray = new Uint32Array(this.module.HEAP8.buffer, ptr, len) + const handles = Array.from(pointerArray).map((ptr) => + this.memory.heapValueHandle(ptr as JSValuePointer), + ) + this.ffi.QTS_FreeVoidPointer(this.ctx.value, ptr as JSVoidPointer) + return this.success(createDisposableArray(handles)) + }) + } + + /** + * `handle[Symbol.iterator]()`. See {@link QuickJSIterator}. + * Returns a host iterator that wraps and proxies calls to a guest iterator handle. + * Each step of the iteration returns a result, either an error or a handle to the next value. + * Once the iterator is done, the handle is automatically disposed, and the iterator + * is considered done if the handle is disposed. + * + * ```typescript + * for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { + * using keyHandle = context.getProp(entriesHandle, 0) + * using valueHandle = context.getProp(entriesHandle, 1) + * console.log(context.dump(keyHandle), '->', context.dump(valueHandle)) + * } + * ``` + */ + getIterator(iterableHandle: QuickJSHandle): QuickJSContextResult { + const SymbolIterator = (this._SymbolIterator ??= this.memory.manage( + this.getWellKnownSymbol("iterator"), + )) + return Scope.withScope((scope) => { + const methodHandle = scope.manage(this.getProp(iterableHandle, SymbolIterator)) + const iteratorCallResult = this.callFunction(methodHandle, iterableHandle) + if (iteratorCallResult.error) { + return iteratorCallResult + } + return this.success(new QuickJSIterator(iteratorCallResult.value, this)) + }) + } + /** * `handle[key] = value`. * Set a property on a JSValue. @@ -819,7 +1034,8 @@ export class QuickJSContext // Evaluation --------------------------------------------------------------- /** - * [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). + * [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call) or + * [`func.apply(thisVal, args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply). * Call a JSValue as a function. * * See {@link unwrapResult}, which will throw if the function returned an error, or @@ -830,13 +1046,40 @@ export class QuickJSContext * @returns A result. If the function threw synchronously, `result.error` be a * handle to the exception. Otherwise `result.value` will be a handle to the * value. + * + * Example: + * + * ```typescript + * using parseIntHandle = context.getProp(global, "parseInt") + * using stringHandle = context.newString("42") + * using resultHandle = context.callFunction(parseIntHandle, context.undefined, stringHandle).unwrap() + * console.log(context.dump(resultHandle)) // 42 + * ``` */ + callFunction( + func: QuickJSHandle, + thisVal: QuickJSHandle, + args?: QuickJSHandle[], + ): QuickJSContextResult callFunction( func: QuickJSHandle, thisVal: QuickJSHandle, ...args: QuickJSHandle[] - ): VmCallResult { + ): QuickJSContextResult + callFunction( + func: QuickJSHandle, + thisVal: QuickJSHandle, + ...restArgs: Array + ): QuickJSContextResult { this.runtime.assertOwned(func) + let args + const firstArg = restArgs[0] + if (firstArg === undefined || Array.isArray(firstArg)) { + args = firstArg ?? [] + } else { + args = restArgs as QuickJSHandle[] + } + const resultPtr = this.memory .toPointerArray(args) .consume((argsArrayPtr) => @@ -852,10 +1095,29 @@ export class QuickJSContext const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr) if (errorPtr) { this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr) - return { error: this.memory.heapValueHandle(errorPtr) } + return this.fail(this.memory.heapValueHandle(errorPtr)) } - return { value: this.memory.heapValueHandle(resultPtr) } + return this.success(this.memory.heapValueHandle(resultPtr)) + } + + /** + * `handle[key](...args)` + * + * Call a method on a JSValue. This is a convenience method that calls {@link getProp} and {@link callFunction}. + * + * @returns A result. If the function threw synchronously, `result.error` be a + * handle to the exception. Otherwise `result.value` will be a handle to the + * value. + */ + callMethod( + thisHandle: QuickJSHandle, + key: QuickJSPropertyKey, + args: QuickJSHandle[] = [], + ): QuickJSContextResult { + return this.getProp(thisHandle, key).consume((func) => + this.callFunction(func, thisHandle, args), + ) } /** @@ -901,7 +1163,7 @@ export class QuickJSContext * See {@link EvalFlags} for number semantics. */ options?: number | ContextEvalOptions, - ): VmCallResult { + ): QuickJSContextResult { const detectModule = (options === undefined ? 1 : 0) as EvalDetectModule const flags = evalOptionsToFlags(options) as EvalFlags const resultPtr = this.memory @@ -919,9 +1181,9 @@ export class QuickJSContext const errorPtr = this.ffi.QTS_ResolveException(this.ctx.value, resultPtr) if (errorPtr) { this.ffi.QTS_FreeValuePointer(this.ctx.value, resultPtr) - return { error: this.memory.heapValueHandle(errorPtr) } + return this.fail(this.memory.heapValueHandle(errorPtr)) } - return { value: this.memory.heapValueHandle(resultPtr) } + return this.success(this.memory.heapValueHandle(resultPtr)) } /** @@ -1103,7 +1365,7 @@ export class QuickJSContext const result = yield* awaited(fn.apply(thisHandle, argHandles)) if (result) { if ("error" in result && result.error) { - debugLog("throw error", result.error) + this.runtime.debugLog("throw error", result.error) throw result.error } const handle = scope.manage(result instanceof Lifetime ? result : result.value) @@ -1161,4 +1423,12 @@ export class QuickJSContext const ptr = this.ffi.QTS_bjson_decode(this.ctx.value, handle.value) return this.memory.heapValueHandle(ptr) } + + protected success(value: S): DisposableSuccess { + return DisposableResult.success(value) + } + + protected fail(error: QuickJSHandle): DisposableFail { + return DisposableResult.fail(error, (error) => this.unwrapResult(error)) + } } diff --git a/packages/quickjs-emscripten-core/src/debug.ts b/packages/quickjs-emscripten-core/src/debug.ts index 354ac402..1cf4487e 100644 --- a/packages/quickjs-emscripten-core/src/debug.ts +++ b/packages/quickjs-emscripten-core/src/debug.ts @@ -5,18 +5,25 @@ export let QTS_DEBUG = false /** - * Enable (or disable) debug logging and object creation tracking in the Javascript API. + * Enable (or disable) debug logging and object creation tracking globally. + * This setting is inherited by newly created QuickJSRuntime instances. * To get debug logging in the WebAssembly module, you need to use a debug build variant. + * See [the quickjs-emscripten-core README](https://github.com/justjake/quickjs-emscripten/tree/main/doc/quickjs-emscripten-core) for more about build variants. */ export function setDebugMode(enabled: boolean = true) { QTS_DEBUG = enabled } +/** Get the global debug mode */ +export function isDebugMode() { + return QTS_DEBUG +} + /** * @private */ export function debugLog(...args: any[]) { if (QTS_DEBUG) { - console.log(...args) + console.log("quickjs-emscripten:", ...args) } } diff --git a/packages/quickjs-emscripten-core/src/errors.ts b/packages/quickjs-emscripten-core/src/errors.ts index 8fa317b2..a2711f6f 100644 --- a/packages/quickjs-emscripten-core/src/errors.ts +++ b/packages/quickjs-emscripten-core/src/errors.ts @@ -48,3 +48,7 @@ export class QuickJSUnknownIntrinsic extends TypeError { export class QuickJSPromisePending extends Error { name = "QuickJSPromisePending" } + +export class QuickJSEmptyGetOwnPropertyNames extends Error { + name = "QuickJSEmptyGetOwnPropertyNames" +} diff --git a/packages/quickjs-emscripten-core/src/lifetime.test.ts b/packages/quickjs-emscripten-core/src/lifetime.test.ts index 565b73f7..cea6f50b 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.test.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.test.ts @@ -1,6 +1,6 @@ import assert from "assert" import { describe, it } from "vitest" -import { Lifetime, Scope } from "./lifetime" +import { DisposableResult, Lifetime, Scope, createDisposableArray } from "./lifetime" describe("Lifetime", () => { describe(".consume", () => { @@ -57,3 +57,100 @@ describe("Scope", () => { }) }) }) + +describe("createDisposableArray", () => { + it("is alive if any element is alive", () => { + const lifetimes = [new Lifetime(1), new Lifetime(2)] + const result = createDisposableArray(lifetimes) + assert.strictEqual(result.alive, true) + + lifetimes[0].dispose() + assert.strictEqual(result.alive, true) + + lifetimes[1].dispose() + assert.strictEqual(result.alive, false) + }) + + it(".dispose() disposes all alive elements and ignores dead elements", () => { + const lifetimes = [new Lifetime(1), new Lifetime(2)] + lifetimes[0].dispose() + const result = createDisposableArray(lifetimes) + result.dispose() + assert.strictEqual(lifetimes[0].alive, false) + assert.strictEqual(lifetimes[1].alive, false) + }) +}) + +describe("DisposableResult", () => { + function itBehavesAsDisposable(factory: (v: T) => DisposableResult) { + it("is alive when the value is not disposable", () => { + const result = factory(false) + assert.strictEqual(result.alive, true) + }) + + it("is alive when the value is disposable and alive", () => { + const lifetime = new Lifetime(1) + const result = factory(lifetime) + assert.strictEqual(result.alive, true) + lifetime.dispose() + assert.strictEqual(result.alive, false) + }) + + it("disposes the value when dispose is called", () => { + const lifetime = new Lifetime(1) + const result = factory(lifetime) + result.dispose() + assert.strictEqual(lifetime.alive, false) + }) + + it("can call unwrapOr", () => { + const result = factory("hi") + result.unwrapOr(0) + }) + } + + describe("success", () => { + itBehavesAsDisposable((v) => DisposableResult.success(v)) + + it("unwrap returns the value", () => { + const val = {} + const result = DisposableResult.success(val) + assert.strictEqual(result.unwrap(), val) + }) + + it("unwrapOr returns the value", () => { + const val = {} + const result = DisposableResult.success(val) + assert.strictEqual(result.unwrapOr(0), val) + }) + }) + + describe("fail", () => { + itBehavesAsDisposable((v) => DisposableResult.fail(v, () => {})) + + it("unwrap calls the onUnwrap", () => { + let calledWith: unknown = undefined + const expectedError = new Error("will throw") + const result = DisposableResult.fail("error", (v) => { + calledWith = v + throw expectedError + }) + assert.throws( + () => result.unwrap(), + (e) => e === expectedError, + ) + assert.strictEqual(calledWith, result) + }) + + it("throws even if unwrap doesnt", () => { + const result = DisposableResult.fail("error", () => {}) + assert.throws(() => result.unwrap()) + }) + + it("unwrapOr returns the fallback", () => { + const fallback = {} + const result = DisposableResult.fail("error", () => {}) + assert.strictEqual(result.unwrapOr(fallback), fallback) + }) + }) +}) diff --git a/packages/quickjs-emscripten-core/src/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 54b2b068..1442e2af 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -1,3 +1,4 @@ +import type { SuccessOrFail } from "./vm-interface" import type { MaybeAsyncBlock } from "./asyncify-helpers" import { maybeAsync } from "./asyncify-helpers" import { QTS_DEBUG } from "./debug" @@ -299,7 +300,7 @@ export class Scope extends UsingDisposable implements Disposable { /** * Track `lifetime` so that it is disposed when this scope is disposed. */ - manage(lifetime: T): T { + manage = (lifetime: T): T => { this._disposables.value.add(lifetime) return lifetime } @@ -318,3 +319,136 @@ export class Scope extends UsingDisposable implements Disposable { this._disposables.dispose() } } + +/** + * An `Array` that also implements {@link Disposable}: + * + * - Considered {@link Disposable#alive} if any of its elements are `alive`. + * - When {@link Disposable#dispose}d, it will dispose of all its elements that are `alive`. + */ +export type DisposableArray = T[] & Disposable + +/** + * Create an array that also implements {@link Disposable}. + */ +export function createDisposableArray( + items?: Iterable, +): DisposableArray { + const array = items ? Array.from(items) : [] + + function disposeAlive() { + return array.forEach((disposable) => (disposable.alive ? disposable.dispose() : undefined)) + } + + function someIsAlive() { + return array.some((disposable) => disposable.alive) + } + + Object.defineProperty(array, SymbolDispose, { + configurable: true, + enumerable: false, + value: disposeAlive, + }) + + Object.defineProperty(array, "dispose", { + configurable: true, + enumerable: false, + value: disposeAlive, + }) + + Object.defineProperty(array, "alive", { + configurable: true, + enumerable: false, + get: someIsAlive, + }) + + return array as T[] & Disposable +} + +function isDisposable(value: unknown): value is { alive: boolean; dispose(): unknown } { + return Boolean( + value && + (typeof value === "object" || typeof value === "function") && + "alive" in value && + typeof value.alive === "boolean" && + "dispose" in value && + typeof value.dispose === "function", + ) +} + +abstract class AbstractDisposableResult extends UsingDisposable implements Disposable { + static success(value: S): DisposableSuccess { + return new DisposableSuccess(value) satisfies SuccessOrFail + } + + static fail(error: F, onUnwrap: (status: SuccessOrFail) => void): DisposableFail { + return new DisposableFail( + error, + onUnwrap as (status: SuccessOrFail) => void, + ) satisfies SuccessOrFail + } + + static is(result: SuccessOrFail): result is DisposableResult { + return result instanceof AbstractDisposableResult + } + + abstract get alive(): boolean + abstract dispose(): void +} + +export class DisposableSuccess extends AbstractDisposableResult { + declare error?: undefined + + constructor(readonly value: S) { + super() + } + + override get alive() { + return isDisposable(this.value) ? this.value.alive : true + } + + override dispose(): void { + if (isDisposable(this.value)) { + this.value.dispose() + } + } + + unwrap(): S { + return this.value + } + + unwrapOr(_fallback: T): S | T { + return this.value + } +} + +export class DisposableFail extends AbstractDisposableResult { + constructor( + readonly error: F, + private readonly onUnwrap: (status: SuccessOrFail) => void, + ) { + super() + } + + override get alive(): boolean { + return isDisposable(this.error) ? this.error.alive : true + } + + override dispose(): void { + if (isDisposable(this.error)) { + this.error.dispose() + } + } + + unwrap(): never { + this.onUnwrap(this) + throw this.error + } + + unwrapOr(fallback: T): T { + return fallback + } +} + +export type DisposableResult = DisposableSuccess | DisposableFail +export const DisposableResult = AbstractDisposableResult diff --git a/packages/quickjs-emscripten-core/src/memory.ts b/packages/quickjs-emscripten-core/src/memory.ts index fb59f901..19628f8a 100644 --- a/packages/quickjs-emscripten-core/src/memory.ts +++ b/packages/quickjs-emscripten-core/src/memory.ts @@ -1,9 +1,7 @@ import type { EitherModule, OwnedHeapCharPointer, - JSContextPointerPointer, JSValueConstPointerPointer, - JSValuePointerPointer, JSVoidPointer, } from "@jitl/quickjs-ffi-types" import { Lifetime } from "./lifetime" @@ -12,11 +10,31 @@ import type { QuickJSHandle } from "./types" /** * @private */ -type HeapUint8Array = { +export type HeapUint8Array = { pointer: JSVoidPointer numBytes: number } +/** + * Add more types as needed. + * @private + */ +export type TypedArray = Int32Array | Uint32Array + +/** @private */ +export interface TypedArrayConstructor { + new (length: number): T + new (array: ArrayLike | ArrayBufferLike): T + new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T + BYTES_PER_ELEMENT: number +} + +/** @private */ +export type HeapTypedArray = Lifetime<{ + typedArray: JS + ptr: C +}> + /** * @private */ @@ -32,17 +50,25 @@ export class ModuleMemory { return new Lifetime(ptr, undefined, (ptr) => this.module._free(ptr)) } - newMutablePointerArray( + newTypedArray( + kind: TypedArrayConstructor, length: number, - ): Lifetime<{ typedArray: Int32Array; ptr: T }> { - const zeros = new Int32Array(new Array(length).fill(0)) + ): HeapTypedArray { + const zeros = new kind(new Array(length).fill(0)) const numBytes = zeros.length * zeros.BYTES_PER_ELEMENT - const ptr = this.module._malloc(numBytes) as T - const typedArray = new Int32Array(this.module.HEAPU8.buffer, ptr, length) + const ptr = this.module._malloc(numBytes) as C + const typedArray = new kind(this.module.HEAPU8.buffer, ptr, length) typedArray.set(zeros) return new Lifetime({ typedArray, ptr }, undefined, (value) => this.module._free(value.ptr)) } + // TODO: shouldn't this be Uint32 instead of Int32? + newMutablePointerArray( + length: number, + ): Lifetime<{ typedArray: Int32Array; ptr: T }> { + return this.newTypedArray(Int32Array, length) + } + newHeapCharPointer(string: string): Lifetime<{ ptr: OwnedHeapCharPointer; strlen: number }> { const strlen = this.module.lengthBytesUTF8(string) const dataBytes = strlen + 1 diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index 8f321075..adf77513 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -8,15 +8,14 @@ import type { } from "@jitl/quickjs-ffi-types" import { maybeAsyncFn } from "./asyncify-helpers" import { QuickJSContext } from "./context" -import { debugLog } from "./debug" +import { QTS_DEBUG } from "./debug" import { QuickJSWrongOwner } from "./errors" import type { Disposable } from "./lifetime" -import { Lifetime, Scope, UsingDisposable } from "./lifetime" +import { DisposableResult, Lifetime, Scope, UsingDisposable } from "./lifetime" import { ModuleMemory } from "./memory" import type { QuickJSModuleCallbacks, RuntimeCallbacks } from "./module" import type { ContextOptions, JSModuleLoader, JSModuleNormalizer, QuickJSHandle } from "./types" import { intrinsicsToFlags } from "./types" -import type { SuccessOrFail } from "./vm-interface" /** * Callback called regularly while the VM executes code. @@ -33,7 +32,7 @@ export type InterruptHandler = (runtime: QuickJSRuntime) => boolean | undefined * by the runtime. * @source */ -export type ExecutePendingJobsResult = SuccessOrFail< +export type ExecutePendingJobsResult = DisposableResult< /** Number of jobs successfully executed. */ number, /** The error that occurred. */ @@ -117,6 +116,10 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { this.callbacks.setRuntimeCallbacks(this.rt.value, this.cToHostCallbacks) this.executePendingJobs = this.executePendingJobs.bind(this) + + if (QTS_DEBUG) { + this.setDebugMode(true) + } } get alive() { @@ -250,7 +253,7 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { if (ctxPtr === 0) { // No jobs executed. this.ffi.QTS_FreeValuePointerRuntime(this.rt.value, valuePtr) - return { value: 0 } + return DisposableResult.success(0) } const context = @@ -264,12 +267,10 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { if (typeOfRet === "number") { const executedJobs = context.getNumber(resultValue) resultValue.dispose() - return { value: executedJobs } + return DisposableResult.success(executedJobs) } else { - const error = Object.assign(resultValue, { context }) - return { - error, - } + const error = Object.assign(resultValue as QuickJSHandle, { context }) + return DisposableResult.fail(error, (error) => context.unwrapResult(error)) } } @@ -331,6 +332,40 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { } } + private _debugMode = false + + /** + * Enable or disable debug logging. + * + * If this module is a DEBUG variant, more logs will be printed from the C + * code. + */ + setDebugMode(enabled: boolean) { + this._debugMode = enabled + if (this.ffi.DEBUG && this.rt.alive) { + this.ffi.QTS_SetDebugLogEnabled(this.rt.value, enabled ? 1 : 0) + } + } + + /** + * @returns true if debug logging is enabled + */ + isDebugMode(): boolean { + return this._debugMode + } + + /** + * In debug mode, log the result of calling `msg()`. + * + * We take a function instead of a log message to avoid expensive string + * manipulation if debug logging is disabled. + */ + debugLog(...msg: unknown[]) { + if (this._debugMode) { + console.log("quickjs-emscripten:", ...msg) + } + } + private getSystemContext() { if (!this.context) { // We own this context and should dispose of it. @@ -373,7 +408,7 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { const result = yield* awaited(moduleLoader(moduleName, context)) if (typeof result === "object" && "error" in result && result.error) { - debugLog("cToHostLoadModule: loader returned error", result.error) + this.debugLog("cToHostLoadModule: loader returned error", result.error) throw result.error } @@ -382,7 +417,7 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { return this.memory.newHeapCharPointer(moduleSource).value.ptr } catch (error) { - debugLog("cToHostLoadModule: caught error", error) + this.debugLog("cToHostLoadModule: caught error", error) context.throw(error as any) return 0 as BorrowedHeapCharPointer } @@ -413,14 +448,14 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { ) if (typeof result === "object" && "error" in result && result.error) { - debugLog("cToHostNormalizeModule: normalizer returned error", result.error) + this.debugLog("cToHostNormalizeModule: normalizer returned error", result.error) throw result.error } const name = typeof result === "string" ? result : result.value return context.getMemory(this.rt.value).newHeapCharPointer(name).value.ptr } catch (error) { - debugLog("normalizeModule: caught error", error) + this.debugLog("normalizeModule: caught error", error) context.throw(error as any) return 0 as BorrowedHeapCharPointer } diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 1ee5a9f4..a5684914 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -1,5 +1,5 @@ import type { JSContextPointer, JSValueConstPointer, JSValuePointer } from "@jitl/quickjs-ffi-types" -import { EvalFlags, IntrinsicsFlags } from "@jitl/quickjs-ffi-types" +import { EvalFlags, GetOwnPropertyNamesFlags, IntrinsicsFlags } from "@jitl/quickjs-ffi-types" import type { QuickJSContext } from "./context" import type { SuccessOrFail, VmFunctionImplementation } from "./vm-interface" import type { Disposable, Lifetime } from "./lifetime" @@ -41,6 +41,7 @@ export type JSValueConst = Lifetime +// | Lifetime /** * Wraps a C pointer to a QuickJS JSValue, which represents a Javascript value inside @@ -283,6 +284,52 @@ export function evalOptionsToFlags(evalOptions: ContextEvalOptions | number | un return flags } +export interface GetOwnPropertyNamesOptions { + /** Include number properties like array indexes *as numbers* in the result. This is not standards-compliant */ + numbers?: boolean + /** Enable standards-compliant number properties. When set, `includeNumbers` is ignored. */ + numbersAsStrings?: boolean + /** Include strings in the result */ + strings?: boolean + /** Include symbols in the result */ + symbols?: boolean + /** Include implementation-specific private properties in the result */ + quickjsPrivate?: boolean + /** Only include the enumerable properties */ + onlyEnumerable?: boolean +} + +/** Convert {@link GetOwnPropertyNamesOptions} to bitfield flags */ +export function getOwnPropertyNamesOptionsToFlags( + options: GetOwnPropertyNamesOptions | GetOwnPropertyNamesFlags | undefined, +): GetOwnPropertyNamesFlags { + if (typeof options === "number") { + return options + } + + if (options === undefined) { + return 0 as GetOwnPropertyNamesFlags + } + + const { + strings: includeStrings, + symbols: includeSymbols, + quickjsPrivate: includePrivate, + onlyEnumerable, + numbers: includeNumbers, + numbersAsStrings, + } = options + let flags = 0 + if (includeStrings) flags |= GetOwnPropertyNamesFlags.JS_GPN_STRING_MASK + if (includeSymbols) flags |= GetOwnPropertyNamesFlags.JS_GPN_SYMBOL_MASK + if (includePrivate) flags |= GetOwnPropertyNamesFlags.JS_GPN_PRIVATE_MASK + if (onlyEnumerable) flags |= GetOwnPropertyNamesFlags.JS_GPN_ENUM_ONLY + if (includeNumbers) flags |= GetOwnPropertyNamesFlags.QTS_GPN_NUMBER_MASK + if (numbersAsStrings) flags |= GetOwnPropertyNamesFlags.QTS_STANDARD_COMPLIANT_NUMBER + + return flags as GetOwnPropertyNamesFlags +} + export type PromiseExecutor = ( resolve: (value: ResolveT | PromiseLike) => void, reject: (reason: RejectT) => void, diff --git a/packages/quickjs-emscripten-core/tsconfig.build.json b/packages/quickjs-emscripten-core/tsconfig.build.json new file mode 100644 index 00000000..407f9316 --- /dev/null +++ b/packages/quickjs-emscripten-core/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "@jitl/tsconfig/tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "paths": {} + } +} diff --git a/packages/quickjs-emscripten-core/tsconfig.json b/packages/quickjs-emscripten-core/tsconfig.json index b8c45f7e..66f2a6a3 100644 --- a/packages/quickjs-emscripten-core/tsconfig.json +++ b/packages/quickjs-emscripten-core/tsconfig.json @@ -2,7 +2,9 @@ "extends": "@jitl/tsconfig/tsconfig.json", "include": ["src/**/*"], "compilerOptions": { - "rootDir": "src", - "outDir": "dist" + "paths": { + "@jitl/quickjs-ffi-types": ["../quickjs-ffi-types/src"], + "@jitl/quickjs-ffi-types/*": ["../quickjs-ffi-types/src/*"] + } } } diff --git a/packages/quickjs-emscripten-core/tsup.config.ts b/packages/quickjs-emscripten-core/tsup.config.ts index a1c58efd..91dc5f58 100644 --- a/packages/quickjs-emscripten-core/tsup.config.ts +++ b/packages/quickjs-emscripten-core/tsup.config.ts @@ -1,3 +1,5 @@ import { extendConfig } from "@jitl/tsconfig/tsup.base.config.js" -export default extendConfig() +export default extendConfig({ + tsconfig: "./tsconfig.build.json", +}) diff --git a/packages/quickjs-emscripten/package.json b/packages/quickjs-emscripten/package.json index 9707a456..655dbe69 100644 --- a/packages/quickjs-emscripten/package.json +++ b/packages/quickjs-emscripten/package.json @@ -33,7 +33,7 @@ "clean": "git clean -fx dist .output", "tsc": "npx tsc -p . --noEmit", "test:vi": "VITEST=1 npx vitest run", - "test:node": "npx tsc -p . && ./makeTestPackageJson.ts && node -r source-map-support/register --test ./.output/*node-test*.*js", + "test:node": "npx tsc -p tsconfig.build.json && ./makeTestPackageJson.ts && node -r source-map-support/register --test ./.output/*node-test*.*js", "test": "npm run test:vi && npm run test:node" }, "types": "./dist/index.d.ts", diff --git a/packages/quickjs-emscripten/src/leak.test.ts b/packages/quickjs-emscripten/src/leak.test.ts index 289effb2..e3d09973 100644 --- a/packages/quickjs-emscripten/src/leak.test.ts +++ b/packages/quickjs-emscripten/src/leak.test.ts @@ -144,7 +144,8 @@ function checkModuleForLeaks(getModule: () => Promise) { for (const checkName of checkNames) { const fn = checks[checkName as keyof typeof checks] - it( + const test = TEST_LEAK ? it : it.skip + test( `should not leak: ${checkName}`, () => { console.log(`Running ${checkName}...`) diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index cd748b11..f9fc2336 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -5,7 +5,15 @@ import assert from "assert" import fs from "fs" import { inspect as baseInspect } from "node:util" -import { describe, beforeEach, afterEach, afterAll as after, it, expect } from "vitest" +import { + describe, + beforeEach, + afterEach, + afterAll as after, + it, + expect, + onTestFailed, +} from "vitest" import type { QuickJSHandle, InterruptHandler, @@ -35,35 +43,69 @@ import { RELEASE_ASYNC, newVariant, shouldInterruptAfterDeadline, + Scope, + setDebugMode, } from "." -const TEST_NG = !process.env.TEST_NO_NG -const TEST_DEBUG = !process.env.TEST_NO_DEBUG -const TEST_ASYNC = !process.env.TEST_NO_ASYNC +const TEST_SLOW = !process.env.TEST_FAST +const TEST_NG = TEST_SLOW && !process.env.TEST_NO_NG +const TEST_DEBUG = TEST_SLOW && !process.env.TEST_NO_DEBUG +const TEST_ASYNC = TEST_SLOW && !process.env.TEST_NO_ASYNC const TEST_RELEASE = !process.env.TEST_NO_RELEASE +const DEBUG = Boolean(process.env.DEBUG) console.log("test sets:", { TEST_RELEASE, TEST_DEBUG, TEST_NG, TEST_ASYNC, + TEST_SLOW, + DEBUG, }) +if (DEBUG) { + setDebugMode(true) +} + type GetTestContext = (options?: ContextOptions) => Promise +const baseIt = it function contextTests(getContext: GetTestContext, isDebug = false) { let vm: QuickJSContext = undefined as any let ffi: QuickJSFFI | QuickJSAsyncFFI = undefined as any let testId = 0 + let anyTestFailed = false + let thisTestFailed = false + + const it = (name: string, fn: (scope: Scope) => unknown) => + baseIt(name, async () => { + onTestFailed(() => { + anyTestFailed = true + }) + + try { + await Scope.withScopeAsync(async (scope) => { + await fn(scope) + }) + } catch (error) { + thisTestFailed = true + throw error + } + }) beforeEach(async () => { testId++ + thisTestFailed = false vm = await getContext() ffi = (vm as any).ffi assertBuildIsConsistent(vm) }) afterEach(() => { - vm.dispose() + if (!thisTestFailed) { + // this will assert we disposed everything in the test + // however, if we failed we may not have disposed + vm.dispose() + } vm = undefined as any }) @@ -76,9 +118,13 @@ function contextTests(getContext: GetTestContext, isDebug = false) { // Asyncify explodes during leak checking. return } + if (anyTestFailed) { + // we probably threw an error before disposing + return + } // https://web.dev/webassembly-memory-debugging/ assert.strictEqual(ffi.QTS_RecoverableLeakCheck(), 0, "No lsan errors") - console.log("Leaks checked (OK)") + debugLog("Leaks checked (OK)") }) const getTestId = () => `test-${getContext.name}-${testId}` @@ -232,7 +278,7 @@ function contextTests(getContext: GetTestContext, isDebug = false) { fnHandle.dispose() }) - const itForMaxFuns = isDebug ? it : it.skip + const itForMaxFuns = isDebug && TEST_SLOW ? it : baseIt.skip itForMaxFuns( "can handle more than signed int max functions being registered", () => @@ -359,6 +405,99 @@ function contextTests(getContext: GetTestContext, isDebug = false) { array.dispose() vals.forEach((val) => val.dispose()) }) + + it("can access .length as a number", () => { + const array = vm.newArray() + assert.strictEqual(vm.getLength(array), 0) + vm.newNumber(100).consume((n) => vm.setProp(array, 5, n)) + assert.strictEqual(vm.getLength(array), 6) + array.dispose() + }) + }) + + describe("getOwnPropertyNames", () => { + it("gets array indexes as *numbers*", ({ manage }) => { + const array = manage(vm.newArray()) + vm.setProp(array, 0, vm.undefined) + vm.setProp(array, 1, vm.undefined) + vm.setProp(array, 2, vm.undefined) + + const props = manage( + vm + .getOwnPropertyNames(array, { + numbers: true, + }) + .unwrap(), + ) + + assert.strictEqual(props.length, 3) + assert.strictEqual(vm.dump(props[0]), 0) + assert.strictEqual(vm.dump(props[1]), 1) + assert.strictEqual(vm.dump(props[2]), 2) + }) + + it("gets object keys as *strings*, but does not include symbols", ({ manage }) => { + const obj = manage(vm.newObject()) + vm.setProp(obj, "a", vm.true) + vm.setProp(obj, "b", vm.undefined) + vm.setProp(obj, "c", vm.undefined) + const sym = vm.newUniqueSymbol("d") + vm.setProp(obj, sym, vm.undefined) + sym.dispose() + + const props = manage( + vm + .getOwnPropertyNames(obj, { + onlyEnumerable: true, + strings: true, + }) + .unwrap(), + ) + + assert.strictEqual(props.length, 3) + assert.strictEqual(vm.dump(props[0]), "a") + assert.strictEqual(vm.dump(props[1]), "b") + assert.strictEqual(vm.dump(props[2]), "c") + }) + + it('gets object keys that are symbols only when "includeSymbols" is true', ({ manage }) => { + const obj = manage(vm.newObject()) + const symA = manage(vm.newUniqueSymbol("a")) + vm.setProp(obj, symA, vm.undefined) + vm.setProp(obj, "b", vm.undefined) + vm.setProp(obj, "c", vm.undefined) + + const props = manage( + vm.unwrapResult( + vm.getOwnPropertyNames(obj, { + onlyEnumerable: true, + symbols: true, + }), + ), + ) + + assert.strictEqual(props.length, 1) + assert.strictEqual(vm.typeof(props[0]), "symbol") + }) + + it("gets number keys as strings when in standard compliant mode", ({ manage }) => { + const array = manage(vm.newArray()) + vm.setProp(array, 0, vm.undefined) + vm.setProp(array, 1, vm.undefined) + vm.setProp(array, 2, vm.undefined) + vm.setProp(array, "dog", vm.undefined) + const props = manage( + vm.getOwnPropertyNames(array, { + strings: true, + numbersAsStrings: true, + onlyEnumerable: true, + }), + ) + .unwrap() + .map((p) => vm.dump(p)) + + assert.deepStrictEqual(["0", "1", "2", "dog"], props) + }) }) describe(".unwrapResult", () => { @@ -1168,7 +1307,7 @@ function asyncContextTests(getContext: () => Promise) { // The nesting levels of the test cannot be too high, otherwise the // node.js call stack will overflow when executing `yarn test` const buildName = isBuildDebug(vm) ? "debug" : "release" - const EXPECTED_NESTING_LEVEL = isBuildDebug(vm) ? 19 : 20 + const EXPECTED_NESTING_LEVEL = isBuildDebug(vm) ? 18 : 20 let asyncFunctionCalls = 0 const asyncFn = async () => { diff --git a/packages/quickjs-emscripten/tsconfig.build.json b/packages/quickjs-emscripten/tsconfig.build.json new file mode 100644 index 00000000..7412f5b6 --- /dev/null +++ b/packages/quickjs-emscripten/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": ".output", + "rootDir": "src", + "paths": { + "#variants": ["./src/variants.ts", "./src/variants.js"] + } + } +} diff --git a/packages/quickjs-emscripten/tsconfig.json b/packages/quickjs-emscripten/tsconfig.json index 16ddb588..8631045d 100644 --- a/packages/quickjs-emscripten/tsconfig.json +++ b/packages/quickjs-emscripten/tsconfig.json @@ -2,10 +2,10 @@ "extends": "@jitl/tsconfig/tsconfig.json", "include": ["src/*.*ts"], "compilerOptions": { - "outDir": ".output", - "rootDir": "src", "paths": { - "#variants": ["./src/variants.ts", "./src/variants.js"] + "#variants": ["./src/variants.ts", "./src/variants.js"], + "quickjs-emscripten-core": ["../quickjs-emscripten-core/src"], + "quickjs-emscripten-core/*": ["../quickjs-emscripten-core/src/*"] } } } diff --git a/packages/quickjs-emscripten/tsup.config.ts b/packages/quickjs-emscripten/tsup.config.ts index 54855028..8ae8bb05 100644 --- a/packages/quickjs-emscripten/tsup.config.ts +++ b/packages/quickjs-emscripten/tsup.config.ts @@ -12,11 +12,13 @@ const browsers: Extract> = [ const configs = [ extendConfig({ entry: ["src/index.ts", "src/variants.ts"], + tsconfig: "./tsconfig.build.json", format: "esm", target: ["node16", ...browsers], }), extendConfig({ entry: ["src/index.ts", "src/variants.ts"], + tsconfig: "./tsconfig.build.json", format: "cjs", }), extendConfig({ diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 744e4a09..8f50f7b2 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "." @@ -119,6 +123,16 @@ export interface QuickJSAsyncFFI { this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer | Promise + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -142,6 +156,20 @@ export interface QuickJSAsyncFFI { enumerable: boolean, has_value: boolean, ) => void + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -189,6 +217,17 @@ export interface QuickJSAsyncFFI { ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer QTS_NewPromiseCapability: ( ctx: JSContextPointer, @@ -203,6 +242,8 @@ export interface QuickJSAsyncFFI { promise: JSValuePointer | JSValueConstPointer, ) => JSValuePointer QTS_TestStringArg: (string: string) => void + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void QTS_BuildIsDebug: () => number QTS_BuildIsAsyncify: () => number QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index cae418db..b8c03033 100644 --- a/packages/quickjs-ffi-types/src/ffi-types.ts +++ b/packages/quickjs-ffi-types/src/ffi-types.ts @@ -45,6 +45,11 @@ export type JSValueConstPointer = Pointer<"JSValueConst"> */ export type JSValuePointerPointer = Pointer<"JSValue[]"> +/** + * Used internally for Javascript-to-C function calls. + */ +export type JSValuePointerPointerPointer = Pointer<"*JSValue[]"> + /** * Used internally for Javascript-to-C function calls. */ @@ -93,6 +98,8 @@ export type JSBorrowedCharPointer = Pointer<"js const char"> */ export type JSVoidPointer = Pointer +export type UInt32Pointer = Pointer<"uint32_t"> + /** * @private */ @@ -108,6 +115,16 @@ export type IntrinsicsFlags = Brand */ export type EvalDetectModule = Brand +/** + * @private + */ +export type GetOwnPropertyNamesFlags = Brand + +/** + * @private + */ +export type IsEqualOp = Brand + /** * State of a promise. */ @@ -151,7 +168,7 @@ export const EvalFlags = { JS_EVAL_FLAG_BACKTRACE_BARRIER: 1 << 6, } as const -/** Bitfield options for QTS_NewContext intrinsices */ +/** Bitfield options for QTS_NewContext intrinsics */ export const IntrinsicsFlags = { BaseObjects: 1 << 0, Date: 1 << 1, @@ -176,3 +193,24 @@ export const JSPromiseStateEnum = { Fulfilled: 1, Rejected: 2, } as const + +/** Bitfield options for QTS_GetOwnPropertyNames */ +export const GetOwnPropertyNamesFlags = { + JS_GPN_STRING_MASK: 1 << 0, + JS_GPN_SYMBOL_MASK: 1 << 1, + JS_GPN_PRIVATE_MASK: 1 << 2, + /* only include the enumerable properties */ + JS_GPN_ENUM_ONLY: 1 << 4, + /* set theJSPropertyEnum.is_enumerable field */ + JS_GPN_SET_ENUM: 1 << 5, + /* include numbers. when only this is set, we filter out strings */ + QTS_GPN_NUMBER_MASK: 1 << 6, + /* Treat numbers as strings */ + QTS_STANDARD_COMPLIANT_NUMBER: 1 << 7, +} + +export const IsEqualOp = { + IsStrictlyEqual: 0 as IsEqualOp, + IsSameValue: 1 as IsEqualOp, + IsSameValueZero: 2 as IsEqualOp, +} diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index 07cbd5d8..cf9a2096 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "." @@ -104,6 +108,11 @@ export interface QuickJSFFI { this_val: JSValuePointer | JSValueConstPointer, prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -121,6 +130,13 @@ export interface QuickJSFFI { enumerable: boolean, has_value: boolean, ) => void + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -149,6 +165,17 @@ export interface QuickJSFFI { ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer QTS_NewPromiseCapability: ( ctx: JSContextPointer, @@ -163,6 +190,8 @@ export interface QuickJSFFI { promise: JSValuePointer | JSValueConstPointer, ) => JSValuePointer QTS_TestStringArg: (string: string) => void + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void QTS_BuildIsDebug: () => number QTS_BuildIsAsyncify: () => number QTS_NewFunction: (ctx: JSContextPointer, func_id: number, name: string) => JSValuePointer diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index f20a5931..16fa99c8 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs-ng # Paths @@ -84,13 +82,13 @@ CFLAGS_WASM+=-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json CFLAGS_WASM+=-lasync.js CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-sourceMapJson.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s ASYNCIFY_ADVISE=1 CFLAGS_WASM+=-O3 CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node @@ -106,6 +104,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -146,12 +145,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -165,11 +164,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md index 34ad3a0d..5a194c53 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md @@ -81,13 +81,13 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-sourceMapJson.js", "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` 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 bf43a784..ee3ce88b 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +249,25 @@ export class QuickJSAsyncFFI { { async: true }, ) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetPropNumber", + "number", + ["number", "number", "number"], + { async: true }, + ) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -288,6 +311,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + { async: true }, + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -373,6 +425,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -401,6 +466,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index 4740eae8..ef572faa 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs-ng # Paths @@ -77,6 +75,7 @@ CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) # Emscripten options - variant & target specific CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -99,6 +98,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -139,12 +139,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -158,11 +158,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md b/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md index 48ebcfb5..c3e762f9 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md @@ -74,6 +74,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", 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 b3b252d2..323a3abc 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index cf1cbb7e..fa97b618 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs-ng # Paths @@ -101,6 +99,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -141,12 +140,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -160,11 +159,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 0c2d1f03..83989cf6 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +246,24 @@ export class QuickJSAsyncFFI { "number", ]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -285,6 +307,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -372,6 +422,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -400,6 +463,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 612f89d5..6f37e049 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs-ng # Paths @@ -94,6 +92,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -134,12 +133,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -153,11 +152,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 2aefcf0c..419f408d 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index ebcf2775..97ac9d0e 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -84,6 +82,7 @@ CFLAGS_WASM+=-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json CFLAGS_WASM+=-lasync.js CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -91,7 +90,6 @@ CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-sourceMapJson.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s ASYNCIFY_ADVISE=1 CFLAGS_WASM+=-O3 @@ -107,6 +105,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -147,12 +146,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -166,11 +165,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md index 07abec77..38304e33 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md @@ -69,6 +69,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -76,7 +77,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` 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 bf43a784..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +249,25 @@ export class QuickJSAsyncFFI { { async: true }, ) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetPropNumber", + "number", + ["number", "number", "number"], + { async: true }, + ) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -288,6 +311,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + { async: true }, + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -373,6 +425,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -401,6 +466,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index fd6aa97f..20313d1e 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -77,6 +75,7 @@ CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) # Emscripten options - variant & target specific CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -100,6 +99,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -140,12 +140,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -159,11 +159,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/README.md b/packages/variant-quickjs-singlefile-browser-debug-sync/README.md index 3b2b72f6..47cabbbc 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/README.md @@ -62,6 +62,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", 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 b3b252d2..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index 3cd331d6..61068155 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -102,6 +100,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -142,12 +141,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -161,11 +160,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 0c2d1f03..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +246,24 @@ export class QuickJSAsyncFFI { "number", ]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -285,6 +307,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -372,6 +422,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -400,6 +463,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index 126d6838..66f97d57 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -95,6 +93,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -135,12 +134,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -154,11 +153,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 2aefcf0c..419f408d 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 14d3fb0e..4fd5522f 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -84,6 +82,7 @@ CFLAGS_WASM+=-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json CFLAGS_WASM+=-lasync.js CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -91,7 +90,6 @@ CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-sourceMapJson.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s ASYNCIFY_ADVISE=1 CFLAGS_WASM+=-O3 CFLAGS_CJS+=-s ENVIRONMENT=web,worker,node @@ -107,6 +105,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -147,12 +146,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -166,11 +165,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md index 4efcd258..b99a07f5 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md @@ -69,6 +69,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -76,7 +77,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` 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 bf43a784..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +249,25 @@ export class QuickJSAsyncFFI { { async: true }, ) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetPropNumber", + "number", + ["number", "number", "number"], + { async: true }, + ) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -288,6 +311,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + { async: true }, + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -373,6 +425,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -401,6 +466,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 6ff1adf5..2d3fd16e 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -77,6 +75,7 @@ CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) # Emscripten options - variant & target specific CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -100,6 +99,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -140,12 +140,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -159,11 +159,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md b/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md index cad502cf..ffc735a7 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md @@ -62,6 +62,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", 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 b3b252d2..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index 5f255c2d..b2c3f5e4 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -102,6 +100,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -142,12 +141,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -161,11 +160,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 0c2d1f03..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +246,24 @@ export class QuickJSAsyncFFI { "number", ]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -285,6 +307,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -372,6 +422,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -400,6 +463,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index 662861c0..c29d2205 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -95,6 +93,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -135,12 +134,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -154,11 +153,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 2aefcf0c..419f408d 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index 183191a1..3137c992 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -84,6 +82,7 @@ CFLAGS_WASM+=-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json CFLAGS_WASM+=-lasync.js CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -91,7 +90,6 @@ CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-sourceMapJson.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s ASYNCIFY_ADVISE=1 CFLAGS_WASM+=-O3 CFLAGS_MJS+=-s ENVIRONMENT=node @@ -107,6 +105,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -147,12 +146,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -166,11 +165,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md index 101c3089..5d8e35e2 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md @@ -69,6 +69,7 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", @@ -76,7 +77,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` 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 bf43a784..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +249,25 @@ export class QuickJSAsyncFFI { { async: true }, ) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetPropNumber", + "number", + ["number", "number", "number"], + { async: true }, + ) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -288,6 +311,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + { async: true }, + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -373,6 +425,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -401,6 +466,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index e67720e1..f3fb14a2 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -77,6 +75,7 @@ CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) # Emscripten options - variant & target specific CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -100,6 +99,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -140,12 +140,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -159,11 +159,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md b/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md index 18020fa2..a8380376 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md @@ -62,6 +62,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", 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 b3b252d2..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index da9c34c9..7e6179a2 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -102,6 +100,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -142,12 +141,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -161,11 +160,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 0c2d1f03..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +246,24 @@ export class QuickJSAsyncFFI { "number", ]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -285,6 +307,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -372,6 +422,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -400,6 +463,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index 61ba3ad5..a7548983 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -95,6 +93,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -135,12 +134,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -154,11 +153,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) 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 2aefcf0c..419f408d 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index b2fa95ed..64ce94bb 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -84,13 +82,13 @@ CFLAGS_WASM+=-s ASYNCIFY_IMPORTS=@$(BUILD_WRAPPER)/asyncify-imports.json CFLAGS_WASM+=-lasync.js CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-sourceMapJson.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s ASYNCIFY_ADVISE=1 CFLAGS_WASM+=-O3 CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node @@ -106,6 +104,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -146,12 +145,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -165,11 +164,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md index c2c388c3..2a559f55 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md @@ -81,13 +81,13 @@ Variant-specific Emscripten build flags: "-lasync.js", "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-sourceMapJson.js", "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s ASYNCIFY_ADVISE=1", "-O3" ] ``` diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index bf43a784..ee3ce88b 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +249,25 @@ export class QuickJSAsyncFFI { { async: true }, ) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetPropNumber", + "number", + ["number", "number", "number"], + { async: true }, + ) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -288,6 +311,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + { async: true }, + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -373,6 +425,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -401,6 +466,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 6901e950..1e379e0b 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -77,6 +75,7 @@ CFLAGS_WASM_BROWSER=$(CFLAGS_WASM) # Emscripten options - variant & target specific CFLAGS_WASM+=-O0 CFLAGS_WASM+=-DQTS_DEBUG_MODE +CFLAGS_WASM+=-DDUMP_LEAKS=1 CFLAGS_WASM+=-gsource-map CFLAGS_WASM+=-s ASSERTIONS=1 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js @@ -99,6 +98,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -139,12 +139,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -158,11 +158,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-wasmfile-debug-sync/README.md b/packages/variant-quickjs-wasmfile-debug-sync/README.md index 71b6c86a..57a672a7 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/README.md +++ b/packages/variant-quickjs-wasmfile-debug-sync/README.md @@ -74,6 +74,7 @@ Variant-specific Emscripten build flags: [ "-O0", "-DQTS_DEBUG_MODE", + "-DDUMP_LEAKS=1", "-gsource-map", "-s ASSERTIONS=1", "--pre-js $(TEMPLATES)/pre-extension.js", diff --git a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index b3b252d2..323a3abc 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index ff1f372a..809201bb 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -101,6 +99,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -141,12 +140,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -160,11 +159,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index 0c2d1f03..83989cf6 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +246,24 @@ export class QuickJSAsyncFFI { "number", ]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetPropNumber", "number", ["number", "number", "number"]), + ) + + QTS_GetPropNumber_MaybeAsync: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer | Promise = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -285,6 +307,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = assertSync( + this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]), + ) + + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise = this.module.cwrap( + "QTS_GetOwnPropertyNames", + "number", + ["number", "number", "number", "number", "number"], + ) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -372,6 +422,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -400,6 +463,18 @@ export class QuickJSAsyncFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/packages/variant-quickjs-wasmfile-release-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index 638eb8f0..750e7b6c 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=quickjs # Paths @@ -94,6 +92,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -134,12 +133,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -153,11 +152,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 2aefcf0c..419f408d 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -8,6 +8,7 @@ import { JSValuePointer, JSValueConstPointer, JSValuePointerPointer, + JSValuePointerPointerPointer, JSValueConstPointerPointer, QTS_C_To_HostCallbackFuncPointer, QTS_C_To_HostInterruptFuncPointer, @@ -16,9 +17,12 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +217,16 @@ export class QuickJSFFI { prop_name: JSValuePointer | JSValueConstPointer, ) => JSValuePointer = this.module.cwrap("QTS_GetProp", "number", ["number", "number", "number"]) + QTS_GetPropNumber: ( + ctx: JSContextPointer, + this_val: JSValuePointer | JSValueConstPointer, + prop_name: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetPropNumber", "number", [ + "number", + "number", + "number", + ]) + QTS_SetProp: ( ctx: JSContextPointer, this_val: JSValuePointer | JSValueConstPointer, @@ -242,6 +256,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointerPointer, + out_len: UInt32Pointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ + "number", + "number", + "number", + "number", + "number", + ]) + QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, @@ -290,6 +318,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: UInt32Pointer, + value: JSValuePointer | JSValueConstPointer, + ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) + + QTS_IsEqual: ( + ctx: JSContextPointer, + a: JSValuePointer | JSValueConstPointer, + b: JSValuePointer | JSValueConstPointer, + op: IsEqualOp, + ) => number = this.module.cwrap("QTS_IsEqual", "number", ["number", "number", "number", "number"]) + QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer = this.module.cwrap( "QTS_GetGlobalObject", "number", @@ -318,6 +359,18 @@ export class QuickJSFFI { "string", ]) + QTS_GetDebugLogEnabled: (rt: JSRuntimePointer) => number = this.module.cwrap( + "QTS_GetDebugLogEnabled", + "number", + ["number"], + ) + + QTS_SetDebugLogEnabled: (rt: JSRuntimePointer, is_enabled: number) => void = this.module.cwrap( + "QTS_SetDebugLogEnabled", + null, + ["number", "number"], + ) + QTS_BuildIsDebug: () => number = this.module.cwrap("QTS_BuildIsDebug", "number", []) QTS_BuildIsAsyncify: () => number = this.module.cwrap("QTS_BuildIsAsyncify", "number", []) diff --git a/scripts/generate.ts b/scripts/generate.ts index 9ab9a396..83efdea7 100755 --- a/scripts/generate.ts +++ b/scripts/generate.ts @@ -153,6 +153,10 @@ function cTypeToTypescriptType(ctype: string): ParsedType { return { ffi: "string", typescript: "string", ctype, attributes } } + if (type === "uint32_t*") { + return { ffi: "number", typescript: "UInt32Pointer", ctype, attributes } + } + if (type.startsWith("enum")) { return { ffi: "number", typescript: "number", ctype, attributes } } diff --git a/scripts/prepareVariants.ts b/scripts/prepareVariants.ts index daf4c355..7c683b4d 100755 --- a/scripts/prepareVariants.ts +++ b/scripts/prepareVariants.ts @@ -192,6 +192,7 @@ const ReleaseModeFlags = { [ReleaseMode.Debug]: [ `-O0`, "-DQTS_DEBUG_MODE", + `-DDUMP_LEAKS=1`, `-gsource-map`, `-s ASSERTIONS=1`, `--pre-js $(TEMPLATES)/pre-extension.js`, @@ -216,12 +217,13 @@ function getCflags(targetName: string, variant: BuildVariant) { if (variant.releaseMode === ReleaseMode.Debug) { switch (variant.syncMode) { case SyncMode.Sync: + flags.push() flags.push("-DQTS_SANITIZE_LEAK") flags.push("-fsanitize=leak") flags.push("-g2") break case SyncMode.Asyncify: - flags.push("-s ASYNCIFY_ADVISE=1") + // flags.push("-s ASYNCIFY_ADVISE=1") flags.push( // # Need to use -O3 - otherwise ASYNCIFY leads to stack overflows (why?) "-O3", diff --git a/templates/Variant.mk b/templates/Variant.mk index c4bf308b..2bfcf7e2 100644 --- a/templates/Variant.mk +++ b/templates/Variant.mk @@ -1,14 +1,12 @@ # Tools -EMSDK_VERSION=3.1.59 -EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.59 +EMSDK_VERSION=3.1.64 +EMSDK_DOCKER_IMAGE=emscripten/emsdk:3.1.64 EMCC_SRC=../../scripts/emcc.sh EMCC=EMSDK_VERSION=$(EMSDK_VERSION) EMSDK_DOCKER_IMAGE=$(EMSDK_DOCKER_IMAGE) EMSDK_PROJECT_ROOT=$(REPO_ROOT) EMSDK_DOCKER_CACHE=$(REPO_ROOT)/emsdk-cache/$(EMSDK_VERSION) $(EMCC_SRC) GENERATE_TS=$(GENERATE_TS_ENV) ../../scripts/generate.ts THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST)))) REPO_ROOT := $(abspath $(THIS_DIR)/../..) -DEBUG_MAKE=1 - QUICKJS_LIB=REPLACE_THIS # Paths @@ -89,6 +87,7 @@ ifdef DEBUG_MAKE MKDIRP=@echo "\n=====[["" target: $@, deps: $<, variant: $(VARIANT) ""]]=====" ; mkdir -p $(dir $@) else MKDIRP=@mkdir -p $(dir $@) + CFLAGS+=-Wunused-command-line-argument=0 endif ############################################################################### @@ -129,12 +128,12 @@ $(DIST)/emscripten-module%.d.ts: $(TEMPLATES)/emscripten-module.$(SYNC).d.ts # Browser target needs intermediate build to avoid two copies of .wasm $(DIST)/emscripten-module.%.mjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(DIST)/emscripten-module.%.cjs: $(BUILD_WRAPPER)/%/emscripten-module.js $(MKDIRP) - if [[ -e $(basename $<).wasm ]] ; then cp -v $(basename $<).wasm* $(dir $@); fi + if [ -e $(basename $<).wasm ] ; then cp -v $(basename $<).wasm* $(dir $@); fi cp $< $@ $(BUILD_WRAPPER)/browser/emscripten-module.js: CFLAGS_WASM+=$(CFLAGS_BROWSER) @@ -148,11 +147,11 @@ $(BUILD_WRAPPER)/%/emscripten-module.js: $(BUILD_WRAPPER)/interface.o $(VARIANT_ WASM_SYMBOLS=$(BUILD_WRAPPER)/symbols.json $(BUILD_WRAPPER)/asyncify-remove.json $(BUILD_WRAPPER)/asyncify-imports.json $(BUILD_WRAPPER)/%.o: $(WRAPPER_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(CFLAGS_SORTED_FUNCS) $(WRAPPER_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(WRAPPER_DEFINES) -c -o $@ $< $(BUILD_QUICKJS)/%.o: $(QUICKJS_ROOT)/%.c $(WASM_SYMBOLS) | $(EMCC_SRC) $(MKDIRP) - $(EMCC) $(CFLAGS_WASM) $(EMCC_EXPORTED_FUNCS) $(QUICKJS_DEFINES) -c -o $@ $< + $(EMCC) $(CFLAGS_WASM) $(QUICKJS_DEFINES) -c -o $@ $< $(BUILD_WRAPPER)/symbols.json: $(MKDIRP) diff --git a/yarn.lock b/yarn.lock index c7b58860..36155294 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,16 @@ __metadata: languageName: node linkType: hard +"@ampproject/remapping@npm:^2.3.0": + version: 2.3.0 + resolution: "@ampproject/remapping@npm:2.3.0" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: f3451525379c68a73eb0a1e65247fbf28c0cccd126d93af21c75fceff77773d43c0d4a2d51978fb131aff25b5f2cb41a9fe48cc296e61ae65e679c4f6918b0ab + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.23.4": version: 7.23.4 resolution: "@babel/helper-string-parser@npm:7.23.4" @@ -603,15 +613,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^29.6.3": - version: 29.6.3 - resolution: "@jest/schemas@npm:29.6.3" - dependencies: - "@sinclair/typebox": "npm:^0.27.8" - checksum: 910040425f0fc93cd13e68c750b7885590b8839066dfa0cd78e7def07bbb708ad869381f725945d66f2284de5663bbecf63e8fdd856e2ae6e261ba30b1687e93 - languageName: node - linkType: hard - "@jitl/quickjs-ffi-types@workspace:*, @jitl/quickjs-ffi-types@workspace:packages/quickjs-ffi-types": version: 0.0.0-use.local resolution: "@jitl/quickjs-ffi-types@workspace:packages/quickjs-ffi-types" @@ -797,6 +798,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": "npm:^1.2.1" + "@jridgewell/sourcemap-codec": "npm:^1.4.10" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 81587b3c4dd8e6c60252122937cea0c637486311f4ed208b52b62aae2e7a87598f63ec330e6cd0984af494bfb16d3f0d60d3b21d7e5b4aedd2602ff3fe9d32e2 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.1 resolution: "@jridgewell/resolve-uri@npm:3.1.1" @@ -811,6 +823,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.10": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" @@ -818,13 +837,30 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": +"@jridgewell/sourcemap-codec@npm:^1.4.14": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" checksum: 89960ac087781b961ad918978975bcdf2051cd1741880469783c42de64239703eab9db5230d776d8e6a09d73bb5e4cb964e07d93ee6e2e7aea5a7d726e865c09 languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.5.0": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 4ed6123217569a1484419ac53f6ea0d9f3b57e5b57ab30d7c267bdb27792a27eb0e4b08e84a2680aa55cc2f2b411ffd6ec3db01c44fdc6dc43aca4b55f8374fd + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.24": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: dced32160a44b49d531b80a4a2159dceab6b3ddf0c8e95a0deae4b0e894b172defa63d5ac52a19c2068e1fe7d31ea4ba931fbeec103233ecb4208953967120fc + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.20 resolution: "@jridgewell/trace-mapping@npm:0.3.20" @@ -1065,13 +1101,6 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.27.8": - version: 0.27.8 - resolution: "@sinclair/typebox@npm:0.27.8" - checksum: 297f95ff77c82c54de8c9907f186076e715ff2621c5222ba50b8d40a170661c0c5242c763cba2a4791f0f91cb1d8ffa53ea1d7294570cf8cd4694c0e383e484d - languageName: node - linkType: hard - "@types/emscripten@npm:^1.38.0": version: 1.38.0 resolution: "@types/emscripten@npm:1.38.0" @@ -1089,7 +1118,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.5": +"@types/estree@npm:*, @types/estree@npm:1.0.5, @types/estree@npm:^1.0.0": version: 1.0.5 resolution: "@types/estree@npm:1.0.5" checksum: 7de6d928dd4010b0e20c6919e1a6c27b61f8d4567befa89252055fad503d587ecb9a1e3eab1b1901f923964d7019796db810b7fd6430acb26c32866d126fd408 @@ -1272,56 +1301,66 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:1.1.0": - version: 1.1.0 - resolution: "@vitest/expect@npm:1.1.0" +"@vitest/expect@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/expect@npm:2.0.5" dependencies: - "@vitest/spy": "npm:1.1.0" - "@vitest/utils": "npm:1.1.0" - chai: "npm:^4.3.10" - checksum: 08d1ea192cf638da4b6f19e67642ea6a181593bca3c21ca8cb741d8d0792f95876281414b9cce0c0583701489a1ebbbdc4a83eec3012874bba3282d15664eaaa + "@vitest/spy": "npm:2.0.5" + "@vitest/utils": "npm:2.0.5" + chai: "npm:^5.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: ca9a218f50254b2259fd16166b2d8c9ccc8ee2cc068905e6b3d6281da10967b1590cc7d34b5fa9d429297f97e740450233745583b4cc12272ff11705faf70a37 languageName: node linkType: hard -"@vitest/runner@npm:1.1.0": - version: 1.1.0 - resolution: "@vitest/runner@npm:1.1.0" +"@vitest/pretty-format@npm:2.0.5, @vitest/pretty-format@npm:^2.0.5": + version: 2.0.5 + resolution: "@vitest/pretty-format@npm:2.0.5" dependencies: - "@vitest/utils": "npm:1.1.0" - p-limit: "npm:^5.0.0" - pathe: "npm:^1.1.1" - checksum: f21c503ea944cdafcf33160913759ae686739ccde7b36d060128a4f7387245019ab4508d825ddf51268aea6e72bc8afd4806ca6ba88f564274d5265229c8e91f + tinyrainbow: "npm:^1.2.0" + checksum: 70bf452dd0b8525e658795125b3f11110bd6baadfaa38c5bb91ca763bded35ec6dc80e27964ad4e91b91be6544d35e18ea7748c1997693988f975a7283c3e9a0 languageName: node linkType: hard -"@vitest/snapshot@npm:1.1.0": - version: 1.1.0 - resolution: "@vitest/snapshot@npm:1.1.0" +"@vitest/runner@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/runner@npm:2.0.5" dependencies: - magic-string: "npm:^0.30.5" - pathe: "npm:^1.1.1" - pretty-format: "npm:^29.7.0" - checksum: e4db6344019aae10fe880cecf0a058e22e4952172cc9bb2a8ea9fc41d3e32a3dc3e99520676cffd4d870ba77108e24f2d8ab1e391da423d21c2533e1933def5e + "@vitest/utils": "npm:2.0.5" + pathe: "npm:^1.1.2" + checksum: 464449abb84b3c779e1c6d1bedfc9e7469240ba3ccc4b4fa884386d1752d6572b68b9a87440159d433f17f61aca4012ee3bb78a3718d0e2bc64d810e9fc574a5 languageName: node linkType: hard -"@vitest/spy@npm:1.1.0": - version: 1.1.0 - resolution: "@vitest/spy@npm:1.1.0" +"@vitest/snapshot@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/snapshot@npm:2.0.5" dependencies: - tinyspy: "npm:^2.2.0" - checksum: 99d507df9e0f4224fa21b841721af2ed03d7538e534fb55627d5e8ba684b8659b79a1d46cfaa87d24121ce14fd0a93a04c01099e0758ba40fbdd6efebc4278d1 + "@vitest/pretty-format": "npm:2.0.5" + magic-string: "npm:^0.30.10" + pathe: "npm:^1.1.2" + checksum: fb46bc65851d4c8dcbbf86279c4146d5e7c17ad0d1be97132dedd98565d37f70ac8b0bf51ead0c6707786ffb15652535398c14d4304fa2146b0393d3db26fdff languageName: node linkType: hard -"@vitest/utils@npm:1.1.0": - version: 1.1.0 - resolution: "@vitest/utils@npm:1.1.0" +"@vitest/spy@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/spy@npm:2.0.5" + dependencies: + tinyspy: "npm:^3.0.0" + checksum: ed19f4c3bb4d3853241e8070979615138e24403ce4c137fa48c903b3af2c8b3ada2cc26aca9c1aa323bb314a457a8130a29acbb18dafd4e42737deefb2abf1ca + languageName: node + linkType: hard + +"@vitest/utils@npm:2.0.5": + version: 2.0.5 + resolution: "@vitest/utils@npm:2.0.5" dependencies: - diff-sequences: "npm:^29.6.3" - loupe: "npm:^2.3.7" - pretty-format: "npm:^29.7.0" - checksum: d1e5443b366664f244d8cbce8a36fcc74a5c784a97aeabd93511afc86c04acdd57414c16d97151656466626af9553cf10074618c16722fff88bbb7545186eeb8 + "@vitest/pretty-format": "npm:2.0.5" + estree-walker: "npm:^3.0.3" + loupe: "npm:^3.1.1" + tinyrainbow: "npm:^1.2.0" + checksum: d631d56d29c33bc8de631166b2b6691c470187a345469dfef7048befe6027e1c6ff9552f2ee11c8a247522c325c4a64bfcc73f8f0f0c525da39cb9f190f119f8 languageName: node linkType: hard @@ -1358,13 +1397,6 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.3.0": - version: 8.3.1 - resolution: "acorn-walk@npm:8.3.1" - checksum: 64187f1377afcba01ec6a57950e3f6a31fff50e429cdb9c9ab2c24343375e711f0d552e5fce5b6ecf21f754566e7526b6d79e4da80bd83c7ad15644d285b2ad5 - languageName: node - linkType: hard - "acorn@npm:^7.1.1": version: 7.4.1 resolution: "acorn@npm:7.4.1" @@ -1374,7 +1406,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.10.0, acorn@npm:^8.9.0": +"acorn@npm:^8.9.0": version: 8.11.2 resolution: "acorn@npm:8.11.2" bin: @@ -1451,13 +1483,6 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^5.0.0": - version: 5.2.0 - resolution: "ansi-styles@npm:5.2.0" - checksum: d7f4e97ce0623aea6bc0d90dcd28881ee04cba06c570b97fd3391bd7a268eedfd9d5e2dd4fdcbdd82b8105df5faf6f24aaedc08eaf3da898e702db5948f63469 - languageName: node - linkType: hard - "ansi-styles@npm:^6.1.0": version: 6.2.1 resolution: "ansi-styles@npm:6.2.1" @@ -1632,10 +1657,10 @@ __metadata: languageName: node linkType: hard -"assertion-error@npm:^1.1.0": - version: 1.1.0 - resolution: "assertion-error@npm:1.1.0" - checksum: fd9429d3a3d4fd61782eb3962ae76b6d08aa7383123fca0596020013b3ebd6647891a85b05ce821c47d1471ed1271f00b0545cf6a4326cf2fc91efcc3b0fbecf +"assertion-error@npm:^2.0.1": + version: 2.0.1 + resolution: "assertion-error@npm:2.0.1" + checksum: a0789dd882211b87116e81e2648ccb7f60340b34f19877dd020b39ebb4714e475eb943e14ba3e22201c221ef6645b7bfe10297e76b6ac95b48a9898c1211ce66 languageName: node linkType: hard @@ -1814,18 +1839,16 @@ __metadata: languageName: node linkType: hard -"chai@npm:^4.3.10": - version: 4.3.10 - resolution: "chai@npm:4.3.10" +"chai@npm:^5.1.1": + version: 5.1.1 + resolution: "chai@npm:5.1.1" dependencies: - assertion-error: "npm:^1.1.0" - check-error: "npm:^1.0.3" - deep-eql: "npm:^4.1.3" - get-func-name: "npm:^2.0.2" - loupe: "npm:^2.3.6" - pathval: "npm:^1.1.1" - type-detect: "npm:^4.0.8" - checksum: 9e545fd60f5efee4f06f7ad62f7b1b142932b08fbb3454db69defd511e7c58771ce51843764212da1e129b2c9d1b029fbf5f98da030fe67a95a0853e8679524f + assertion-error: "npm:^2.0.1" + check-error: "npm:^2.1.1" + deep-eql: "npm:^5.0.1" + loupe: "npm:^3.1.0" + pathval: "npm:^2.0.0" + checksum: ee67279a5613bd36dc1dc13660042429ae2f1dc5a9030a6abcf381345866dfb5bce7bc10b9d74c8de86b6f656489f654bbbef3f3361e06925591e6a00c72afff languageName: node linkType: hard @@ -1848,12 +1871,10 @@ __metadata: languageName: node linkType: hard -"check-error@npm:^1.0.3": - version: 1.0.3 - resolution: "check-error@npm:1.0.3" - dependencies: - get-func-name: "npm:^2.0.2" - checksum: e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 +"check-error@npm:^2.1.1": + version: 2.1.1 + resolution: "check-error@npm:2.1.1" + checksum: d785ed17b1d4a4796b6e75c765a9a290098cf52ff9728ce0756e8ffd4293d2e419dd30c67200aee34202463b474306913f2fcfaf1890641026d9fc6966fea27a languageName: node linkType: hard @@ -2448,6 +2469,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.5": + version: 4.3.6 + resolution: "debug@npm:4.3.6" + dependencies: + ms: "npm:2.1.2" + peerDependenciesMeta: + supports-color: + optional: true + checksum: d3adb9af7d57a9e809a68f404490cf776122acca16e6359a2702c0f462e510e91f9765c07f707b8ab0d91e03bad57328f3256f5082631cefb5393d0394d50fb7 + languageName: node + linkType: hard + "decamelize@npm:^2.0.0": version: 2.0.0 resolution: "decamelize@npm:2.0.0" @@ -2457,12 +2490,10 @@ __metadata: languageName: node linkType: hard -"deep-eql@npm:^4.1.3": - version: 4.1.3 - resolution: "deep-eql@npm:4.1.3" - dependencies: - type-detect: "npm:^4.0.0" - checksum: 12ce93ae63de187e77b076d3d51bfc28b11f98910a22c18714cce112791195e86a94f97788180994614b14562a86c9763f67c69f785e4586f806b5df39bf9301 +"deep-eql@npm:^5.0.1": + version: 5.0.2 + resolution: "deep-eql@npm:5.0.2" + checksum: a529b81e2ef8821621d20a36959a0328873a3e49d393ad11f8efe8559f31239494c2eb889b80342808674c475802ba95b9d6c4c27641b9a029405104c1b59fcf languageName: node linkType: hard @@ -2549,13 +2580,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^29.6.3": - version: 29.6.3 - resolution: "diff-sequences@npm:29.6.3" - checksum: 179daf9d2f9af5c57ad66d97cb902a538bcf8ed64963fa7aa0c329b3de3665ce2eb6ffdc2f69f29d445fa4af2517e5e55e5b6e00c00a9ae4f43645f97f7078cb - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -3154,6 +3178,15 @@ __metadata: languageName: node linkType: hard +"estree-walker@npm:^3.0.3": + version: 3.0.3 + resolution: "estree-walker@npm:3.0.3" + dependencies: + "@types/estree": "npm:^1.0.0" + checksum: a65728d5727b71de172c5df323385755a16c0fdab8234dc756c3854cfee343261ddfbb72a809a5660fac8c75d960bb3e21aa898c2d7e9b19bb298482ca58a3af + languageName: node + linkType: hard + "esutils@npm:^2.0.2": version: 2.0.3 resolution: "esutils@npm:2.0.3" @@ -3542,7 +3575,7 @@ __metadata: languageName: node linkType: hard -"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": +"get-func-name@npm:^2.0.1": version: 2.0.2 resolution: "get-func-name@npm:2.0.2" checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b @@ -4457,16 +4490,6 @@ __metadata: languageName: node linkType: hard -"local-pkg@npm:^0.5.0": - version: 0.5.0 - resolution: "local-pkg@npm:0.5.0" - dependencies: - mlly: "npm:^1.4.2" - pkg-types: "npm:^1.0.3" - checksum: 20f4caba50dc6fb00ffcc1a78bc94b5acb33995e0aadf4d4edcdeab257e891aa08f50afddf02f3240b2c3d02432bc2078f2a916a280ed716b64753a3d250db70 - languageName: node - linkType: hard - "locate-path@npm:^6.0.0": version: 6.0.0 resolution: "locate-path@npm:6.0.0" @@ -4504,12 +4527,12 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^2.3.6, loupe@npm:^2.3.7": - version: 2.3.7 - resolution: "loupe@npm:2.3.7" +"loupe@npm:^3.1.0, loupe@npm:^3.1.1": + version: 3.1.1 + resolution: "loupe@npm:3.1.1" dependencies: get-func-name: "npm:^2.0.1" - checksum: 635c8f0914c2ce7ecfe4e239fbaf0ce1d2c00e4246fafcc4ed000bfdb1b8f89d05db1a220054175cca631ebf3894872a26fffba0124477fcb562f78762848fb1 + checksum: 56d71d64c5af109aaf2b5343668ea5952eed468ed2ff837373810e417bf8331f14491c6e4d38e08ff84a29cb18906e06e58ba660c53bd00f2989e1873fa2f54c languageName: node linkType: hard @@ -4536,12 +4559,12 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.5": - version: 0.30.5 - resolution: "magic-string@npm:0.30.5" +"magic-string@npm:^0.30.10": + version: 0.30.11 + resolution: "magic-string@npm:0.30.11" dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.4.15" - checksum: c8a6b25f813215ca9db526f3a407d6dc0bf35429c2b8111d6f1c2cf6cf6afd5e2d9f9cd189416a0e3959e20ecd635f73639f9825c73de1074b29331fe36ace59 + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + checksum: b784d2240252f5b1e755d487354ada4c672cbca16f045144f7185a75b059210e5fcca7be7be03ef1bac2ca754c4428b21d36ae64a9057ba429916f06b8c54eb2 languageName: node linkType: hard @@ -4756,18 +4779,6 @@ __metadata: languageName: node linkType: hard -"mlly@npm:^1.2.0, mlly@npm:^1.4.2": - version: 1.4.2 - resolution: "mlly@npm:1.4.2" - dependencies: - acorn: "npm:^8.10.0" - pathe: "npm:^1.1.1" - pkg-types: "npm:^1.0.3" - ufo: "npm:^1.3.0" - checksum: ea5dc1a6cb2795cd15c6cdc84bbf431e0649917e673ef4de5d5ace6f74f74f02d22cd3c3faf7f868c3857115d33cccaaf5a070123b9a6c997af06ebeb8ab3bb5 - languageName: node - linkType: hard - "moment@npm:^2.24.0": version: 2.29.4 resolution: "moment@npm:2.29.4" @@ -5128,15 +5139,6 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^5.0.0": - version: 5.0.0 - resolution: "p-limit@npm:5.0.0" - dependencies: - yocto-queue: "npm:^1.0.0" - checksum: 87bf5837dee6942f0dbeff318436179931d9a97848d1b07dbd86140a477a5d2e6b90d9701b210b4e21fe7beaea2979dfde366e4f576fa644a59bd4d6a6371da7 - languageName: node - linkType: hard - "p-locate@npm:^5.0.0": version: 5.0.0 resolution: "p-locate@npm:5.0.0" @@ -5221,17 +5223,17 @@ __metadata: languageName: node linkType: hard -"pathe@npm:^1.1.0, pathe@npm:^1.1.1": - version: 1.1.1 - resolution: "pathe@npm:1.1.1" - checksum: 603decdf751d511f0df10acb8807eab8cc25c1af529e6149e27166916f19db57235a7d374b125452ba6da4dd0f697656fdaf5a9236b3594929bb371726d31602 +"pathe@npm:^1.1.2": + version: 1.1.2 + resolution: "pathe@npm:1.1.2" + checksum: f201d796351bf7433d147b92c20eb154a4e0ea83512017bf4ec4e492a5d6e738fb45798be4259a61aa81270179fce11026f6ff0d3fa04173041de044defe9d80 languageName: node linkType: hard -"pathval@npm:^1.1.1": - version: 1.1.1 - resolution: "pathval@npm:1.1.1" - checksum: b50a4751068aa3a5428f5a0b480deecedc6f537666a3630a0c2ae2d5e7c0f4bf0ee77b48404441ec1220bef0c91625e6030b3d3cf5a32ab0d9764018d1d9dbb6 +"pathval@npm:^2.0.0": + version: 2.0.0 + resolution: "pathval@npm:2.0.0" + checksum: b91575bf9cdf01757afd7b5e521eb8a0b874a49bc972d08e0047cfea0cd3c019f5614521d4bc83d2855e3fcc331db6817dfd533dd8f3d90b16bc76fad2450fc1 languageName: node linkType: hard @@ -5242,13 +5244,6 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: a2e8092dd86c8396bdba9f2b5481032848525b3dc295ce9b57896f931e63fc16f79805144321f72976383fc249584672a75cc18d6777c6b757603f372f745981 - languageName: node - linkType: hard - "picocolors@npm:^1.0.1": version: 1.0.1 resolution: "picocolors@npm:1.0.1" @@ -5277,17 +5272,6 @@ __metadata: languageName: node linkType: hard -"pkg-types@npm:^1.0.3": - version: 1.0.3 - resolution: "pkg-types@npm:1.0.3" - dependencies: - jsonc-parser: "npm:^3.2.0" - mlly: "npm:^1.2.0" - pathe: "npm:^1.1.0" - checksum: e17e1819ce579c9ea390e4c41a9ed9701d8cff14b463f9577cc4f94688da8917c66dabc40feacd47a21eb3de9b532756a78becd882b76add97053af307c1240a - languageName: node - linkType: hard - "postcss-load-config@npm:^4.0.1": version: 4.0.2 resolution: "postcss-load-config@npm:4.0.2" @@ -5333,17 +5317,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.7.0": - version: 29.7.0 - resolution: "pretty-format@npm:29.7.0" - dependencies: - "@jest/schemas": "npm:^29.6.3" - ansi-styles: "npm:^5.0.0" - react-is: "npm:^18.0.0" - checksum: dea96bc83c83cd91b2bfc55757b6b2747edcaac45b568e46de29deee80742f17bc76fe8898135a70d904f4928eafd8bb693cd1da4896e8bdd3c5e82cadf1d2bb - languageName: node - linkType: hard - "process-nextick-args@npm:~2.0.0": version: 2.0.1 resolution: "process-nextick-args@npm:2.0.1" @@ -5574,7 +5547,7 @@ __metadata: typedoc-plugin-markdown: "npm:4.0.0-next.38" typescript: "npm:^5.3.3" vite-tsconfig-paths: "npm:^4.2.2" - vitest: "npm:^1.1.0" + vitest: "npm:2.0.5" languageName: unknown linkType: soft @@ -5611,13 +5584,6 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^18.0.0": - version: 18.2.0 - resolution: "react-is@npm:18.2.0" - checksum: 200cd65bf2e0be7ba6055f647091b725a45dd2a6abef03bf2380ce701fd5edccee40b49b9d15edab7ac08a762bf83cb4081e31ec2673a5bfb549a36ba21570df - languageName: node - linkType: hard - "readable-stream@npm:1.1.x": version: 1.1.14 resolution: "readable-stream@npm:1.1.14" @@ -6237,7 +6203,7 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.5.0": +"std-env@npm:^3.7.0": version: 3.7.0 resolution: "std-env@npm:3.7.0" checksum: 6ee0cca1add3fd84656b0002cfbc5bfa20340389d9ba4720569840f1caa34bce74322aef4c93f046391583e50649d0cf81a5f8fe1d411e50b659571690a45f12 @@ -6407,15 +6373,6 @@ __metadata: languageName: node linkType: hard -"strip-literal@npm:^1.3.0": - version: 1.3.0 - resolution: "strip-literal@npm:1.3.0" - dependencies: - acorn: "npm:^8.10.0" - checksum: f5fa7e289df8ebe82e90091fd393974faf8871be087ca50114327506519323cf15f2f8fee6ebe68b5e58bfc795269cae8bdc7cb5a83e27b02b3fe953f37b0a89 - languageName: node - linkType: hard - "stylis@npm:^4.1.2": version: 4.3.0 resolution: "stylis@npm:4.3.0" @@ -6496,24 +6453,31 @@ __metadata: languageName: node linkType: hard -"tinybench@npm:^2.5.1": - version: 2.5.1 - resolution: "tinybench@npm:2.5.1" - checksum: f64ea142e048edc5010027eca36aff5aef74cd849ab9c6ba6e39475f911309694cb5a7ff894d47216ab4a3abcf4291e4bdc7a57796e96bf5b06e67452b5ac54d +"tinybench@npm:^2.8.0": + version: 2.9.0 + resolution: "tinybench@npm:2.9.0" + checksum: cfa1e1418e91289219501703c4693c70708c91ffb7f040fd318d24aef419fb5a43e0c0160df9471499191968b2451d8da7f8087b08c3133c251c40d24aced06c languageName: node linkType: hard -"tinypool@npm:^0.8.1": - version: 0.8.1 - resolution: "tinypool@npm:0.8.1" - checksum: 3fae8acc22b7d0364eb202b64f61f0d8b10dcead6bef9b8fab1836857dcecd0e34fadc47ab309754ead2cb29bfa4b3467a9fc0daae23669b19ff403ae1364b5c +"tinypool@npm:^1.0.0": + version: 1.0.1 + resolution: "tinypool@npm:1.0.1" + checksum: eaceb93784b8e27e60c0e3e2c7d11c29e1e79b2a025b2c232215db73b90fe22bd4753ad53fc8e801c2b5a63b94a823af549555d8361272bc98271de7dd4a9925 languageName: node linkType: hard -"tinyspy@npm:^2.2.0": - version: 2.2.0 - resolution: "tinyspy@npm:2.2.0" - checksum: bcc5a08c2dc7574d32e6dcc2e760ad95a3cf30249c22799815b6389179427c95573d27d2d965ebc5fca2b6d338c46678cd7337ea2a9cebacee3dc662176b07cb +"tinyrainbow@npm:^1.2.0": + version: 1.2.0 + resolution: "tinyrainbow@npm:1.2.0" + checksum: 2924444db6804355e5ba2b6e586c7f77329d93abdd7257a069a0f4530dff9f16de484e80479094e3f39273462541b003a65ee3a6afc2d12555aa745132deba5d + languageName: node + linkType: hard + +"tinyspy@npm:^3.0.0": + version: 3.0.0 + resolution: "tinyspy@npm:3.0.0" + checksum: b5b686acff2b88de60ff8ecf89a2042320406aaeee2fba1828a7ea8a925fad3ed9f5e4d7a068154a9134473c472aa03da8ca92ee994bc57a741c5ede5fa7de4d languageName: node linkType: hard @@ -6704,13 +6668,6 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:^4.0.0, type-detect@npm:^4.0.8": - version: 4.0.8 - resolution: "type-detect@npm:4.0.8" - checksum: 5179e3b8ebc51fce1b13efb75fdea4595484433f9683bbc2dca6d99789dba4e602ab7922d2656f2ce8383987467f7770131d4a7f06a26287db0615d2f4c4ce7d - languageName: node - linkType: hard - "type-fest@npm:^0.20.2": version: 0.20.2 resolution: "type-fest@npm:0.20.2" @@ -6836,13 +6793,6 @@ __metadata: languageName: node linkType: hard -"ufo@npm:^1.3.0": - version: 1.3.2 - resolution: "ufo@npm:1.3.2" - checksum: 7133290d495e2b3f9416de69982019e81cff40d28cfd3a07accff1122ee52f23d9165e495a140a1b34b183244e88fc4001cb649591385ecbad1d3d0d2264fa6e - languageName: node - linkType: hard - "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -6935,18 +6885,18 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:1.1.0": - version: 1.1.0 - resolution: "vite-node@npm:1.1.0" +"vite-node@npm:2.0.5": + version: 2.0.5 + resolution: "vite-node@npm:2.0.5" dependencies: cac: "npm:^6.7.14" - debug: "npm:^4.3.4" - pathe: "npm:^1.1.1" - picocolors: "npm:^1.0.0" + debug: "npm:^4.3.5" + pathe: "npm:^1.1.2" + tinyrainbow: "npm:^1.2.0" vite: "npm:^5.0.0" bin: vite-node: vite-node.mjs - checksum: 2978b2fa7091233c234a86d60be6d6b407748471ae7b0e10a93ccd707ed2c888f04bc1c0e0737fa243f85e8477c18d6ed998b5bf67fd42cdd8778cc9cd40868c + checksum: de259cdf4b9ff82f39ba92ffca99db8a80783efd2764d3553b62cd8c8864488d590114a75bc93a93bf5ba2a2086bea1bee4b0029da9e62c4c0d3bf6c1f364eed languageName: node linkType: hard @@ -7006,36 +6956,34 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^1.1.0": - version: 1.1.0 - resolution: "vitest@npm:1.1.0" - dependencies: - "@vitest/expect": "npm:1.1.0" - "@vitest/runner": "npm:1.1.0" - "@vitest/snapshot": "npm:1.1.0" - "@vitest/spy": "npm:1.1.0" - "@vitest/utils": "npm:1.1.0" - acorn-walk: "npm:^8.3.0" - cac: "npm:^6.7.14" - chai: "npm:^4.3.10" - debug: "npm:^4.3.4" +"vitest@npm:2.0.5": + version: 2.0.5 + resolution: "vitest@npm:2.0.5" + dependencies: + "@ampproject/remapping": "npm:^2.3.0" + "@vitest/expect": "npm:2.0.5" + "@vitest/pretty-format": "npm:^2.0.5" + "@vitest/runner": "npm:2.0.5" + "@vitest/snapshot": "npm:2.0.5" + "@vitest/spy": "npm:2.0.5" + "@vitest/utils": "npm:2.0.5" + chai: "npm:^5.1.1" + debug: "npm:^4.3.5" execa: "npm:^8.0.1" - local-pkg: "npm:^0.5.0" - magic-string: "npm:^0.30.5" - pathe: "npm:^1.1.1" - picocolors: "npm:^1.0.0" - std-env: "npm:^3.5.0" - strip-literal: "npm:^1.3.0" - tinybench: "npm:^2.5.1" - tinypool: "npm:^0.8.1" + magic-string: "npm:^0.30.10" + pathe: "npm:^1.1.2" + std-env: "npm:^3.7.0" + tinybench: "npm:^2.8.0" + tinypool: "npm:^1.0.0" + tinyrainbow: "npm:^1.2.0" vite: "npm:^5.0.0" - vite-node: "npm:1.1.0" - why-is-node-running: "npm:^2.2.2" + vite-node: "npm:2.0.5" + why-is-node-running: "npm:^2.3.0" peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": ^1.0.0 - "@vitest/ui": ^1.0.0 + "@vitest/browser": 2.0.5 + "@vitest/ui": 2.0.5 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -7053,7 +7001,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 5e4ac0231b2dc9cf51892e0414c7ab092e70bf5eacdb9c4a8cdd941bdd325544eb4ffe8eb89586aa6e399f9a34739f330482c64c13300bf1b7c5b130101d7e7c + checksum: abb916e3496a3fa9e9d05ecd806332dc4000aa0e433f0cb1e99f9dd1fa5c06d2c66656874b9860a683cec0f32abe1519599babef02e5c0ca80e9afbcdbddfdbd languageName: node linkType: hard @@ -7147,15 +7095,15 @@ __metadata: languageName: node linkType: hard -"why-is-node-running@npm:^2.2.2": - version: 2.2.2 - resolution: "why-is-node-running@npm:2.2.2" +"why-is-node-running@npm:^2.3.0": + version: 2.3.0 + resolution: "why-is-node-running@npm:2.3.0" dependencies: siginfo: "npm:^2.0.0" stackback: "npm:0.0.2" bin: why-is-node-running: cli.js - checksum: f3582e0337f4b25537d492b1d40f00b978ce04b1d1eeea8f310bfa8aae8a7d11d118d672e2f0760c164ce3753a620a70aa29ff3620e340197624940cf9c08615 + checksum: 0de6e6cd8f2f94a8b5ca44e84cf1751eadcac3ebedcdc6e5fbbe6c8011904afcbc1a2777c53496ec02ced7b81f2e7eda61e76bf8262a8bc3ceaa1f6040508051 languageName: node linkType: hard @@ -7272,10 +7220,3 @@ __metadata: checksum: f77b3d8d00310def622123df93d4ee654fc6a0096182af8bd60679ddcdfb3474c56c6c7190817c84a2785648cdee9d721c0154eb45698c62176c322fb46fc700 languageName: node linkType: hard - -"yocto-queue@npm:^1.0.0": - version: 1.0.0 - resolution: "yocto-queue@npm:1.0.0" - checksum: 2cac84540f65c64ccc1683c267edce396b26b1e931aa429660aefac8fbe0188167b7aee815a3c22fa59a28a58d898d1a2b1825048f834d8d629f4c2a5d443801 - languageName: node - linkType: hard