From cdc73d04d89b6e786765c6cc6723ae1799575db3 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 24 Aug 2024 21:02:43 -0400 Subject: [PATCH 01/43] getOwnPropertyNames flags --- packages/quickjs-emscripten-core/src/types.ts | 32 +++++++++++++++++++ .../quickjs-emscripten-core/tsconfig.json | 6 +++- packages/quickjs-ffi-types/src/ffi-types.ts | 18 ++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 1ee5a9f4..434d0c15 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -283,6 +283,38 @@ export function evalOptionsToFlags(evalOptions: ContextEvalOptions | number | un return flags } +export interface GetOwnPropertyNamesOptions { + /** Include strings in the result */ + includeStrings?: boolean + /** Include symbols in the result */ + includeSymbols?: boolean + /** Include private properties in the result */ + includePrivate?: boolean + /** Only include the enumerable properties */ + onlyEnumerable?: boolean +} + +/** Convert {@link GetOwnPropertyNamesOptions} to bitfield flags */ +export function getOwnPropertyNamesOptionsToFlags( + options: GetOwnPropertyNamesOptions | number | undefined, +): number { + if (typeof options === "number") { + return options + } + + if (options === undefined) { + return 0 + } + + const { includeStrings, includeSymbols, includePrivate, onlyEnumerable } = 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 + return flags +} + export type PromiseExecutor = ( resolve: (value: ResolveT | PromiseLike) => void, reject: (reason: RejectT) => void, diff --git a/packages/quickjs-emscripten-core/tsconfig.json b/packages/quickjs-emscripten-core/tsconfig.json index b8c45f7e..bb1dba32 100644 --- a/packages/quickjs-emscripten-core/tsconfig.json +++ b/packages/quickjs-emscripten-core/tsconfig.json @@ -3,6 +3,10 @@ "include": ["src/**/*"], "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "paths": { + "@jitl/quickjs-ffi-types": ["../quickjs-ffi-types/src"], + "@jitl/quickjs-ffi-types/*": ["../quickjs-ffi-types/src/*"] + } } } diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index cae418db..e17effa7 100644 --- a/packages/quickjs-ffi-types/src/ffi-types.ts +++ b/packages/quickjs-ffi-types/src/ffi-types.ts @@ -108,6 +108,11 @@ export type IntrinsicsFlags = Brand */ export type EvalDetectModule = Brand +/** + * @private + */ +export type GetOwnPropertyNamesFlags = Brand + /** * State of a promise. */ @@ -151,7 +156,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 +181,14 @@ 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, +} From 9bec8c7d1e9755512383870a2cc0edf5aaec94a9 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 10:45:42 -0400 Subject: [PATCH 02/43] getLength --- c/interface.c | 23 +++++++++++++ .../quickjs-emscripten-core/src/context.ts | 31 +++++++++++++++-- .../quickjs-emscripten-core/src/memory.ts | 33 ++++++++++++++++--- .../quickjs-emscripten/src/quickjs.test.ts | 8 +++++ packages/quickjs-emscripten/tsconfig.json | 4 ++- packages/quickjs-ffi-types/src/ffi-async.ts | 16 +++++++++ packages/quickjs-ffi-types/src/ffi-types.ts | 2 ++ packages/quickjs-ffi-types/src/ffi.ts | 11 +++++++ .../src/ffi.ts | 20 +++++++++++ 9 files changed, 139 insertions(+), 9 deletions(-) diff --git a/c/interface.c b/c/interface.c index 68a2408e..8f5e4dfd 100644 --- a/c/interface.c +++ b/c/interface.c @@ -548,6 +548,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); @@ -819,6 +824,24 @@ OwnedHeapChar *QTS_Typeof(JSContext *ctx, JSValueConst *value) { return out; } +int QTS_GetLength(JSContext *ctx, uint32_t *out_len, JSValueConst *value) { + JSValue len_val; + int result; + + if (!JS_IsObject(*value)) { + return -1; + } + + len_val = JS_GetProperty(ctx, *value, JS_ATOM_length); + if (JS_IsException(len_val)) { + return -1; + } + + result = JS_ToUint32(ctx, out_len, len_val); + JS_FreeValue(ctx, len_val); + return result; +} + JSValue *QTS_GetGlobalObject(JSContext *ctx) { return jsvalue_to_heap(JS_GetGlobalObject(ctx)); } diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 9cc15541..e8799639 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -10,6 +10,7 @@ import type { JSValuePointer, JSValuePointerPointer, EitherFFI, + UInt32Pointer, } from "@jitl/quickjs-ffi-types" import { debugLog } from "./debug" import type { JSPromiseState } from "./deferred-promise" @@ -19,6 +20,7 @@ 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 type { HeapTypedArray } from "./memory" import { ModuleMemory } from "./memory" import type { ContextCallbacks, QuickJSModuleCallbacks } from "./module" import type { @@ -174,6 +176,8 @@ export class QuickJSContext protected _global: QuickJSHandle | undefined = undefined /** @private */ protected _BigInt: QuickJSHandle | undefined = undefined + /** @private */ + protected uint32Out: HeapTypedArray /** * Use {@link QuickJSRuntime#newContext} or {@link QuickJSWASMModule#newContext} @@ -203,6 +207,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 ---------------------------------------------------- @@ -748,14 +755,32 @@ 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`. + */ + 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] + } + /** * `handle[key] = value`. * Set a property on a JSValue. diff --git a/packages/quickjs-emscripten-core/src/memory.ts b/packages/quickjs-emscripten-core/src/memory.ts index fb59f901..9d4bb8a2 100644 --- a/packages/quickjs-emscripten-core/src/memory.ts +++ b/packages/quickjs-emscripten-core/src/memory.ts @@ -17,6 +17,21 @@ type HeapUint8Array = { numBytes: number } +// Add more types as needed. +type TypedArray = Int32Array | Uint32Array + +interface TypedArrayConstructor { + new (length: number): T + new (array: ArrayLike | ArrayBufferLike): T + new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): T + BYTES_PER_ELEMENT: number +} + +export type HeapTypedArray = Lifetime<{ + typedArray: JS + ptr: C +}> + /** * @private */ @@ -32,17 +47,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/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index cd748b11..fb56db41 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -359,6 +359,14 @@ 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(".unwrapResult", () => { diff --git a/packages/quickjs-emscripten/tsconfig.json b/packages/quickjs-emscripten/tsconfig.json index 16ddb588..fc0bd90d 100644 --- a/packages/quickjs-emscripten/tsconfig.json +++ b/packages/quickjs-emscripten/tsconfig.json @@ -5,7 +5,9 @@ "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-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 744e4a09..25212e6d 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -16,6 +16,7 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, @@ -119,6 +120,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, @@ -189,6 +200,11 @@ export interface QuickJSAsyncFFI { ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + value: JSValuePointer | JSValueConstPointer, + ) => number QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer QTS_NewPromiseCapability: ( ctx: JSContextPointer, diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index e17effa7..a25cf370 100644 --- a/packages/quickjs-ffi-types/src/ffi-types.ts +++ b/packages/quickjs-ffi-types/src/ffi-types.ts @@ -93,6 +93,8 @@ export type JSBorrowedCharPointer = Pointer<"js const char"> */ export type JSVoidPointer = Pointer +export type UInt32Pointer = Pointer<"uint32_t"> + /** * @private */ diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index 07cbd5d8..2c812078 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -16,6 +16,7 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, @@ -104,6 +105,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, @@ -149,6 +155,11 @@ export interface QuickJSFFI { ctx: JSContextPointer, value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + value: JSValuePointer | JSValueConstPointer, + ) => number QTS_GetGlobalObject: (ctx: JSContextPointer) => JSValuePointer QTS_NewPromiseCapability: ( ctx: JSContextPointer, 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..854236e8 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -16,6 +16,7 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, @@ -245,6 +246,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, From 76c28abffec7f8f64402ff88ff91c640855ea379 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 10:47:54 -0400 Subject: [PATCH 03/43] getPropNames, QuicJSIterator --- c/interface.c | 16 ++ .../src/QuickJSIterator.ts | 144 ++++++++++++++++++ .../quickjs-emscripten-core/src/context.ts | 120 +++++++++++++-- .../quickjs-emscripten-core/src/lifetime.ts | 45 ++++++ .../quickjs-emscripten-core/src/memory.ts | 2 - packages/quickjs-emscripten-core/src/types.ts | 10 +- .../quickjs-emscripten/src/quickjs.test.ts | 66 ++++++++ packages/quickjs-ffi-types/src/ffi-async.ts | 15 ++ packages/quickjs-ffi-types/src/ffi.ts | 8 + 9 files changed, 409 insertions(+), 17 deletions(-) create mode 100644 packages/quickjs-emscripten-core/src/QuickJSIterator.ts diff --git a/c/interface.c b/c/interface.c index 8f5e4dfd..39f0a78c 100644 --- a/c/interface.c +++ b/c/interface.c @@ -591,6 +591,22 @@ void QTS_DefineProp(JSContext *ctx, JSValueConst *this_val, JSValueConst *prop_n JS_FreeAtom(ctx, prop_atom); } +MaybeAsync(JSValue *) QTS_GetOwnPropertyNames(JSContext *ctx, JSValue **out_ptrs, uint32_t *out_len, JSValueConst *obj, int flags) { + JSPropertyEnum *tab = NULL; + int status = 0; + status = JS_GetOwnPropertyNames(ctx, &tab, out_len, *obj, flags); + if (status < 0) { + return jsvalue_to_heap(JS_GetException(ctx)); + } + *out_ptrs = malloc(sizeof(JSValue) * *out_len); + for (int i = 0; i < *out_len; i++) { + (*out_ptrs)[i] = jsvalue_to_heap(JS_AtomToValue(ctx, tab[i].atom)); + JS_FreeAtom(ctx, tab[i].atom); + } + js_free(ctx, tab); + 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]; diff --git a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts new file mode 100644 index 00000000..f7643aaa --- /dev/null +++ b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts @@ -0,0 +1,144 @@ +import type { QuickJSContext } from "./context" +import { Lifetime, UsingDisposable } from "./lifetime" +import type { QuickJSRuntime } from "./runtime" +import type { QuickJSHandle } from "./types" +import type { VmCallResult } from "./vm-interface" + +/** + * 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, Iterator> +{ + public owner: QuickJSRuntime + private _next: QuickJSHandle | undefined + private _isDone = false + + constructor( + public handle: QuickJSHandle, + public context: QuickJSContext, + ) { + super() + this.owner = context.runtime + } + + 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: { value }, + done, + } + } +} diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index e8799639..71827c4e 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -18,8 +18,15 @@ 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 type { Disposable, DisposableArray } from "./lifetime" +import { + Lifetime, + Scope, + StaticLifetime, + UsingDisposable, + WeakLifetime, + createDisposableArray, +} from "./lifetime" import type { HeapTypedArray } from "./memory" import { ModuleMemory } from "./memory" import type { ContextCallbacks, QuickJSModuleCallbacks } from "./module" @@ -28,8 +35,15 @@ 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 { + ContextEvalOptions, + GetOwnPropertyNamesOptions, + JSValue, + PromiseExecutor, + QuickJSHandle, + StaticJSValue, +} from "./types" +import { evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" import type { LowLevelJavascriptVm, SuccessOrFail, @@ -37,6 +51,7 @@ import type { VmFunctionImplementation, VmPropertyDescriptor, } from "./vm-interface" +import { QuickJSIterator } from "./QuickJSIterator" /** * Property key for getting or setting a property on a handle with @@ -109,6 +124,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 + } } /** @@ -178,6 +202,12 @@ export class QuickJSContext 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} @@ -297,12 +327,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 } @@ -349,6 +374,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. */ @@ -781,6 +814,73 @@ export class QuickJSContext 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). + */ + getPropNames( + handle: QuickJSHandle, + options: GetOwnPropertyNamesOptions, + ): SuccessOrFail, QuickJSHandle> { + this.runtime.assertOwned(handle) + handle.value // assert alive + const flags = getOwnPropertyNamesOptionsToFlags(options) + 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 { error: 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.module._free(ptr) + return { value: 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 (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() + * } + * } + * ``` + */ + getIterator(handle: QuickJSHandle): SuccessOrFail { + const SymbolIterator = (this._SymbolIterator ??= this.memory.manage( + this.getWellKnownSymbol("iterator"), + )) + return Scope.withScope((scope) => { + const methodHandle = scope.manage(this.getProp(handle, SymbolIterator)) + const iteratorCallResult = this.callFunction(methodHandle, handle) + if (iteratorCallResult.error) { + return iteratorCallResult + } + return { value: new QuickJSIterator(iteratorCallResult.value, this) } + }) + } + /** * `handle[key] = value`. * Set a property on a JSValue. diff --git a/packages/quickjs-emscripten-core/src/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 54b2b068..37c4fa06 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -318,3 +318,48 @@ 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 +} diff --git a/packages/quickjs-emscripten-core/src/memory.ts b/packages/quickjs-emscripten-core/src/memory.ts index 9d4bb8a2..8447807d 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" diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 434d0c15..4e2ec885 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" @@ -296,14 +296,14 @@ export interface GetOwnPropertyNamesOptions { /** Convert {@link GetOwnPropertyNamesOptions} to bitfield flags */ export function getOwnPropertyNamesOptionsToFlags( - options: GetOwnPropertyNamesOptions | number | undefined, -): number { + options: GetOwnPropertyNamesOptions | GetOwnPropertyNamesFlags | undefined, +): GetOwnPropertyNamesFlags { if (typeof options === "number") { return options } if (options === undefined) { - return 0 + return 0 as GetOwnPropertyNamesFlags } const { includeStrings, includeSymbols, includePrivate, onlyEnumerable } = options @@ -312,7 +312,7 @@ export function getOwnPropertyNamesOptionsToFlags( if (includeSymbols) flags |= GetOwnPropertyNamesFlags.JS_GPN_SYMBOL_MASK if (includePrivate) flags |= GetOwnPropertyNamesFlags.JS_GPN_PRIVATE_MASK if (onlyEnumerable) flags |= GetOwnPropertyNamesFlags.JS_GPN_ENUM_ONLY - return flags + return flags as GetOwnPropertyNamesFlags } export type PromiseExecutor = ( diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index fb56db41..e8ce090b 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -369,6 +369,72 @@ function contextTests(getContext: GetTestContext, isDebug = false) { }) }) + describe("getPropNames", () => { + it("gets array indexes as *numbers*", () => { + const array = vm.newArray() + vm.setProp(array, 0, vm.undefined) + vm.setProp(array, 1, vm.undefined) + vm.setProp(array, 2, vm.undefined) + + const props = vm.unwrapResult( + vm.getPropNames(array, { + onlyEnumerable: true, + }), + ) + + 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) + props.dispose() + }) + + it("gets object keys as *strings*, but does not include symbols", () => { + const obj = vm.newObject() + vm.setProp(obj, "a", vm.undefined) + vm.setProp(obj, "b", vm.undefined) + vm.setProp(obj, "c", vm.undefined) + const sym = vm.newUniqueSymbol("d") + vm.setProp(obj, sym, vm.undefined) + + const props = vm.unwrapResult( + vm.getPropNames(obj, { + onlyEnumerable: true, + includeStrings: true, + }), + ) + + 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") + props.dispose() + }) + + it('gets object keys that are symbols only when "includeSymbols" is true', () => { + const obj = vm.newObject() + const symA = vm.newUniqueSymbol("a") + const symB = vm.newUniqueSymbol("b") + const symC = vm.newUniqueSymbol("c") + vm.setProp(obj, symA, vm.undefined) + vm.setProp(obj, symB, vm.undefined) + vm.setProp(obj, symC, vm.undefined) + + const props = vm.unwrapResult( + vm.getPropNames(obj, { + onlyEnumerable: true, + includeSymbols: true, + }), + ) + + assert.strictEqual(props.length, 3) + assert.strictEqual(vm.dump(props[0]), symA) + assert.strictEqual(vm.dump(props[1]), symB) + assert.strictEqual(vm.dump(props[2]), symC) + props.dispose() + }) + }) + describe(".unwrapResult", () => { it("successful result: returns the value", () => { const handle = vm.newString("OK!") diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 25212e6d..adbcb883 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -20,6 +20,7 @@ import { EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "." @@ -153,6 +154,20 @@ export interface QuickJSAsyncFFI { enumerable: boolean, has_value: boolean, ) => void + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer + QTS_GetOwnPropertyNames_MaybeAsync: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer | Promise QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index 2c812078..031439c5 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -20,6 +20,7 @@ import { EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "." @@ -127,6 +128,13 @@ export interface QuickJSFFI { enumerable: boolean, has_value: boolean, ) => void + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + obj: JSValuePointer | JSValueConstPointer, + flags: number, + ) => JSValuePointer QTS_Call: ( ctx: JSContextPointer, func_obj: JSValuePointer | JSValueConstPointer, From b6d01ba6d19d4e19f11abd5ea46efc62d8491686 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 10:48:49 -0400 Subject: [PATCH 04/43] isEqual --- c/interface.c | 18 +++++++++ .../quickjs-emscripten-core/src/context.ts | 40 +++++++++++++++++++ packages/quickjs-emscripten-core/src/types.ts | 6 +++ packages/quickjs-ffi-types/src/ffi-async.ts | 6 +++ packages/quickjs-ffi-types/src/ffi.ts | 6 +++ 5 files changed, 76 insertions(+) diff --git a/c/interface.c b/c/interface.c index 39f0a78c..0c154555 100644 --- a/c/interface.c +++ b/c/interface.c @@ -858,6 +858,24 @@ int QTS_GetLength(JSContext *ctx, uint32_t *out_len, JSValueConst *value) { 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) { + 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); + } +} + JSValue *QTS_GetGlobalObject(JSContext *ctx) { return jsvalue_to_heap(JS_GetGlobalObject(ctx)); } diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 71827c4e..566ee52b 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -37,6 +37,7 @@ import type { } from "./runtime" import { ContextEvalOptions, + IsEqualOp, GetOwnPropertyNamesOptions, JSValue, PromiseExecutor, @@ -777,6 +778,45 @@ export class QuickJSContext }) } + // 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) + return Boolean(this.ffi.QTS_IsEqual(this.ctx.value, a.value, b.value, equalityType)) + } + + /** + * `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 --------------------------------------------------------------- /** diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 4e2ec885..a4700116 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -329,3 +329,9 @@ export function concat(...values: Array): T[] { } return result } + +export enum IsEqualOp { + IsStrictlyEqual = 0, + IsSameValue = 1, + IsSameValueZero = 2, +} diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index adbcb883..5c91f999 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -220,6 +220,12 @@ export interface QuickJSAsyncFFI { out_len: uint32_tPointer, 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, diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index 031439c5..e5adc0a9 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -168,6 +168,12 @@ export interface QuickJSFFI { out_len: uint32_tPointer, 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, From b2a0af5d1615dd7910fc9edac89e70342f6805c1 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 10:49:07 -0400 Subject: [PATCH 05/43] wip codegen --- .../src/ffi.ts | 43 +++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 61 ++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 63 +++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 61 ++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 63 +++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 61 ++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 63 +++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 61 ++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 63 +++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ .../src/ffi.ts | 61 ++++++++++++++++++ .../src/ffi.ts | 39 ++++++++++++ 20 files changed, 990 insertions(+) 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 854236e8..877686fa 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -20,6 +20,7 @@ import { EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,6 +309,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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, @@ -393,6 +423,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..130d3701 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..bea0e360 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +244,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 +305,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +420,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..d33ddb59 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..877686fa 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +247,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 +309,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +423,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..130d3701 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..bea0e360 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +244,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 +305,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +420,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..d33ddb59 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..877686fa 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +247,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 +309,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +423,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..130d3701 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..bea0e360 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +244,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 +305,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +420,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..d33ddb59 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..877686fa 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +247,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 +309,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +423,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..130d3701 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..bea0e360 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +244,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 +305,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +420,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", 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..d33ddb59 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index bf43a784..877686fa 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -245,6 +247,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 +309,35 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +423,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", diff --git a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index b3b252d2..130d3701 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index 0c2d1f03..bea0e360 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -242,6 +244,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 +305,34 @@ export class QuickJSAsyncFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +420,19 @@ export class QuickJSAsyncFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 2aefcf0c..d33ddb59 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -16,9 +16,11 @@ import { OwnedHeapCharPointer, JSBorrowedCharPointer, JSVoidPointer, + UInt32Pointer, EvalFlags, IntrinsicsFlags, EvalDetectModule, + GetOwnPropertyNamesFlags, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -213,6 +215,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 +254,20 @@ export class QuickJSFFI { "boolean", ]) + QTS_GetOwnPropertyNames: ( + ctx: JSContextPointer, + out_ptrs: JSValuePointerPointer, + out_len: uint32_tPointer, + 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 +316,19 @@ export class QuickJSFFI { value: JSValuePointer | JSValueConstPointer, ) => OwnedHeapCharPointer = this.module.cwrap("QTS_Typeof", "number", ["number", "number"]) + QTS_GetLength: ( + ctx: JSContextPointer, + out_len: uint32_tPointer, + 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", From 6d264b88a0f7414eab9b38b4877498de3db53cf6 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:04:58 -0400 Subject: [PATCH 06/43] DisposableResult --- .../src/context-asyncify.ts | 7 +- .../quickjs-emscripten-core/src/context.ts | 57 +++++++----- .../quickjs-emscripten-core/src/lifetime.ts | 93 +++++++++++++++++++ .../quickjs-emscripten-core/src/runtime.ts | 15 ++- .../quickjs-emscripten/src/quickjs.test.ts | 12 +-- 5 files changed, 140 insertions(+), 44 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context-asyncify.ts b/packages/quickjs-emscripten-core/src/context-asyncify.ts index ffd41ae9..a397e622 100644 --- a/packages/quickjs-emscripten-core/src/context-asyncify.ts +++ b/packages/quickjs-emscripten-core/src/context-asyncify.ts @@ -6,6 +6,7 @@ import type { JSRuntimePointer, JSValuePointer, } from "@jitl/quickjs-ffi-types" +import type { ContextResult } from "./context" import { QuickJSContext } from "./context" import { debugLog } from "./debug" import type { Lifetime } from "./lifetime" @@ -46,7 +47,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 @@ -70,9 +71,9 @@ export class QuickJSAsyncContext extends 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)) } /** diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 566ee52b..6fb683b1 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -18,8 +18,9 @@ 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, DisposableArray } from "./lifetime" +import type { Disposable, DisposableArray, DisposableFail, DisposableSuccess } from "./lifetime" import { + DisposableResult, Lifetime, Scope, StaticLifetime, @@ -35,25 +36,25 @@ import type { // eslint-disable-next-line @typescript-eslint/no-unused-vars ExecutePendingJobsResult, } from "./runtime" -import { +import type { ContextEvalOptions, - IsEqualOp, GetOwnPropertyNamesOptions, JSValue, PromiseExecutor, QuickJSHandle, StaticJSValue, } from "./types" -import { evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" +import { IsEqualOp, evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" import type { LowLevelJavascriptVm, SuccessOrFail, - VmCallResult, VmFunctionImplementation, VmPropertyDescriptor, } from "./vm-interface" import { QuickJSIterator } from "./QuickJSIterator" +export type ContextResult = DisposableResult + /** * Property key for getting or setting a property on a handle with * {@link QuickJSContext#getProp}, {@link QuickJSContext#setProp}, or {@link QuickJSContext#defineProp}. @@ -744,7 +745,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")) @@ -755,25 +756,25 @@ 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() }) }) } @@ -861,7 +862,7 @@ export class QuickJSContext getPropNames( handle: QuickJSHandle, options: GetOwnPropertyNamesOptions, - ): SuccessOrFail, QuickJSHandle> { + ): ContextResult> { this.runtime.assertOwned(handle) handle.value // assert alive const flags = getOwnPropertyNamesOptionsToFlags(options) @@ -875,7 +876,7 @@ export class QuickJSContext flags, ) if (errorPtr) { - return { error: this.memory.heapValueHandle(errorPtr) } + return this.fail(this.memory.heapValueHandle(errorPtr)) } const len = this.uint32Out.value.typedArray[0] const ptr = outPtr.value.typedArray[0] @@ -884,7 +885,7 @@ export class QuickJSContext this.memory.heapValueHandle(ptr as JSValuePointer), ) this.module._free(ptr) - return { value: createDisposableArray(handles) } + return this.success(createDisposableArray(handles)) }) } @@ -907,7 +908,7 @@ export class QuickJSContext * } * ``` */ - getIterator(handle: QuickJSHandle): SuccessOrFail { + getIterator(handle: QuickJSHandle): ContextResult { const SymbolIterator = (this._SymbolIterator ??= this.memory.manage( this.getWellKnownSymbol("iterator"), )) @@ -915,9 +916,9 @@ export class QuickJSContext const methodHandle = scope.manage(this.getProp(handle, SymbolIterator)) const iteratorCallResult = this.callFunction(methodHandle, handle) if (iteratorCallResult.error) { - return iteratorCallResult + return iteratorCallResult.cast() } - return { value: new QuickJSIterator(iteratorCallResult.value, this) } + return this.success(new QuickJSIterator(iteratorCallResult.value, this)) }) } @@ -1000,7 +1001,7 @@ export class QuickJSContext func: QuickJSHandle, thisVal: QuickJSHandle, ...args: QuickJSHandle[] - ): VmCallResult { + ): ContextResult { this.runtime.assertOwned(func) const resultPtr = this.memory .toPointerArray(args) @@ -1017,10 +1018,10 @@ 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)) } /** @@ -1066,7 +1067,7 @@ export class QuickJSContext * See {@link EvalFlags} for number semantics. */ options?: number | ContextEvalOptions, - ): VmCallResult { + ): ContextResult { const detectModule = (options === undefined ? 1 : 0) as EvalDetectModule const flags = evalOptionsToFlags(options) as EvalFlags const resultPtr = this.memory @@ -1084,9 +1085,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)) } /** @@ -1326,4 +1327,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/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 37c4fa06..e6d3dada 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -1,3 +1,4 @@ +import { SuccessOrFail } from "./vm-interface" import type { MaybeAsyncBlock } from "./asyncify-helpers" import { maybeAsync } from "./asyncify-helpers" import { QTS_DEBUG } from "./debug" @@ -363,3 +364,95 @@ export function createDisposableArray( 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 { + 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) satisfies SuccessOrFail + } + + static is(result: SuccessOrFail): result is DisposableResult { + return result instanceof AbstractDisposableResult + } + + abstract get alive(): boolean + abstract dispose(): void + abstract unwrap(): S + abstract unwrapOr(fallback: T): S | T +} + +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() + } + } + + override unwrap(): S { + return this.value + } + + override 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 { + throw new Error("Method not implemented.") + } + + override unwrap(): S { + this.onUnwrap(this) + throw this.error + } + + override unwrapOr(fallback: T): S | T { + return fallback + } + + cast(): DisposableFail { + return this as unknown as DisposableFail + } +} + +export type DisposableResult = DisposableSuccess | DisposableFail +export const DisposableResult = AbstractDisposableResult diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index 8f321075..b59cfdc2 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -11,12 +11,11 @@ import { QuickJSContext } from "./context" import { debugLog } 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. */ @@ -250,7 +249,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 +263,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)) } } diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index e8ce090b..d7326529 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -414,11 +414,9 @@ function contextTests(getContext: GetTestContext, isDebug = false) { it('gets object keys that are symbols only when "includeSymbols" is true', () => { const obj = vm.newObject() const symA = vm.newUniqueSymbol("a") - const symB = vm.newUniqueSymbol("b") - const symC = vm.newUniqueSymbol("c") vm.setProp(obj, symA, vm.undefined) - vm.setProp(obj, symB, vm.undefined) - vm.setProp(obj, symC, vm.undefined) + vm.setProp(obj, "b", vm.undefined) + vm.setProp(obj, "c", vm.undefined) const props = vm.unwrapResult( vm.getPropNames(obj, { @@ -427,10 +425,8 @@ function contextTests(getContext: GetTestContext, isDebug = false) { }), ) - assert.strictEqual(props.length, 3) - assert.strictEqual(vm.dump(props[0]), symA) - assert.strictEqual(vm.dump(props[1]), symB) - assert.strictEqual(vm.dump(props[2]), symC) + assert.strictEqual(props.length, 1) + assert.ok(vm.eq(props[0], symA)) props.dispose() }) }) From 00efed49c54de7d509e1a4aadfee99e36b2f13c5 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:11:31 -0400 Subject: [PATCH 07/43] fix new ffi typings --- packages/quickjs-emscripten-core/src/context.ts | 4 ++-- packages/quickjs-emscripten-core/src/types.ts | 6 ------ packages/quickjs-ffi-types/src/ffi-types.ts | 11 +++++++++++ scripts/generate.ts | 4 ++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 6fb683b1..7f0c7c66 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, @@ -44,7 +44,7 @@ import type { QuickJSHandle, StaticJSValue, } from "./types" -import { IsEqualOp, evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" +import { evalOptionsToFlags, getOwnPropertyNamesOptionsToFlags } from "./types" import type { LowLevelJavascriptVm, SuccessOrFail, diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index a4700116..4e2ec885 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -329,9 +329,3 @@ export function concat(...values: Array): T[] { } return result } - -export enum IsEqualOp { - IsStrictlyEqual = 0, - IsSameValue = 1, - IsSameValueZero = 2, -} diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index a25cf370..c5d09f66 100644 --- a/packages/quickjs-ffi-types/src/ffi-types.ts +++ b/packages/quickjs-ffi-types/src/ffi-types.ts @@ -115,6 +115,11 @@ export type EvalDetectModule = Brand */ export type GetOwnPropertyNamesFlags = Brand +/** + * @private + */ +export type IsEqualOp = Brand + /** * State of a promise. */ @@ -194,3 +199,9 @@ export const GetOwnPropertyNamesFlags = { /* set theJSPropertyEnum.is_enumerable field */ JS_GPN_SET_ENUM: 1 << 5, } + +export const IsEqualOp = { + IsStrictlyEqual: 0 as IsEqualOp, + IsSameValue: 1 as IsEqualOp, + IsSameValueZero: 2 as IsEqualOp, +} 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 } } From a59c735276e33b92727bdd50d90f9b491877cc5d Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:12:37 -0400 Subject: [PATCH 08/43] wip --- packages/quickjs-ffi-types/src/ffi-async.ts | 7 ++++--- packages/quickjs-ffi-types/src/ffi.ts | 5 +++-- .../variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts | 7 ++++--- packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts | 5 +++-- .../src/ffi.ts | 7 ++++--- .../variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts | 5 +++-- .../variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts | 7 ++++--- packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts | 5 +++-- .../variant-quickjs-wasmfile-release-asyncify/src/ffi.ts | 7 ++++--- packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts | 5 +++-- 22 files changed, 77 insertions(+), 55 deletions(-) diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 5c91f999..1c554639 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "." @@ -157,14 +158,14 @@ export interface QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise @@ -217,7 +218,7 @@ export interface QuickJSAsyncFFI { ) => OwnedHeapCharPointer QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number QTS_IsEqual: ( diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index e5adc0a9..daf0c7d4 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "." @@ -131,7 +132,7 @@ export interface QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer @@ -165,7 +166,7 @@ export interface QuickJSFFI { ) => OwnedHeapCharPointer QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number QTS_IsEqual: ( 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 877686fa..181a778b 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -425,7 +426,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 130d3701..44195038 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 bea0e360..daf27f32 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -422,7 +423,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 d33ddb59..0e676971 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 877686fa..181a778b 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -425,7 +426,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 130d3701..44195038 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 bea0e360..daf27f32 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -422,7 +423,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 d33ddb59..0e676971 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 877686fa..181a778b 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -425,7 +426,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 130d3701..44195038 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 bea0e360..daf27f32 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -422,7 +423,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 d33ddb59..0e676971 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 877686fa..181a778b 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -425,7 +426,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 130d3701..44195038 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 bea0e360..daf27f32 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -422,7 +423,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) 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 d33ddb59..0e676971 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index 877686fa..181a778b 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -425,7 +426,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) diff --git a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index 130d3701..44195038 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index bea0e360..daf27f32 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, assertSync, } from "@jitl/quickjs-ffi-types" @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = assertSync( @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer | Promise = this.module.cwrap( @@ -422,7 +423,7 @@ export class QuickJSAsyncFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index d33ddb59..0e676971 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -21,6 +21,7 @@ import { IntrinsicsFlags, EvalDetectModule, GetOwnPropertyNamesFlags, + IsEqualOp, JSPromiseStateEnum, } from "@jitl/quickjs-ffi-types" @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, out_ptrs: JSValuePointerPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer = this.module.cwrap("QTS_GetOwnPropertyNames", "number", [ @@ -318,7 +319,7 @@ export class QuickJSFFI { QTS_GetLength: ( ctx: JSContextPointer, - out_len: uint32_tPointer, + out_len: UInt32Pointer, value: JSValuePointer | JSValueConstPointer, ) => number = this.module.cwrap("QTS_GetLength", "number", ["number", "number", "number"]) From 78208308b4c8eeb9cde6514d8becdc0db04bd2f2 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:14:48 -0400 Subject: [PATCH 09/43] upgrade emcc --- templates/Variant.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/Variant.mk b/templates/Variant.mk index c4bf308b..a4a57b8b 100644 --- a/templates/Variant.mk +++ b/templates/Variant.mk @@ -1,6 +1,6 @@ # 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 From cb29b27c113b82f4581accf211f0d4c60a6dead7 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:50:56 -0400 Subject: [PATCH 10/43] iterate on build --- .vscode/settings.json | 3 ++- c/interface.c | 15 +++++++++++++-- packages/internal-tsconfig/tsconfig.json | 1 + packages/quickjs-emscripten-core/src/context.ts | 13 +++++++++++-- packages/quickjs-emscripten-core/tsconfig.json | 2 -- packages/quickjs-emscripten/tsconfig.json | 2 -- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 70283ee4..58084395 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,7 @@ "lsan_interface.h": "c", "math.h": "c", "stdbool.h": "c", - "emscripten.h": "c" + "emscripten.h": "c", + "quickjs-atom.h": "c" } } diff --git a/c/interface.c b/c/interface.c index 0c154555..91d1f925 100644 --- a/c/interface.c +++ b/c/interface.c @@ -600,7 +600,7 @@ MaybeAsync(JSValue *) QTS_GetOwnPropertyNames(JSContext *ctx, JSValue **out_ptrs } *out_ptrs = malloc(sizeof(JSValue) * *out_len); for (int i = 0; i < *out_len; i++) { - (*out_ptrs)[i] = jsvalue_to_heap(JS_AtomToValue(ctx, tab[i].atom)); + out_ptrs[i] = jsvalue_to_heap(JS_AtomToValue(ctx, tab[i].atom)); JS_FreeAtom(ctx, tab[i].atom); } js_free(ctx, tab); @@ -840,6 +840,7 @@ 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; @@ -848,7 +849,13 @@ int QTS_GetLength(JSContext *ctx, uint32_t *out_len, JSValueConst *value) { return -1; } - len_val = JS_GetProperty(ctx, *value, JS_ATOM_length); + 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; } @@ -865,6 +872,9 @@ typedef enum IsEqualOp { } 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); @@ -874,6 +884,7 @@ int QTS_IsEqual(JSContext *ctx, JSValueConst *a, JSValueConst *b, IsEqualOp op) case QTS_EqualOp_StrictEq: return JS_StrictEq(ctx, *a, *b); } +#endif } JSValue *QTS_GetGlobalObject(JSContext *ctx) { diff --git a/packages/internal-tsconfig/tsconfig.json b/packages/internal-tsconfig/tsconfig.json index 9e0c23e6..7168b281 100644 --- a/packages/internal-tsconfig/tsconfig.json +++ b/packages/internal-tsconfig/tsconfig.json @@ -35,6 +35,7 @@ // "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/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 7f0c7c66..25a25502 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -17,7 +17,12 @@ 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 { + QuickJSEmscriptenModuleError, + QuickJSNotImplemented, + QuickJSPromisePending, + QuickJSUnwrapError, +} from "./errors" import type { Disposable, DisposableArray, DisposableFail, DisposableSuccess } from "./lifetime" import { DisposableResult, @@ -791,7 +796,11 @@ export class QuickJSContext } this.runtime.assertOwned(a) this.runtime.assertOwned(b) - return Boolean(this.ffi.QTS_IsEqual(this.ctx.value, a.value, b.value, equalityType)) + 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) } /** diff --git a/packages/quickjs-emscripten-core/tsconfig.json b/packages/quickjs-emscripten-core/tsconfig.json index bb1dba32..66f2a6a3 100644 --- a/packages/quickjs-emscripten-core/tsconfig.json +++ b/packages/quickjs-emscripten-core/tsconfig.json @@ -2,8 +2,6 @@ "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/tsconfig.json b/packages/quickjs-emscripten/tsconfig.json index fc0bd90d..8631045d 100644 --- a/packages/quickjs-emscripten/tsconfig.json +++ b/packages/quickjs-emscripten/tsconfig.json @@ -2,8 +2,6 @@ "extends": "@jitl/tsconfig/tsconfig.json", "include": ["src/*.*ts"], "compilerOptions": { - "outDir": ".output", - "rootDir": "src", "paths": { "#variants": ["./src/variants.ts", "./src/variants.js"], "quickjs-emscripten-core": ["../quickjs-emscripten-core/src"], From 0fa917430a8436cf5d972891b1715dda89b9c31d Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:56:57 -0400 Subject: [PATCH 11/43] regen --- doc/@jitl/quickjs-ffi-types/exports.md | 83 +++- .../interfaces/QuickJSAsyncFFI.md | 284 ++++++++++---- .../interfaces/QuickJSFFI.md | 220 ++++++++--- .../classes/Lifetime.md | 32 +- .../classes/QuickJSAsyncContext.md | 363 ++++++++++++++--- .../classes/QuickJSAsyncRuntime.md | 24 +- .../classes/QuickJSContext.md | 319 ++++++++++++--- .../classes/QuickJSDeferredPromise.md | 2 +- .../classes/QuickJSRuntime.md | 32 +- doc/quickjs-emscripten-core/classes/Scope.md | 14 +- .../classes/StaticLifetime.md | 32 +- .../classes/UsingDisposable.md | 6 +- .../classes/WeakLifetime.md | 32 +- doc/quickjs-emscripten-core/exports.md | 212 ++++++++-- .../interfaces/Disposable.md | 6 +- .../interfaces/EmscriptenModule.md | 44 +-- .../interfaces/EmscriptenModuleLoader.md | 2 +- .../EmscriptenModuleLoaderOptions.md | 10 +- .../QuickJSAsyncEmscriptenModule.md | 48 +-- .../interfaces/QuickJSAsyncFFI.md | 360 ++++++++++++----- .../interfaces/QuickJSAsyncVariant.md | 6 +- .../interfaces/QuickJSEmscriptenModule.md | 48 +-- .../interfaces/QuickJSFFI.md | 278 ++++++++----- .../interfaces/QuickJSSyncVariant.md | 6 +- .../interfaces/SourceMapData.md | 8 +- doc/quickjs-emscripten/classes/Lifetime.md | 34 +- .../classes/QuickJSAsyncContext.md | 367 +++++++++++++++--- .../classes/QuickJSAsyncRuntime.md | 40 +- .../classes/QuickJSAsyncWASMModule.md | 18 +- .../classes/QuickJSContext.md | 321 ++++++++++++--- .../classes/QuickJSDeferredPromise.md | 156 ++++---- .../classes/QuickJSRuntime.md | 40 +- .../classes/QuickJSWASMModule.md | 20 +- doc/quickjs-emscripten/classes/Scope.md | 14 +- .../classes/StaticLifetime.md | 34 +- .../classes/TestQuickJSWASMModule.md | 18 +- .../classes/UsingDisposable.md | 10 +- .../classes/WeakLifetime.md | 34 +- doc/quickjs-emscripten/exports.md | 246 +++++++++--- .../interfaces/AsyncRuntimeOptions.md | 16 +- .../interfaces/ContextEvalOptions.md | 10 +- .../interfaces/ContextOptions.md | 2 +- .../interfaces/CustomizeVariantOptions.md | 18 +- .../interfaces/Disposable.md | 6 +- .../interfaces/EmscriptenModule.md | 44 +-- .../interfaces/EmscriptenModuleLoader.md | 2 +- .../EmscriptenModuleLoaderOptions.md | 10 +- .../interfaces/JSModuleLoader.md | 2 +- .../interfaces/JSModuleLoaderAsync.md | 2 +- .../interfaces/JSModuleNormalizer.md | 4 +- .../interfaces/JSModuleNormalizerAsync.md | 2 +- .../interfaces/JSPromiseStateFulfilled.md | 8 +- .../interfaces/JSPromiseStatePending.md | 6 +- .../interfaces/JSPromiseStateRejected.md | 4 +- .../interfaces/LowLevelJavascriptVm.md | 28 +- .../interfaces/ModuleEvalOptions.md | 8 +- .../QuickJSAsyncEmscriptenModule.md | 48 +-- .../interfaces/QuickJSAsyncFFI.md | 284 ++++++++++---- .../interfaces/QuickJSAsyncVariant.md | 6 +- .../interfaces/QuickJSEmscriptenModule.md | 48 +-- .../interfaces/QuickJSFFI.md | 220 ++++++++--- .../interfaces/QuickJSSyncVariant.md | 6 +- .../interfaces/RuntimeOptions.md | 16 +- .../interfaces/RuntimeOptionsBase.md | 16 +- .../interfaces/SourceMapData.md | 8 +- .../interfaces/VmPropertyDescriptor.md | 10 +- .../namespaces/errors/README.md | 240 +----------- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- .../Makefile | 4 +- 87 files changed, 3414 insertions(+), 1563 deletions(-) diff --git a/doc/@jitl/quickjs-ffi-types/exports.md b/doc/@jitl/quickjs-ffi-types/exports.md index f50a56f7..3f3bb14e 100644 --- a/doc/@jitl/quickjs-ffi-types/exports.md +++ b/doc/@jitl/quickjs-ffi-types/exports.md @@ -29,9 +29,12 @@ - [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) @@ -141,7 +144,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:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126) *** @@ -276,6 +279,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:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L96) + ## Variables ### EvalFlags @@ -342,7 +355,41 @@ 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:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L101) + +*** + +### 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` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L116) *** @@ -350,7 +397,7 @@ module code > **IntrinsicsFlags**: `Object` -Bitfield options for QTS_NewContext intrinsices +Bitfield options for QTS_NewContext intrinsics #### Type declaration @@ -420,7 +467,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:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L106) + +*** + +### 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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L121) *** @@ -444,7 +515,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:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126) ## Functions @@ -477,7 +548,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:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md index de526cdf..008cecb0 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md @@ -40,15 +40,21 @@ library. - [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) @@ -97,7 +103,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:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L38) *** @@ -117,7 +123,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:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -131,7 +137,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:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) *** @@ -145,7 +151,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:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) *** @@ -159,7 +165,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -185,7 +191,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:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L172) *** @@ -211,7 +217,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:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L179) *** @@ -245,7 +251,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:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L147) *** @@ -265,7 +271,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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) *** @@ -285,7 +291,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:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) *** @@ -305,7 +311,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) +[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -333,7 +339,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:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) *** @@ -361,7 +367,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L203) *** @@ -383,7 +389,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:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) *** @@ -405,7 +411,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:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L110) *** @@ -425,7 +431,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) +[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -443,7 +449,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -461,7 +467,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -481,7 +487,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) +[packages/quickjs-ffi-types/src/ffi-async.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -501,7 +507,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) +[packages/quickjs-ffi-types/src/ffi-async.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -521,7 +527,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) +[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -541,7 +547,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) +[packages/quickjs-ffi-types/src/ffi-async.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) *** @@ -561,7 +567,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:83](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L83) +[packages/quickjs-ffi-types/src/ffi-async.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) *** @@ -575,7 +581,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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -595,7 +601,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) *** @@ -613,7 +619,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:230](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L230) + +*** + +### 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:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) *** @@ -633,7 +661,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:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L211) *** @@ -647,7 +675,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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.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**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L158) + +*** + +### 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**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L165) *** @@ -669,7 +749,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:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L115) + +*** + +### 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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L125) + +*** + +### 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:130](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L130) *** @@ -691,7 +815,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:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L120) *** @@ -711,7 +835,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:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) *** @@ -731,7 +855,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:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L95) *** @@ -751,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L96) +[packages/quickjs-ffi-types/src/ffi-async.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) *** @@ -765,7 +889,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -779,7 +903,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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.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-async.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L224) *** @@ -799,7 +947,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L100) +[packages/quickjs-ffi-types/src/ffi-async.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) *** @@ -817,7 +965,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:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) *** @@ -835,7 +983,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L66) +[packages/quickjs-ffi-types/src/ffi-async.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) *** @@ -857,7 +1005,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:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) *** @@ -877,7 +1025,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -895,7 +1043,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:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) *** @@ -915,7 +1063,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L75) *** @@ -937,7 +1085,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:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) *** @@ -955,7 +1103,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) +[packages/quickjs-ffi-types/src/ffi-async.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) *** @@ -975,7 +1123,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:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) *** @@ -995,7 +1143,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:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) *** @@ -1009,7 +1157,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -1029,7 +1177,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:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) *** @@ -1051,7 +1199,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L87) +[packages/quickjs-ffi-types/src/ffi-async.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) *** @@ -1071,7 +1219,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) *** @@ -1091,7 +1239,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:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) *** @@ -1105,7 +1253,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1125,7 +1273,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:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L186) *** @@ -1145,7 +1293,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:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1163,7 +1311,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:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) *** @@ -1181,7 +1329,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) *** @@ -1199,7 +1347,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:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1217,7 +1365,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:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) *** @@ -1237,7 +1385,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:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) *** @@ -1257,7 +1405,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -1277,7 +1425,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L39) +[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1301,7 +1449,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:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L135) *** @@ -1325,7 +1473,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:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L141) *** @@ -1343,7 +1491,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:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) *** @@ -1363,7 +1511,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L40) *** @@ -1383,7 +1531,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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L215) *** @@ -1403,7 +1551,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:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) *** @@ -1423,7 +1571,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:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md index 80f5b133..c75930bb 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md @@ -36,13 +36,17 @@ library. - [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) @@ -90,7 +94,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:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L37) *** @@ -110,7 +114,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:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -124,7 +128,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:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) *** @@ -138,7 +142,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:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -152,7 +156,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -178,7 +182,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:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L139) *** @@ -212,7 +216,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L121) *** @@ -232,7 +236,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:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -252,7 +256,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -280,7 +284,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:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) *** @@ -302,7 +306,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:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -322,7 +326,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -340,7 +344,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -358,7 +362,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -378,7 +382,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) +[packages/quickjs-ffi-types/src/ffi.ts:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -398,7 +402,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) +[packages/quickjs-ffi-types/src/ffi.ts:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -418,7 +422,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) +[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -438,7 +442,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) +[packages/quickjs-ffi-types/src/ffi.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) *** @@ -458,7 +462,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) +[packages/quickjs-ffi-types/src/ffi.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) *** @@ -472,7 +476,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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -492,7 +496,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -510,7 +514,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:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L178) + +*** + +### 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:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L167) *** @@ -530,7 +556,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:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L159) *** @@ -544,7 +570,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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L132) *** @@ -566,7 +618,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:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L105) + +*** + +### 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:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L110) *** @@ -586,7 +660,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:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -606,7 +680,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:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L94) *** @@ -620,7 +694,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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -634,7 +708,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) + +*** + +### 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:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L172) *** @@ -654,7 +752,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) +[packages/quickjs-ffi-types/src/ffi.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) *** @@ -672,7 +770,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:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -690,7 +788,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) +[packages/quickjs-ffi-types/src/ffi.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) *** @@ -712,7 +810,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:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -732,7 +830,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -750,7 +848,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -770,7 +868,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:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L74) *** @@ -792,7 +890,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:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) *** @@ -810,7 +908,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) +[packages/quickjs-ffi-types/src/ffi.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) *** @@ -830,7 +928,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:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -850,7 +948,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:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) *** @@ -864,7 +962,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -884,7 +982,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -906,7 +1004,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) +[packages/quickjs-ffi-types/src/ffi.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) *** @@ -926,7 +1024,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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) *** @@ -946,7 +1044,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:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) *** @@ -960,7 +1058,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:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -980,7 +1078,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:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L146) *** @@ -1000,7 +1098,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:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -1018,7 +1116,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:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) *** @@ -1036,7 +1134,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:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1054,7 +1152,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:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1072,7 +1170,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:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) *** @@ -1092,7 +1190,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:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) *** @@ -1112,7 +1210,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -1132,7 +1230,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -1156,7 +1254,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:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L115) *** @@ -1174,7 +1272,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:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) *** @@ -1194,7 +1292,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:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L39) *** @@ -1214,7 +1312,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:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) *** @@ -1234,7 +1332,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:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) *** @@ -1254,7 +1352,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** 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..6dc08a43 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -34,15 +34,21 @@ host functions as though they were synchronous. - [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) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) + - [getPropNames()](QuickJSAsyncContext.md#getpropnames) - [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 +62,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 +111,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:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) ## Properties @@ -118,7 +127,7 @@ The runtime that created this context. #### Source -[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) +[packages/quickjs-emscripten-core/src/context-asyncify.ts:32](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L32) ## Accessors @@ -136,7 +145,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) *** @@ -152,7 +161,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:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) *** @@ -170,7 +179,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:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) *** @@ -186,7 +195,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:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) *** @@ -202,7 +211,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:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) *** @@ -218,7 +227,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:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) ## Methods @@ -238,13 +247,13 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). Call a JSValue as a function. @@ -264,7 +273,7 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 @@ -276,7 +285,7 @@ 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:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) *** @@ -309,7 +318,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:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) *** @@ -340,7 +349,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:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) *** @@ -365,7 +374,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:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -391,7 +400,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:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) *** @@ -425,13 +434,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:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) + +*** + +### 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:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) *** ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -475,7 +511,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 +524,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:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) *** ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -510,11 +546,37 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source -[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) +[packages/quickjs-emscripten-core/src/context-asyncify.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L45) + +*** + +### fail() + +> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.fail`](QuickJSContext.md#fail) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) *** @@ -538,7 +600,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:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) *** @@ -562,7 +624,71 @@ 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:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) + +*** + +### getIterator() + +> **getIterator**(`handle`): `ContextResult`\<`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 (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() + } +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`ContextResult`\<`QuickJSIterator`\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getIterator`](QuickJSContext.md#getiterator) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length`. + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getLength`](QuickJSContext.md#getlength) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) *** @@ -588,7 +714,7 @@ 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:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) *** @@ -622,7 +748,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:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) *** @@ -652,7 +778,34 @@ 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:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) + +*** + +### getPropNames() + +> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions` + +#### Returns + +`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.getPropNames`](QuickJSContext.md#getpropnames) + +#### 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) *** @@ -676,7 +829,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:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) *** @@ -701,7 +854,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:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) + +*** + +### 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:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) *** @@ -722,7 +899,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:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) *** @@ -746,7 +923,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:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) *** @@ -778,7 +955,7 @@ See [Emscripten's docs on Asyncify](https://emscripten.org/docs/porting/asyncify #### Source -[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) +[packages/quickjs-emscripten-core/src/context-asyncify.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L92) *** @@ -802,7 +979,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:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) *** @@ -830,7 +1007,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:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) #### newError(message) @@ -850,7 +1027,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:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) #### newError(undefined) @@ -866,7 +1043,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:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) *** @@ -983,7 +1160,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:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) *** @@ -1007,7 +1184,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:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) *** @@ -1034,7 +1211,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:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) *** @@ -1059,7 +1236,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:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) #### newPromise(promise) @@ -1085,7 +1262,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:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) #### newPromise(newPromiseFn) @@ -1110,7 +1287,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:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) *** @@ -1134,7 +1311,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:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) *** @@ -1159,7 +1336,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:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) *** @@ -1184,13 +1361,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:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1204,7 +1381,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`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from @@ -1216,7 +1393,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:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) + +*** + +### 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:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) + +*** + +### 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:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) *** @@ -1253,7 +1484,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:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten-core.QuickJSContext.success`](QuickJSContext.md#success) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) *** @@ -1277,7 +1534,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:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1305,7 +1562,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:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) *** @@ -1336,7 +1593,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md index a8fdb7ca..73a83341 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncRuntime.md @@ -93,7 +93,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) ## Methods @@ -113,7 +113,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 +141,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:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) *** @@ -165,7 +165,7 @@ 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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) *** @@ -185,7 +185,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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) *** @@ -206,7 +206,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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) *** @@ -244,7 +244,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) *** @@ -267,7 +267,7 @@ 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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) *** @@ -316,7 +316,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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) *** @@ -336,7 +336,7 @@ 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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) *** @@ -364,7 +364,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) *** @@ -417,7 +417,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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index 2cfd6a25..5a3d26d1 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -59,14 +59,20 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [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) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) + - [getPropNames()](QuickJSContext.md#getpropnames) - [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 +85,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 +139,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:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) ## Properties @@ -142,7 +151,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:185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L185) ## Accessors @@ -160,7 +169,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) *** @@ -176,7 +185,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:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) *** @@ -194,7 +203,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:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) *** @@ -210,7 +219,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:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) *** @@ -226,7 +235,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:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) *** @@ -242,7 +251,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:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) ## Methods @@ -266,13 +275,13 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). Call a JSValue as a function. @@ -292,7 +301,7 @@ a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 @@ -304,7 +313,7 @@ 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:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) *** @@ -333,7 +342,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:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) *** @@ -364,7 +373,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:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) *** @@ -393,7 +402,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:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -415,7 +424,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:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) *** @@ -445,13 +454,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:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) + +*** + +### 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:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) *** ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -495,7 +527,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 +540,29 @@ 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:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) + +*** + +### fail() + +> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) *** @@ -528,7 +582,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:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) *** @@ -548,7 +602,63 @@ 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:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) + +*** + +### getIterator() + +> **getIterator**(`handle`): `ContextResult`\<`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 (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() + } +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`ContextResult`\<`QuickJSIterator`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length`. + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) *** @@ -574,7 +684,7 @@ 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:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) *** @@ -604,7 +714,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:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) *** @@ -634,7 +744,30 @@ 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:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) + +*** + +### getPropNames() + +> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions` + +#### Returns + +`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +#### 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) *** @@ -658,7 +791,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:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) *** @@ -679,7 +812,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:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) + +*** + +### 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:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) *** @@ -696,7 +849,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:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) *** @@ -716,7 +869,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:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) *** @@ -736,7 +889,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:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) *** @@ -760,7 +913,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:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) #### newError(message) @@ -776,7 +929,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:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) #### newError(undefined) @@ -788,7 +941,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:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) *** @@ -905,7 +1058,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:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) *** @@ -929,7 +1082,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:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) *** @@ -956,7 +1109,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:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) *** @@ -977,7 +1130,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:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) #### newPromise(promise) @@ -999,7 +1152,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:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) #### newPromise(newPromiseFn) @@ -1020,7 +1173,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:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) *** @@ -1044,7 +1197,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:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) *** @@ -1065,7 +1218,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:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) *** @@ -1086,13 +1239,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:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1106,7 +1259,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`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks @@ -1114,7 +1267,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:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) + +*** + +### 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:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) + +*** + +### 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:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) *** @@ -1151,7 +1350,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:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) *** @@ -1171,7 +1392,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:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1199,7 +1420,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:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) *** @@ -1226,7 +1447,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) *** 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..2edee6de 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md @@ -76,7 +76,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 +94,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) ## Methods @@ -118,7 +118,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 +142,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:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) *** @@ -162,7 +162,7 @@ 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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) *** @@ -186,7 +186,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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) *** @@ -203,7 +203,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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) *** @@ -237,7 +237,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) *** @@ -256,7 +256,7 @@ 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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) *** @@ -280,7 +280,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:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L136) *** @@ -297,7 +297,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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) *** @@ -313,7 +313,7 @@ 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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) *** @@ -337,7 +337,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) *** @@ -358,7 +358,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:311](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L311) *** @@ -379,7 +379,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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) *** @@ -404,7 +404,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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L168) *** 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..21abec47 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) @@ -51,15 +53,20 @@ - [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) @@ -74,6 +81,8 @@ ## Classes +- [DisposableFail](classes/DisposableFail.md) +- [DisposableSuccess](classes/DisposableSuccess.md) - [Lifetime](classes/Lifetime.md) - [QuickJSAsyncContext](classes/QuickJSAsyncContext.md) - [QuickJSAsyncRuntime](classes/QuickJSAsyncRuntime.md) @@ -136,7 +145,7 @@ #### Source -[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) +[packages/quickjs-emscripten-core/src/context-asyncify.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L19) *** @@ -149,7 +158,42 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:66 +[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) + +*** + +### 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`, `F`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) *** @@ -159,7 +203,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 +213,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 +229,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 +254,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) *** @@ -305,7 +349,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:76 +[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) *** @@ -317,7 +361,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 +373,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 +385,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) *** @@ -426,7 +470,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +[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) *** @@ -438,7 +482,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 +538,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 +550,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L51) *** @@ -519,7 +563,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 +575,7 @@ 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) *** @@ -543,7 +587,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:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L94) *** @@ -570,7 +614,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:71 +[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) *** @@ -596,7 +640,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:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L318) *** @@ -622,7 +666,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:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L61) *** @@ -634,7 +678,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:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L66) *** @@ -646,7 +690,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:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L71) *** @@ -675,7 +719,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:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L67) *** @@ -685,7 +729,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 +765,16 @@ Used as an optional. *** +### UInt32Pointer + +> **UInt32Pointer**: `Pointer`\<`"uint32_t"`\> + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L96) + +*** + ### VmCallResult\ > **VmCallResult**\<`VmHandle`\>: [`SuccessOrFail`](exports.md#successorfails-f)\<`VmHandle`, `VmHandle`\> @@ -831,6 +885,16 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q *** +### DisposableResult + +> **DisposableResult**: *typeof* `AbstractDisposableResult` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) + +*** + ### EvalFlags > **EvalFlags**: `Object` @@ -895,7 +959,41 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:89 +[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) + +*** + +### 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` + +#### Source + +[packages/quickjs-ffi-types/src/ffi-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L116) *** @@ -903,7 +1001,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 +1071,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:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L106) + +*** + +### 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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L121) *** @@ -985,19 +1107,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:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126) ## Functions @@ -1030,7 +1152,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:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) + +*** + +### 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) *** 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/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..ee63b4a6 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md @@ -40,15 +40,21 @@ library. - [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) @@ -97,7 +103,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +[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) *** @@ -107,7 +113,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 +123,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:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -131,7 +137,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:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) *** @@ -145,7 +151,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:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) *** @@ -159,7 +165,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -171,9 +177,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 +191,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:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L172) *** @@ -197,9 +203,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 +217,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:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L179) *** @@ -223,15 +229,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 +251,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:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L147) *** @@ -257,7 +263,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 +271,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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) *** @@ -277,7 +283,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 +291,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:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) *** @@ -297,7 +303,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 +311,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:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -333,7 +339,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:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) *** @@ -361,7 +367,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L203) *** @@ -383,7 +389,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:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) *** @@ -405,7 +411,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:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L110) *** @@ -425,7 +431,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:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -443,7 +449,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -461,7 +467,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -481,7 +487,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -501,7 +507,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -521,7 +527,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -533,7 +539,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 +547,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:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) *** @@ -553,7 +559,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 +567,7 @@ 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:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) *** @@ -575,7 +581,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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -587,7 +593,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 +601,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) *** @@ -613,7 +619,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:230](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L230) + +*** + +### 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:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) *** @@ -625,7 +653,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 +661,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:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L211) *** @@ -647,7 +675,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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.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**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L158) + +*** + +### 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**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L165) *** @@ -659,9 +739,9 @@ 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**: [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) \| [`JSValuePointer`](../exports.md#jsvaluepointer) +• **prop\_name**: [`JSValuePointer`](../exports.md#jsvaluepointer) \| [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) #### Returns @@ -669,7 +749,51 @@ 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:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L115) + +*** + +### 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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L125) + +*** + +### 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:130](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L130) *** @@ -681,9 +805,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 +815,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:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L120) *** @@ -703,7 +827,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 +835,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:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) *** @@ -723,7 +847,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 +855,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:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L95) *** @@ -743,7 +867,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 +875,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:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) *** @@ -765,7 +889,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -779,7 +903,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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.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-async.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L224) *** @@ -791,7 +939,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 +947,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:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) *** @@ -817,7 +965,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:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) *** @@ -835,7 +983,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:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) *** @@ -857,7 +1005,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:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) *** @@ -877,7 +1025,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -895,7 +1043,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:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) *** @@ -915,7 +1063,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L75) *** @@ -937,7 +1085,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:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) *** @@ -955,7 +1103,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:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) *** @@ -967,7 +1115,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 +1123,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:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) *** @@ -995,7 +1143,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:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) *** @@ -1009,7 +1157,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -1029,7 +1177,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:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) *** @@ -1051,7 +1199,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:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) *** @@ -1063,7 +1211,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 +1219,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) *** @@ -1083,7 +1231,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 +1239,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:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) *** @@ -1105,7 +1253,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1125,7 +1273,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:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L186) *** @@ -1145,7 +1293,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:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1163,7 +1311,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:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) *** @@ -1181,7 +1329,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) *** @@ -1199,7 +1347,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:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1217,7 +1365,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:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) *** @@ -1237,7 +1385,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:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) *** @@ -1257,7 +1405,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -1277,7 +1425,7 @@ 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:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1289,11 +1437,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 +1449,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:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L135) *** @@ -1313,11 +1461,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 +1473,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:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L141) *** @@ -1343,7 +1491,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:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) *** @@ -1355,7 +1503,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 +1511,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L40) *** @@ -1375,7 +1523,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 +1531,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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L215) *** @@ -1395,7 +1543,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 +1551,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:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) *** @@ -1415,7 +1563,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 +1571,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:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) *** 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..8184d4e2 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md @@ -36,13 +36,17 @@ library. - [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) @@ -90,7 +94,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:318 +[packages/quickjs-ffi-types/src/ffi.ts:37](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L37) *** @@ -100,7 +104,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 +114,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:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -124,7 +128,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:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) *** @@ -138,7 +142,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:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -152,7 +156,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:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -164,9 +168,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 +182,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:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L139) *** @@ -190,15 +194,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 +216,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L121) *** @@ -224,7 +228,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 +236,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:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -244,7 +248,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 +256,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:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -280,7 +284,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:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) *** @@ -302,7 +306,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:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -322,7 +326,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -340,7 +344,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -358,7 +362,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -378,7 +382,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -398,7 +402,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -418,7 +422,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -430,7 +434,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 +442,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:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) *** @@ -450,7 +454,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 +462,7 @@ 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:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) *** @@ -472,7 +476,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:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -484,7 +488,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 +496,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -510,7 +514,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:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L178) + +*** + +### 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:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L167) *** @@ -522,7 +548,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 +556,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:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L159) *** @@ -544,7 +570,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:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L132) *** @@ -556,9 +608,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 +618,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:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L105) + +*** + +### 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:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L110) *** @@ -578,7 +652,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 +660,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:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -598,7 +672,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 +680,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:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L94) *** @@ -620,7 +694,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:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -634,7 +708,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:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) + +*** + +### 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:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L172) *** @@ -646,7 +744,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 +752,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:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) *** @@ -672,7 +770,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:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -690,7 +788,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:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) *** @@ -712,7 +810,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:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -732,7 +830,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -750,7 +848,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -770,7 +868,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:74](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L74) *** @@ -792,7 +890,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:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) *** @@ -810,7 +908,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:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) *** @@ -822,7 +920,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 +928,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:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -850,7 +948,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:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) *** @@ -864,7 +962,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:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -884,7 +982,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -906,7 +1004,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:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) *** @@ -918,7 +1016,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 +1024,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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) *** @@ -938,7 +1036,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 +1044,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:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) *** @@ -960,7 +1058,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:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -980,7 +1078,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:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L146) *** @@ -1000,7 +1098,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:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -1018,7 +1116,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:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) *** @@ -1036,7 +1134,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:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1054,7 +1152,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:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1072,7 +1170,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:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) *** @@ -1092,7 +1190,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:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) *** @@ -1112,7 +1210,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:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -1132,7 +1230,7 @@ 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:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -1144,11 +1242,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 +1254,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:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L115) *** @@ -1174,7 +1272,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:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) *** @@ -1186,7 +1284,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 +1292,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:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L39) *** @@ -1206,7 +1304,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 +1312,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:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) *** @@ -1226,7 +1324,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 +1332,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:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) *** @@ -1246,7 +1344,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 +1352,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** 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/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/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..8d8391c5 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -34,15 +34,21 @@ host functions as though they were synchronous. - [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) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) + - [getPropNames()](QuickJSAsyncContext.md#getpropnames) - [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 +62,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 +111,7 @@ to create a new QuickJSContext. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:874 +[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) ## Properties @@ -118,7 +127,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:32](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L32) ## Accessors @@ -136,7 +145,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) *** @@ -152,7 +161,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:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) *** @@ -170,7 +179,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:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) *** @@ -186,7 +195,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:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) *** @@ -202,7 +211,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:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) *** @@ -218,7 +227,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:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) ## Methods @@ -238,13 +247,13 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). Call a JSValue as a function. @@ -264,7 +273,7 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 @@ -276,7 +285,7 @@ value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1168 +[packages/quickjs-emscripten-core/src/context.ts:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) *** @@ -309,7 +318,7 @@ socket.on("data", chunk => { #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1275 +[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) *** @@ -340,7 +349,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:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) *** @@ -365,7 +374,7 @@ will result in an error. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:890 +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -391,7 +400,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:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) *** @@ -425,13 +434,40 @@ socket.write(dataLifetime?.value) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1262 +[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) + +*** + +### 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:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) *** ### evalCode() -> **evalCode**(`code`, `filename`?, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -464,7 +500,7 @@ create a time-based deadline. • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -475,7 +511,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 +524,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:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) *** ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`?, `options`?): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -502,7 +538,7 @@ Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -510,11 +546,37 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:334 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L45) + +*** + +### fail() + +> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.fail`](QuickJSContext.md#fail) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) *** @@ -538,7 +600,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1102 +[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) *** @@ -562,7 +624,71 @@ Converts `handle` to a Javascript bigint. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1098 +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) + +*** + +### getIterator() + +> **getIterator**(`handle`): `ContextResult`\<`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 (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() + } +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`ContextResult`\<`QuickJSIterator`\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getIterator`](QuickJSContext.md#getiterator) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length`. + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getLength`](QuickJSContext.md#getlength) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) *** @@ -588,7 +714,7 @@ Converts `handle` into a Javascript number. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1085 +[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) *** @@ -622,7 +748,7 @@ resultHandle.dispose(); #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1116 +[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) *** @@ -652,7 +778,34 @@ Javascript string (which will be converted automatically). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1135 +[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) + +*** + +### getPropNames() + +> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions` + +#### Returns + +`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.getPropNames`](QuickJSContext.md#getpropnames) + +#### 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) *** @@ -676,7 +829,7 @@ Converts `handle` to a Javascript string. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1089 +[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) *** @@ -701,7 +854,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:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) + +*** + +### 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:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) *** @@ -722,7 +899,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:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) *** @@ -746,7 +923,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:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) *** @@ -778,7 +955,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:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L92) *** @@ -802,7 +979,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:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) *** @@ -830,7 +1007,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:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) #### newError(message) @@ -850,7 +1027,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:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) #### newError(undefined) @@ -866,7 +1043,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:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) *** @@ -983,7 +1160,7 @@ return deferred.handle #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1067 +[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) *** @@ -1007,7 +1184,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:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) *** @@ -1034,7 +1211,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:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) *** @@ -1059,7 +1236,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:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) #### newPromise(promise) @@ -1085,7 +1262,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:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) #### newPromise(newPromiseFn) @@ -1110,7 +1287,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:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) *** @@ -1134,7 +1311,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:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) *** @@ -1159,7 +1336,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:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) *** @@ -1184,13 +1361,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:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1204,7 +1381,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`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from @@ -1216,7 +1393,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:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) + +*** + +### 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:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) + +*** + +### 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:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) *** @@ -1253,7 +1484,33 @@ properties. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1147 +[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Inherited from + +[`quickjs-emscripten.QuickJSContext.success`](QuickJSContext.md#success) + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) *** @@ -1277,7 +1534,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:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1305,7 +1562,7 @@ Does not support BigInt values correctly. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1080 +[packages/quickjs-emscripten-core/src/context.ts:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) *** @@ -1336,7 +1593,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md index 0164dfba..2d47537d 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md @@ -75,7 +75,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 +93,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) ## Methods @@ -113,7 +113,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 +141,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:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) *** @@ -165,7 +165,7 @@ 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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) *** @@ -185,7 +185,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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) *** @@ -206,13 +206,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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) *** ### 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 +223,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 +244,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) *** @@ -267,13 +267,13 @@ 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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) *** ### 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 +283,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 +295,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 +316,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:231 +[packages/quickjs-emscripten-core/src/runtime.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) *** @@ -336,7 +336,7 @@ 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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) *** @@ -364,7 +364,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) *** @@ -392,7 +392,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 +417,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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) *** @@ -446,7 +446,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..173a54c1 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -59,14 +59,20 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [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) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) + - [getPropNames()](QuickJSContext.md#getpropnames) - [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 +85,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 +139,7 @@ to create a new QuickJSContext. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:874 +[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) ## Properties @@ -142,7 +151,7 @@ The runtime that created this context. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:847 +[packages/quickjs-emscripten-core/src/context.ts:185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L185) ## Accessors @@ -160,7 +169,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:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) *** @@ -176,7 +185,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:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) *** @@ -194,7 +203,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:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) *** @@ -210,7 +219,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:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) *** @@ -226,7 +235,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:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) *** @@ -242,7 +251,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:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) ## Methods @@ -266,13 +275,13 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> [`func.call(thisVal, ...args)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). Call a JSValue as a function. @@ -292,7 +301,7 @@ a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 @@ -304,7 +313,7 @@ value. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1168 +[packages/quickjs-emscripten-core/src/context.ts:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) *** @@ -333,7 +342,7 @@ socket.on("data", chunk => { #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1275 +[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) *** @@ -364,7 +373,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:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) *** @@ -393,7 +402,7 @@ will result in an error. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:890 +[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) *** @@ -415,7 +424,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:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) *** @@ -445,13 +454,36 @@ socket.write(dataLifetime?.value) #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1262 +[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) + +*** + +### 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:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) *** ### evalCode() -> **evalCode**(`code`, `filename`?, `options`?): [`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). @@ -484,7 +516,7 @@ create a time-based deadline. • **code**: `string` -• **filename?**: `string` +• **filename**: `string`= `"eval.js"` • **options?**: `number` \| [`ContextEvalOptions`](../interfaces/ContextEvalOptions.md) @@ -495,7 +527,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`ContextResult`\<[`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 +540,29 @@ 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:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) + +*** + +### fail() + +> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **error**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) *** @@ -528,7 +582,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1102 +[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) *** @@ -548,7 +602,63 @@ Converts `handle` to a Javascript bigint. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1098 +[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) + +*** + +### getIterator() + +> **getIterator**(`handle`): `ContextResult`\<`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 (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() + } +} +``` + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`ContextResult`\<`QuickJSIterator`\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) + +*** + +### getLength() + +> **getLength**(`handle`): `undefined` \| `number` + +`handle.length`. + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +#### Returns + +`undefined` \| `number` + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) *** @@ -574,7 +684,7 @@ Converts `handle` into a Javascript number. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1085 +[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) *** @@ -604,7 +714,7 @@ resultHandle.dispose(); #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1116 +[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) *** @@ -634,7 +744,30 @@ Javascript string (which will be converted automatically). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1135 +[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) + +*** + +### getPropNames() + +> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +`Object.getOwnPropertyNames(handle)`. +Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). + +#### Parameters + +• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **options**: `GetOwnPropertyNamesOptions` + +#### Returns + +`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> + +#### 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) *** @@ -658,7 +791,7 @@ Converts `handle` to a Javascript string. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1089 +[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) *** @@ -679,7 +812,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:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) + +*** + +### 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:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) *** @@ -696,7 +849,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:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) *** @@ -716,7 +869,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:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) *** @@ -736,7 +889,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:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) *** @@ -760,7 +913,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:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) #### newError(message) @@ -776,7 +929,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:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) #### newError(undefined) @@ -788,7 +941,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:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) *** @@ -905,7 +1058,7 @@ return deferred.handle #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1067 +[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) *** @@ -929,7 +1082,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:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) *** @@ -956,7 +1109,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:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) *** @@ -977,7 +1130,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:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) #### newPromise(promise) @@ -999,7 +1152,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:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) #### newPromise(newPromiseFn) @@ -1020,7 +1173,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:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) *** @@ -1044,7 +1197,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:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) *** @@ -1065,7 +1218,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:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) *** @@ -1086,13 +1239,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:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) *** ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<[`VmCallResult`](../exports.md#vmcallresultvmhandle)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> `Promise.resolve(value)`. Convert a handle containing a Promise-like value inside the VM into an @@ -1106,7 +1259,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`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks @@ -1114,7 +1267,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:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) + +*** + +### 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:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) + +*** + +### 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:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) *** @@ -1151,7 +1350,29 @@ properties. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1147 +[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) + +*** + +### success() + +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Type parameters + +• **S** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> + +#### Source + +[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) *** @@ -1171,7 +1392,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:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) *** @@ -1199,7 +1420,7 @@ Does not support BigInt values correctly. #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:1080 +[packages/quickjs-emscripten-core/src/context.ts:642](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L642) *** @@ -1226,7 +1447,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) *** 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..16c3cd29 100644 --- a/doc/quickjs-emscripten/classes/QuickJSRuntime.md +++ b/doc/quickjs-emscripten/classes/QuickJSRuntime.md @@ -76,7 +76,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 +94,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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) ## Methods @@ -118,7 +118,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 +142,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:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) *** @@ -162,7 +162,7 @@ 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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) *** @@ -186,7 +186,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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) *** @@ -203,13 +203,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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) *** ### 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 +220,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 +237,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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) *** @@ -256,13 +256,13 @@ 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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) *** ### 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 +272,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 +280,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:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L136) *** @@ -297,7 +297,7 @@ See [setInterruptHandler](QuickJSRuntime.md#setinterrupthandler). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:231 +[packages/quickjs-emscripten-core/src/runtime.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) *** @@ -313,7 +313,7 @@ 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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) *** @@ -337,7 +337,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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) *** @@ -358,7 +358,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:311](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L311) *** @@ -379,7 +379,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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) *** @@ -404,7 +404,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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L168) *** 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..be55879d 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) @@ -51,6 +53,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 +62,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 +74,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) @@ -88,6 +95,8 @@ ## Classes +- [DisposableFail](classes/DisposableFail.md) +- [DisposableSuccess](classes/DisposableSuccess.md) - [Lifetime](classes/Lifetime.md) - [QuickJSAsyncContext](classes/QuickJSAsyncContext.md) - [QuickJSAsyncRuntime](classes/QuickJSAsyncRuntime.md) @@ -150,7 +159,7 @@ #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:313 +[packages/quickjs-emscripten-core/src/context-asyncify.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L19) *** @@ -167,13 +176,48 @@ packages/quickjs-ffi-types/dist/index.d.ts:66 *** +### 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`, `F`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) + +*** + ### EitherFFI > **EitherFFI**: [`QuickJSFFI`](interfaces/QuickJSFFI.md) \| [`QuickJSAsyncFFI`](interfaces/QuickJSAsyncFFI.md) #### Source -packages/quickjs-ffi-types/dist/index.d.ts:496 +packages/quickjs-ffi-types/dist/index.d.ts:528 *** @@ -183,13 +227,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:326 *** ### 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 +243,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 +268,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 +350,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:145](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L145) *** @@ -365,7 +409,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:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L68) *** @@ -375,7 +419,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:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L69) *** @@ -385,7 +429,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:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L67) *** @@ -395,7 +439,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:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L86) *** @@ -405,7 +449,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:87](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L87) *** @@ -415,7 +459,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:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L85) *** @@ -428,7 +472,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 +484,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:140 +packages/quickjs-ffi-types/dist/index.d.ts:141 *** @@ -476,7 +520,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 +539,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) *** @@ -571,7 +615,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) *** @@ -610,7 +654,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:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L318) *** @@ -624,7 +668,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) *** @@ -676,7 +720,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:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L52) *** @@ -689,7 +733,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:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L67) *** @@ -699,7 +743,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:527 *** @@ -712,7 +756,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 +775,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:81 *** @@ -748,7 +802,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 +837,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 +901,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/dist/index.d.ts:465 +[packages/quickjs-emscripten-core/src/types.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L172) + +*** + +### DisposableResult + +> **DisposableResult**: *typeof* `AbstractDisposableResult` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) *** @@ -955,7 +1019,41 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:89 +packages/quickjs-ffi-types/dist/index.d.ts:90 + +*** + +### 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` + +#### Source + +packages/quickjs-ffi-types/dist/index.d.ts:150 *** @@ -963,7 +1061,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 +1131,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:118 + +*** + +### 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:162 *** @@ -1057,7 +1179,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:141 *** @@ -1136,7 +1258,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:86 + +*** + +### 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 +1355,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 +1379,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 +1411,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 +1540,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 +1602,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 +1629,7 @@ 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) *** @@ -1506,7 +1652,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..3d5166ad 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:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -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:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) *** @@ -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:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -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:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -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:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L136) *** @@ -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:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) *** @@ -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:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -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:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** diff --git a/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md b/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md index 1d027788..7acf967f 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:262](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L262) *** @@ -39,7 +39,7 @@ with JS_EvalFunction(). #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:527 +[packages/quickjs-emscripten-core/src/types.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L260) *** @@ -51,7 +51,7 @@ Force "strict" mode #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:519 +[packages/quickjs-emscripten-core/src/types.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L252) *** @@ -63,7 +63,7 @@ Force "strip" mode #### Source -packages/quickjs-emscripten-core/dist/index.d.ts:521 +[packages/quickjs-emscripten-core/src/types.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L254) *** @@ -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:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L250) *** diff --git a/doc/quickjs-emscripten/interfaces/ContextOptions.md b/doc/quickjs-emscripten/interfaces/ContextOptions.md index 2f28a6cd..d1404c91 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:228](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L228) *** 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..f65dd4ce 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:283 *** @@ -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:274 *** @@ -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:275 *** @@ -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:273 *** @@ -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:279 *** @@ -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:280 *** @@ -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:277 *** @@ -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:278 *** @@ -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:276 *** @@ -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:282 *** @@ -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:281 *** @@ -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:240 *** @@ -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:242 ## 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:268 *** @@ -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:271 *** @@ -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:270 *** @@ -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:272 *** @@ -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:244 *** @@ -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:269 *** @@ -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:236 *** @@ -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:246 *** @@ -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:263 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoader.md index e4c096b7..b7428cfa 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:328 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md b/doc/quickjs-emscripten/interfaces/EmscriptenModuleLoaderOptions.md index 51d88849..18298f7d 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:240 *** @@ -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:242 ## 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:244 *** @@ -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:236 *** @@ -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:246 *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleLoader.md b/doc/quickjs-emscripten/interfaces/JSModuleLoader.md index bb8b13a3..6967295f 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:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L82) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md index 8475402a..3226ea0f 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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L75) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md index 943ac8b3..ea8ba5e7 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:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L99) > **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:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L92) *** diff --git a/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md index 5e47325b..bbb79216 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:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L92) *** 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..9f13cd7d 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:283 *** @@ -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:274 *** @@ -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:275 *** @@ -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:273 *** @@ -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:279 *** @@ -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:280 *** @@ -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:277 *** @@ -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:278 *** @@ -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:276 *** @@ -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:282 *** @@ -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:281 *** @@ -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:324 *** @@ -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:323 *** @@ -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:240 *** @@ -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:242 ## 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:268 *** @@ -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:271 *** @@ -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:270 *** @@ -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:272 *** @@ -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:244 *** @@ -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:269 *** @@ -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:236 *** @@ -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:246 *** @@ -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:263 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md index cc0236d1..0664723a 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md @@ -40,15 +40,21 @@ library. - [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) @@ -97,7 +103,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +packages/quickjs-ffi-types/dist/index.d.ts:416 *** @@ -117,7 +123,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:483 *** @@ -131,7 +137,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:481 *** @@ -145,7 +151,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:480 *** @@ -159,7 +165,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:423 *** @@ -185,7 +191,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:464 *** @@ -211,7 +217,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:465 *** @@ -245,7 +251,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:461 *** @@ -265,7 +271,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:467 *** @@ -285,7 +291,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:468 *** @@ -305,7 +311,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:437 *** @@ -333,7 +339,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:469 *** @@ -361,7 +367,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:470 *** @@ -383,7 +389,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:453 *** @@ -405,7 +411,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:454 *** @@ -425,7 +431,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:436 *** @@ -443,7 +449,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:432 *** @@ -461,7 +467,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:430 *** @@ -481,7 +487,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:433 *** @@ -501,7 +507,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:434 *** @@ -521,7 +527,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:435 *** @@ -541,7 +547,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:446 *** @@ -561,7 +567,7 @@ 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:447 *** @@ -575,7 +581,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:427 *** @@ -595,7 +601,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:443 *** @@ -613,7 +619,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:475 + +*** + +### 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:473 *** @@ -633,7 +661,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:471 *** @@ -647,7 +675,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:426 + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:462 + +*** + +### 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**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:463 *** @@ -669,7 +749,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:455 + +*** + +### 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:457 + +*** + +### 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:458 *** @@ -691,7 +815,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:456 *** @@ -711,7 +835,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:445 *** @@ -731,7 +855,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:449 *** @@ -751,7 +875,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:450 *** @@ -765,7 +889,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:428 *** @@ -779,7 +903,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:425 + +*** + +### 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:474 *** @@ -799,7 +947,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:451 *** @@ -817,7 +965,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:452 *** @@ -835,7 +983,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:440 *** @@ -857,7 +1005,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:441 *** @@ -877,7 +1025,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:431 *** @@ -895,7 +1043,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:418 *** @@ -915,7 +1063,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:442 *** @@ -937,7 +1085,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:482 *** @@ -955,7 +1103,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:438 *** @@ -975,7 +1123,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:439 *** @@ -995,7 +1143,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:476 *** @@ -1009,7 +1157,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:429 *** @@ -1029,7 +1177,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:444 *** @@ -1051,7 +1199,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:448 *** @@ -1071,7 +1219,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:478 *** @@ -1091,7 +1239,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:477 *** @@ -1105,7 +1253,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:422 *** @@ -1125,7 +1273,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:466 *** @@ -1145,7 +1293,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:420 *** @@ -1163,7 +1311,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:485 *** @@ -1181,7 +1329,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:487 *** @@ -1199,7 +1347,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:421 *** @@ -1217,7 +1365,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:484 *** @@ -1237,7 +1385,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:486 *** @@ -1257,7 +1405,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:424 *** @@ -1277,7 +1425,7 @@ 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:419 *** @@ -1301,7 +1449,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:459 *** @@ -1325,7 +1473,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:460 *** @@ -1343,7 +1491,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:479 *** @@ -1363,7 +1511,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:417 *** @@ -1383,7 +1531,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:472 *** @@ -1403,7 +1551,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:489 *** @@ -1423,7 +1571,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:488 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md index cab1c0c3..a660c20a 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:524 *** @@ -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:525 *** @@ -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:523 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md index 165762da..ccdadc34 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:283 *** @@ -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:274 *** @@ -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:275 *** @@ -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:273 *** @@ -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:279 *** @@ -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:280 *** @@ -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:277 *** @@ -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:278 *** @@ -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:276 *** @@ -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:282 *** @@ -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:281 *** @@ -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:319 *** @@ -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:318 *** @@ -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:240 *** @@ -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:242 ## 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:268 *** @@ -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:271 *** @@ -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:270 *** @@ -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:272 *** @@ -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:244 *** @@ -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:269 *** @@ -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:236 *** @@ -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:246 *** @@ -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:263 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md index 3b2eeaae..66ccf608 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md @@ -36,13 +36,17 @@ library. - [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) @@ -90,7 +94,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:318 +packages/quickjs-ffi-types/dist/index.d.ts:340 *** @@ -110,7 +114,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:398 *** @@ -124,7 +128,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:396 *** @@ -138,7 +142,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:395 *** @@ -152,7 +156,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:347 *** @@ -178,7 +182,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:382 *** @@ -212,7 +216,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:380 *** @@ -232,7 +236,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:384 *** @@ -252,7 +256,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:361 *** @@ -280,7 +284,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:385 *** @@ -302,7 +306,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:376 *** @@ -322,7 +326,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:360 *** @@ -340,7 +344,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:356 *** @@ -358,7 +362,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:354 *** @@ -378,7 +382,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:357 *** @@ -398,7 +402,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:358 *** @@ -418,7 +422,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:359 *** @@ -438,7 +442,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:370 *** @@ -458,7 +462,7 @@ 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:371 *** @@ -472,7 +476,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:351 *** @@ -492,7 +496,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:367 *** @@ -510,7 +514,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:390 + +*** + +### 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:388 *** @@ -530,7 +556,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:386 *** @@ -544,7 +570,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:350 + +*** + +### QTS\_GetOwnPropertyNames + +> **QTS\_GetOwnPropertyNames**: (`ctx`, `out_ptrs`, `out_len`, `obj`, `flags`) => [`JSValuePointer`](../exports.md#jsvaluepointer) + +#### Parameters + +• **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) + +• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) + +• **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:381 *** @@ -566,7 +618,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:377 + +*** + +### 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:378 *** @@ -586,7 +660,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:369 *** @@ -606,7 +680,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:373 *** @@ -620,7 +694,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:352 *** @@ -634,7 +708,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:349 + +*** + +### 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:389 *** @@ -654,7 +752,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:374 *** @@ -672,7 +770,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:375 *** @@ -690,7 +788,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:364 *** @@ -712,7 +810,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:365 *** @@ -732,7 +830,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:355 *** @@ -750,7 +848,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:342 *** @@ -770,7 +868,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:366 *** @@ -792,7 +890,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:397 *** @@ -810,7 +908,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:362 *** @@ -830,7 +928,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:363 *** @@ -850,7 +948,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:391 *** @@ -864,7 +962,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:353 *** @@ -884,7 +982,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:368 *** @@ -906,7 +1004,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:372 *** @@ -926,7 +1024,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:393 *** @@ -946,7 +1044,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:392 *** @@ -960,7 +1058,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:346 *** @@ -980,7 +1078,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:383 *** @@ -1000,7 +1098,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:344 *** @@ -1018,7 +1116,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:400 *** @@ -1036,7 +1134,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:402 *** @@ -1054,7 +1152,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:345 *** @@ -1072,7 +1170,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:399 *** @@ -1092,7 +1190,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:401 *** @@ -1112,7 +1210,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:348 *** @@ -1132,7 +1230,7 @@ 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:343 *** @@ -1156,7 +1254,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:379 *** @@ -1174,7 +1272,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:394 *** @@ -1194,7 +1292,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:341 *** @@ -1214,7 +1312,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:387 *** @@ -1234,7 +1332,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:404 *** @@ -1254,7 +1352,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:403 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md index 064b8cc6..703861ee 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:510 *** @@ -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:511 *** @@ -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:509 *** diff --git a/doc/quickjs-emscripten/interfaces/RuntimeOptions.md b/doc/quickjs-emscripten/interfaces/RuntimeOptions.md index cd69b5a8..73a39b32 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:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -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:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) *** @@ -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:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -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:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -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:132](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L132) *** @@ -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:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) *** @@ -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:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -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:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** diff --git a/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md b/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md index a667f1c0..bbd598e9 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:118](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L118) *** @@ -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:112](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L112) *** @@ -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:113](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L113) *** @@ -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:114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L114) *** @@ -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:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L116) *** @@ -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:117](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L117) *** @@ -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:119](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L119) *** diff --git a/doc/quickjs-emscripten/interfaces/SourceMapData.md b/doc/quickjs-emscripten/interfaces/SourceMapData.md index 4e54783c..87b4772c 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:199 *** @@ -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:198 *** @@ -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:197 *** @@ -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:196 *** 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..daf79147 100644 --- a/doc/quickjs-emscripten/namespaces/errors/README.md +++ b/doc/quickjs-emscripten/namespaces/errors/README.md @@ -6,230 +6,22 @@ # 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) +- [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/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index f20a5931..ac4ff706 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index 4740eae8..ac409557 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index cf1cbb7e..6a1fd431 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 612f89d5..29d60b2d 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index ebcf2775..272ab743 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index fd6aa97f..f1218bf2 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index 3cd331d6..ba2108e3 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index 126d6838..de2f1c5a 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 14d3fb0e..1fa3ba45 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 6ff1adf5..25fca458 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index 5f255c2d..f6830e25 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index 662861c0..fed5b654 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index 183191a1..e6497434 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index e67720e1..8937eba3 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index da9c34c9..4381ed25 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index 61ba3ad5..c28f31d3 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index b2fa95ed..e5962386 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 6901e950..a5ee4d7d 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index ff1f372a..b9ef42a7 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -1,6 +1,6 @@ # 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 diff --git a/packages/variant-quickjs-wasmfile-release-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index 638eb8f0..c88f8e2d 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -1,6 +1,6 @@ # 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 From e1cb8b6e482223ff433cf27ce69f5bb31946ccc5 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 12:57:05 -0400 Subject: [PATCH 12/43] new doc --- .../classes/DisposableFail.md | 275 ++++++++++++++++++ .../classes/DisposableSuccess.md | 265 +++++++++++++++++ .../classes/DisposableFail.md | 275 ++++++++++++++++++ .../classes/DisposableSuccess.md | 265 +++++++++++++++++ .../errors/classes/QuickJSAsyncifyError.md | 59 ++++ .../classes/QuickJSAsyncifySuspended.md | 59 ++++ .../classes/QuickJSEmscriptenModuleError.md | 59 ++++ .../classes/QuickJSMemoryLeakDetected.md | 59 ++++ .../errors/classes/QuickJSNotImplemented.md | 59 ++++ .../errors/classes/QuickJSPromisePending.md | 59 ++++ .../errors/classes/QuickJSUnknownIntrinsic.md | 80 +++++ .../errors/classes/QuickJSUnwrapError.md | 85 ++++++ .../errors/classes/QuickJSUseAfterFree.md | 59 ++++ .../errors/classes/QuickJSWrongOwner.md | 59 ++++ 14 files changed, 1717 insertions(+) create mode 100644 doc/quickjs-emscripten-core/classes/DisposableFail.md create mode 100644 doc/quickjs-emscripten-core/classes/DisposableSuccess.md create mode 100644 doc/quickjs-emscripten/classes/DisposableFail.md create mode 100644 doc/quickjs-emscripten/classes/DisposableSuccess.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifyError.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSAsyncifySuspended.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmscriptenModuleError.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSMemoryLeakDetected.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSNotImplemented.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSPromisePending.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnknownIntrinsic.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUseAfterFree.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSWrongOwner.md diff --git a/doc/quickjs-emscripten-core/classes/DisposableFail.md b/doc/quickjs-emscripten-core/classes/DisposableFail.md new file mode 100644 index 00000000..976abfa0 --- /dev/null +++ b/doc/quickjs-emscripten-core/classes/DisposableFail.md @@ -0,0 +1,275 @@ +[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) + - [cast()](DisposableFail.md#cast) + - [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`\<`S`, `F`\> + +## Type parameters + +• **S** + +• **F** + +## Constructors + +### new DisposableFail(error, onUnwrap) + +> **new DisposableFail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L428) + +## Properties + +### error + +> **`readonly`** **error**: `F` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L429) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) + +## 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) + +*** + +### cast() + +> **cast**\<`S2`\>(): [`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> + +#### Type parameters + +• **S2** = `never` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L439) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Overrides + +`AbstractDisposableResult.unwrap` + +#### 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`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Overrides + +`AbstractDisposableResult.unwrapOr` + +#### 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)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `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`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### 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..4e77d10c --- /dev/null +++ b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md @@ -0,0 +1,265 @@ +[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`\<`S`, `F`\> + +## Type parameters + +• **S** + +• **F** + +## Constructors + +### new DisposableSuccess(value) + +> **new DisposableSuccess**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) + +## Properties + +### error? + +> **error**?: `undefined` + +#### 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) + +*** + +### value + +> **`readonly`** **value**: `S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:408](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L408) + +## 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:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L412) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Overrides + +`AbstractDisposableResult.unwrap` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L418) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`_fallback`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **\_fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Overrides + +`AbstractDisposableResult.unwrapOr` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L422) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `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`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### 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/DisposableFail.md b/doc/quickjs-emscripten/classes/DisposableFail.md new file mode 100644 index 00000000..98ec9544 --- /dev/null +++ b/doc/quickjs-emscripten/classes/DisposableFail.md @@ -0,0 +1,275 @@ +[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) + - [cast()](DisposableFail.md#cast) + - [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`\<`S`, `F`\> + +## Type parameters + +• **S** + +• **F** + +## Constructors + +### new DisposableFail(error, onUnwrap) + +> **new DisposableFail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L428) + +## Properties + +### error + +> **`readonly`** **error**: `F` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L429) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) + +## 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) + +*** + +### cast() + +> **cast**\<`S2`\>(): [`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> + +#### Type parameters + +• **S2** = `never` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) + +*** + +### dispose() + +> **dispose**(): `void` + +#### Returns + +`void` + +#### Overrides + +`AbstractDisposableResult.dispose` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L439) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Overrides + +`AbstractDisposableResult.unwrap` + +#### 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`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Overrides + +`AbstractDisposableResult.unwrapOr` + +#### 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)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `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`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### 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..2b9f086a --- /dev/null +++ b/doc/quickjs-emscripten/classes/DisposableSuccess.md @@ -0,0 +1,265 @@ +[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`\<`S`, `F`\> + +## Type parameters + +• **S** + +• **F** + +## Constructors + +### new DisposableSuccess(value) + +> **new DisposableSuccess**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### Overrides + +`AbstractDisposableResult.constructor` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) + +## Properties + +### error? + +> **error**?: `undefined` + +#### 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) + +*** + +### value + +> **`readonly`** **value**: `S` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) + +## Accessors + +### alive + +> **`get`** **alive**(): `boolean` + +#### Returns + +`boolean` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:408](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L408) + +## 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:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L412) + +*** + +### unwrap() + +> **unwrap**(): `S` + +#### Returns + +`S` + +#### Overrides + +`AbstractDisposableResult.unwrap` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L418) + +*** + +### unwrapOr() + +> **unwrapOr**\<`T`\>(`_fallback`): `S` \| `T` + +#### Type parameters + +• **T** + +#### Parameters + +• **\_fallback**: `T` + +#### Returns + +`S` \| `T` + +#### Overrides + +`AbstractDisposableResult.unwrapOr` + +#### Source + +[packages/quickjs-emscripten-core/src/lifetime.ts:422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L422) + +*** + +### fail() + +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **error**: `F` + +• **onUnwrap**: (`status`) => `void` + +#### Returns + +[`DisposableFail`](DisposableFail.md)\<`S`, `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`, `F`\> + +#### Type parameters + +• **S** + +• **F** + +#### Parameters + +• **value**: `S` + +#### Returns + +[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> + +#### 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/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/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/) From 3cf1e390fadc2a0c0c1528a8cbc1539b6dd05278 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 13:57:31 -0400 Subject: [PATCH 13/43] adjust DisposableResult impl and union --- .../src/QuickJSIterator.ts | 19 +++-- .../quickjs-emscripten-core/src/context.ts | 2 +- .../src/lifetime.test.ts | 76 ++++++++++++++++++- .../quickjs-emscripten-core/src/lifetime.ts | 42 +++++----- 4 files changed, 104 insertions(+), 35 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts index f7643aaa..038a415c 100644 --- a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts +++ b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts @@ -1,8 +1,7 @@ -import type { QuickJSContext } from "./context" -import { Lifetime, UsingDisposable } from "./lifetime" +import type { ContextResult, QuickJSContext } from "./context" +import { DisposableResult, Lifetime, UsingDisposable } from "./lifetime" import type { QuickJSRuntime } from "./runtime" import type { QuickJSHandle } from "./types" -import type { VmCallResult } from "./vm-interface" /** * Proxies the iteration protocol from the host to a guest iterator. @@ -29,7 +28,7 @@ import type { VmCallResult } from "./vm-interface" */ export class QuickJSIterator extends UsingDisposable - implements Disposable, Iterator> + implements Disposable, Iterator> { public owner: QuickJSRuntime private _next: QuickJSHandle | undefined @@ -43,7 +42,7 @@ export class QuickJSIterator this.owner = context.runtime } - next(value?: QuickJSHandle): IteratorResult, any> { + next(value?: QuickJSHandle): IteratorResult, any> { if (!this.alive || this._isDone) { return { done: true, @@ -55,7 +54,7 @@ export class QuickJSIterator return this.callIteratorMethod(nextMethod, value) } - return(value?: QuickJSHandle): IteratorResult, any> { + return(value?: QuickJSHandle): IteratorResult, any> { if (!this.alive) { return { done: true, @@ -81,7 +80,7 @@ export class QuickJSIterator return result } - throw(e?: any): IteratorResult, any> { + throw(e?: any): IteratorResult, any> { if (!this.alive) { return { done: true, @@ -113,7 +112,7 @@ export class QuickJSIterator private callIteratorMethod( method: QuickJSHandle, input?: QuickJSHandle, - ): IteratorResult, any> { + ): IteratorResult, any> { const callResult = input ? this.context.callFunction(method, this.handle, input) : this.context.callFunction(method, this.handle) @@ -137,8 +136,8 @@ export class QuickJSIterator const value = this.context.getProp(callResult.value, "value") callResult.value.dispose() return { - value: { value }, - done, + value: DisposableResult.success(value), + done: done as false, } } } diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 25a25502..3cebc1c3 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -925,7 +925,7 @@ export class QuickJSContext const methodHandle = scope.manage(this.getProp(handle, SymbolIterator)) const iteratorCallResult = this.callFunction(methodHandle, handle) if (iteratorCallResult.error) { - return iteratorCallResult.cast() + return iteratorCallResult } return this.success(new QuickJSIterator(iteratorCallResult.value, this)) }) diff --git a/packages/quickjs-emscripten-core/src/lifetime.test.ts b/packages/quickjs-emscripten-core/src/lifetime.test.ts index 565b73f7..f8497fee 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 } from "./lifetime" describe("Lifetime", () => { describe(".consume", () => { @@ -57,3 +57,77 @@ describe("Scope", () => { }) }) }) + +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 e6d3dada..2bf6389b 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -1,4 +1,4 @@ -import { SuccessOrFail } from "./vm-interface" +import type { SuccessOrFail } from "./vm-interface" import type { MaybeAsyncBlock } from "./asyncify-helpers" import { maybeAsync } from "./asyncify-helpers" import { QTS_DEBUG } from "./debug" @@ -376,16 +376,16 @@ function isDisposable(value: unknown): value is { alive: boolean; dispose(): unk ) } -abstract class AbstractDisposableResult extends UsingDisposable { - static success(value: S): DisposableSuccess { +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) 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 { @@ -394,11 +394,9 @@ abstract class AbstractDisposableResult extends UsingDisposable { abstract get alive(): boolean abstract dispose(): void - abstract unwrap(): S - abstract unwrapOr(fallback: T): S | T } -export class DisposableSuccess extends AbstractDisposableResult { +export class DisposableSuccess extends AbstractDisposableResult { declare error?: undefined constructor(readonly value: S) { @@ -415,19 +413,19 @@ export class DisposableSuccess extends AbstractDisposableResult { } } - override unwrap(): S { + unwrap(): S { return this.value } - override unwrapOr(_fallback: T): S | T { + unwrapOr(_fallback: T): S | T { return this.value } } -export class DisposableFail extends AbstractDisposableResult { +export class DisposableFail extends AbstractDisposableResult { constructor( readonly error: F, - private readonly onUnwrap: (status: SuccessOrFail) => void, + private readonly onUnwrap: (status: SuccessOrFail) => void, ) { super() } @@ -437,22 +435,20 @@ export class DisposableFail extends AbstractDisposableResult { } override dispose(): void { - throw new Error("Method not implemented.") + if (isDisposable(this.error)) { + this.error.dispose() + } } - override unwrap(): S { + unwrap(): never { this.onUnwrap(this) throw this.error } - override unwrapOr(fallback: T): S | T { + unwrapOr(fallback: T): T { return fallback } - - cast(): DisposableFail { - return this as unknown as DisposableFail - } } -export type DisposableResult = DisposableSuccess | DisposableFail +export type DisposableResult = DisposableSuccess | DisposableFail export const DisposableResult = AbstractDisposableResult From 0cd9531faa44f3264c0413ed001442ebb183f216 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 14:02:54 -0400 Subject: [PATCH 14/43] fix types more --- packages/quickjs-emscripten-core/src/context.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 3cebc1c3..1957e87e 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -17,12 +17,7 @@ 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 { - QuickJSEmscriptenModuleError, - QuickJSNotImplemented, - QuickJSPromisePending, - QuickJSUnwrapError, -} from "./errors" +import { QuickJSNotImplemented, QuickJSPromisePending, QuickJSUnwrapError } from "./errors" import type { Disposable, DisposableArray, DisposableFail, DisposableSuccess } from "./lifetime" import { DisposableResult, @@ -1337,11 +1332,11 @@ export class QuickJSContext return this.memory.heapValueHandle(ptr) } - protected success(value: S): DisposableSuccess { + protected success(value: S): DisposableSuccess { return DisposableResult.success(value) } - protected fail(error: QuickJSHandle): DisposableFail { + protected fail(error: QuickJSHandle): DisposableFail { return DisposableResult.fail(error, (error) => this.unwrapResult(error)) } } From 382448e401b4ddec9e30954cb7bb3acde0aa32a2 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sun, 25 Aug 2024 21:55:40 -0400 Subject: [PATCH 15/43] getPropNames passing --- c/interface.c | 66 ++- doc/@jitl/quickjs-ffi-types/exports.md | 53 +- .../interfaces/QuickJSAsyncFFI.md | 152 +++--- .../interfaces/QuickJSFFI.md | 132 ++--- .../README.md | 1 + .../quickjs-ng-wasmfile-debug-sync/README.md | 1 + .../README.md | 1 + .../README.md | 1 + .../README.md | 1 + .../README.md | 1 + .../README.md | 1 + .../README.md | 1 + .../quickjs-wasmfile-debug-asyncify/README.md | 1 + .../quickjs-wasmfile-debug-sync/README.md | 1 + .../classes/DisposableFail.md | 63 +-- .../classes/DisposableSuccess.md | 42 +- .../classes/QuickJSAsyncContext.md | 88 ++-- .../classes/QuickJSContext.md | 90 ++-- doc/quickjs-emscripten-core/exports.md | 63 ++- .../interfaces/QuickJSAsyncFFI.md | 152 +++--- .../interfaces/QuickJSFFI.md | 132 ++--- .../classes/DisposableFail.md | 63 +-- .../classes/DisposableSuccess.md | 42 +- .../classes/QuickJSAsyncContext.md | 88 ++-- .../classes/QuickJSContext.md | 90 ++-- doc/quickjs-emscripten/exports.md | 69 ++- .../interfaces/EmscriptenModule.md | 44 +- .../interfaces/EmscriptenModuleLoader.md | 2 +- .../EmscriptenModuleLoaderOptions.md | 10 +- .../QuickJSAsyncEmscriptenModule.md | 48 +- .../interfaces/QuickJSAsyncFFI.md | 152 +++--- .../interfaces/QuickJSAsyncVariant.md | 6 +- .../interfaces/QuickJSEmscriptenModule.md | 48 +- .../interfaces/QuickJSFFI.md | 132 ++--- .../interfaces/QuickJSSyncVariant.md | 6 +- .../interfaces/SourceMapData.md | 8 +- package.json | 6 +- .../internal-tsconfig/vite.base.config.mts | 7 +- .../quickjs-emscripten-core/src/context.ts | 9 +- .../src/lifetime.test.ts | 25 +- .../quickjs-emscripten-core/src/lifetime.ts | 2 +- packages/quickjs-emscripten-core/src/types.ts | 16 +- packages/quickjs-emscripten/src/leak.test.ts | 4 +- .../quickjs-emscripten/src/quickjs.test.ts | 108 ++-- packages/quickjs-ffi-types/src/ffi-async.ts | 5 +- packages/quickjs-ffi-types/src/ffi-types.ts | 9 + packages/quickjs-ffi-types/src/ffi.ts | 3 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 5 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 3 +- .../src/ffi.ts | 5 +- .../src/ffi.ts | 3 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 5 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 3 +- .../src/ffi.ts | 5 +- .../src/ffi.ts | 3 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 5 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 3 +- .../src/ffi.ts | 5 +- .../src/ffi.ts | 3 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 5 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 3 +- .../src/ffi.ts | 5 +- .../src/ffi.ts | 3 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 5 +- .../Makefile | 1 + .../README.md | 1 + .../src/ffi.ts | 3 +- .../src/ffi.ts | 5 +- .../src/ffi.ts | 3 +- scripts/prepareVariants.ts | 2 + yarn.lock | 466 ++++++++---------- 89 files changed, 1370 insertions(+), 1243 deletions(-) diff --git a/c/interface.c b/c/interface.c index 91d1f925..08f37701 100644 --- a/c/interface.c +++ b/c/interface.c @@ -591,19 +591,73 @@ void QTS_DefineProp(JSContext *ctx, JSValueConst *this_val, JSValueConst *prop_n JS_FreeAtom(ctx, prop_atom); } -MaybeAsync(JSValue *) QTS_GetOwnPropertyNames(JSContext *ctx, JSValue **out_ptrs, uint32_t *out_len, JSValueConst *obj, int flags) { +#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, out_len, *obj, flags); + 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 < *out_len; i++) { - out_ptrs[i] = jsvalue_to_heap(JS_AtomToValue(ctx, tab[i].atom)); - JS_FreeAtom(ctx, tab[i].atom); + 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; } @@ -1152,4 +1206,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 3f3bb14e..880f8785 100644 --- a/doc/@jitl/quickjs-ffi-types/exports.md +++ b/doc/@jitl/quickjs-ffi-types/exports.md @@ -23,6 +23,7 @@ - [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) @@ -63,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) *** @@ -96,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) *** @@ -144,7 +145,7 @@ State of a promise. #### 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) +[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) *** @@ -181,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) *** @@ -210,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`\> @@ -218,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) *** @@ -231,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) *** @@ -243,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) *** @@ -255,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) *** @@ -267,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) *** @@ -287,7 +300,7 @@ Used internally for C-to-Javascript module loading. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L96) +[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 @@ -355,7 +368,7 @@ module code #### 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) +[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) *** @@ -387,9 +400,17 @@ Bitfield options for QTS_GetOwnPropertyNames > **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:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L116) +[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) *** @@ -467,7 +488,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[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) +[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) *** @@ -491,7 +512,7 @@ Bitfield options for QTS_NewContext intrinsics #### 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) +[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) *** @@ -515,7 +536,7 @@ Bitfield options for QTS_NewContext intrinsics #### 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) +[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 @@ -548,7 +569,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md index 008cecb0..ac2b03c5 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md @@ -103,7 +103,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:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L39) *** @@ -123,7 +123,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -137,7 +137,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) *** @@ -151,7 +151,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) +[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) *** @@ -165,7 +165,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) +[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -191,7 +191,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L172) +[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) *** @@ -217,7 +217,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L179) +[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) *** @@ -251,7 +251,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L147) +[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) *** @@ -271,7 +271,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) +[packages/quickjs-ffi-types/src/ffi-async.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L188) *** @@ -291,7 +291,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) +[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) *** @@ -311,7 +311,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) +[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) *** @@ -339,7 +339,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) +[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) *** @@ -367,7 +367,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L203) +[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) *** @@ -389,7 +389,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) +[packages/quickjs-ffi-types/src/ffi-async.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L106) *** @@ -411,7 +411,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L110) +[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) *** @@ -431,7 +431,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) +[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -449,7 +449,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -467,7 +467,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -487,7 +487,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -507,7 +507,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -527,7 +527,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) +[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -547,7 +547,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) +[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) *** @@ -567,7 +567,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) +[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) *** @@ -581,7 +581,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) +[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -601,7 +601,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) +[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) *** @@ -619,7 +619,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:230](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L230) +[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) *** @@ -641,7 +641,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) +[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) *** @@ -661,7 +661,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L211) +[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) *** @@ -675,7 +675,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) +[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -687,7 +687,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -701,7 +701,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L158) +[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) *** @@ -713,7 +713,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -727,7 +727,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L165) +[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) *** @@ -749,7 +749,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L115) +[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) *** @@ -771,7 +771,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L125) +[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) *** @@ -793,7 +793,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:130](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L130) +[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) *** @@ -815,7 +815,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L120) +[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) *** @@ -835,7 +835,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) +[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) *** @@ -855,7 +855,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L95) +[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) *** @@ -875,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) +[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) *** @@ -889,7 +889,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) +[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -903,7 +903,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) +[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) *** @@ -927,7 +927,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L224) +[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) *** @@ -947,7 +947,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) +[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) *** @@ -965,7 +965,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) +[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) *** @@ -983,7 +983,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) +[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) *** @@ -1005,7 +1005,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) +[packages/quickjs-ffi-types/src/ffi-async.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L71) *** @@ -1025,7 +1025,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -1043,7 +1043,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) +[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1063,7 +1063,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) *** @@ -1085,7 +1085,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -1103,7 +1103,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) +[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) *** @@ -1123,7 +1123,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) +[packages/quickjs-ffi-types/src/ffi-async.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L66) *** @@ -1143,7 +1143,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) +[packages/quickjs-ffi-types/src/ffi-async.ts:232](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L232) *** @@ -1157,7 +1157,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) +[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -1177,7 +1177,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) +[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) *** @@ -1199,7 +1199,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) +[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) *** @@ -1219,7 +1219,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) +[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) *** @@ -1239,7 +1239,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) +[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) *** @@ -1253,7 +1253,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) +[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -1273,7 +1273,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L186) +[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) *** @@ -1293,7 +1293,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) +[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1311,7 +1311,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) +[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) *** @@ -1329,7 +1329,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) *** @@ -1347,7 +1347,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) +[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1365,7 +1365,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) +[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) *** @@ -1385,7 +1385,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) +[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) *** @@ -1405,7 +1405,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) +[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) *** @@ -1425,7 +1425,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) +[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1449,7 +1449,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L135) +[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) *** @@ -1473,7 +1473,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L141) +[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) *** @@ -1491,7 +1491,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) +[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) *** @@ -1511,7 +1511,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:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) *** @@ -1531,7 +1531,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:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L216) *** @@ -1551,7 +1551,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) +[packages/quickjs-ffi-types/src/ffi-async.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L260) *** @@ -1571,7 +1571,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) *** diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md index c75930bb..7158ea5d 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md @@ -94,7 +94,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:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) *** @@ -114,7 +114,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -128,7 +128,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) *** @@ -142,7 +142,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) +[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) *** @@ -156,7 +156,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) +[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -182,7 +182,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L139) +[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) *** @@ -216,7 +216,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L121) +[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) *** @@ -236,7 +236,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) +[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) *** @@ -256,7 +256,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) +[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -284,7 +284,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) +[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) *** @@ -306,7 +306,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) +[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) *** @@ -326,7 +326,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -344,7 +344,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -362,7 +362,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -382,7 +382,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -402,7 +402,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -422,7 +422,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -442,7 +442,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) +[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) *** @@ -462,7 +462,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) +[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) *** @@ -476,7 +476,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) +[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -496,7 +496,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) +[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -514,7 +514,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L178) +[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) *** @@ -536,7 +536,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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L168) *** @@ -556,7 +556,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L159) +[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) *** @@ -570,7 +570,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) +[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -582,7 +582,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -596,7 +596,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:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L133) *** @@ -618,7 +618,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L105) +[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) *** @@ -640,7 +640,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L110) +[packages/quickjs-ffi-types/src/ffi.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L111) *** @@ -660,7 +660,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** @@ -680,7 +680,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L94) +[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) *** @@ -694,7 +694,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) +[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -708,7 +708,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) +[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) *** @@ -732,7 +732,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L172) +[packages/quickjs-ffi-types/src/ffi.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L173) *** @@ -752,7 +752,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) +[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -770,7 +770,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) +[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -788,7 +788,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) +[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -810,7 +810,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) +[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) *** @@ -830,7 +830,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -848,7 +848,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -868,7 +868,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -890,7 +890,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -908,7 +908,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) +[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -928,7 +928,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) +[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) *** @@ -948,7 +948,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) +[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) *** @@ -962,7 +962,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) +[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -982,7 +982,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) +[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -1004,7 +1004,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) +[packages/quickjs-ffi-types/src/ffi.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) *** @@ -1024,7 +1024,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) +[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) *** @@ -1044,7 +1044,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) +[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) *** @@ -1058,7 +1058,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) +[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -1078,7 +1078,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L146) +[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -1098,7 +1098,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1116,7 +1116,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) +[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) *** @@ -1134,7 +1134,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1152,7 +1152,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) +[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1170,7 +1170,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) +[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) *** @@ -1190,7 +1190,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) +[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1210,7 +1210,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) +[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -1230,7 +1230,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) +[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -1254,7 +1254,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L115) +[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) *** @@ -1272,7 +1272,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) +[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -1292,7 +1292,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -1312,7 +1312,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) +[packages/quickjs-ffi-types/src/ffi.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) *** @@ -1332,7 +1332,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) +[packages/quickjs-ffi-types/src/ffi.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L208) *** @@ -1352,7 +1352,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md index c06b4a45..7340b641 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md @@ -94,6 +94,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", 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..7fd86b08 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", 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..cf788561 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", 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..6032cbba 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", 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..5580d361 100644 --- a/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md @@ -94,6 +94,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", 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/quickjs-emscripten-core/classes/DisposableFail.md b/doc/quickjs-emscripten-core/classes/DisposableFail.md index 976abfa0..3a615c2c 100644 --- a/doc/quickjs-emscripten-core/classes/DisposableFail.md +++ b/doc/quickjs-emscripten-core/classes/DisposableFail.md @@ -4,7 +4,7 @@ [quickjs-emscripten](../../packages.md) / [quickjs-emscripten-core](../exports.md) / DisposableFail -# Class: DisposableFail\ +# Class: DisposableFail\ ## Contents @@ -18,7 +18,6 @@ - [alive](DisposableFail.md#alive) - [Methods](DisposableFail.md#methods) - [`[dispose]`()](DisposableFail.md#dispose) - - [cast()](DisposableFail.md#cast) - [dispose()](DisposableFail.md#dispose) - [unwrap()](DisposableFail.md#unwrap) - [unwrapOr()](DisposableFail.md#unwrapor) @@ -28,19 +27,17 @@ ## Extends -- `AbstractDisposableResult`\<`S`, `F`\> +- `AbstractDisposableResult` ## Type parameters -• **S** - • **F** ## Constructors ### new DisposableFail(error, onUnwrap) -> **new DisposableFail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +> **new DisposableFail**\<`F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Parameters @@ -50,15 +47,15 @@ #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Overrides -`AbstractDisposableResult.constructor` +`AbstractDisposableResult.constructor` #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L428) +[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 @@ -68,7 +65,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L429) +[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 @@ -82,7 +79,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) +[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 @@ -106,24 +103,6 @@ Just calls the standard .dispose() method of this class. *** -### cast() - -> **cast**\<`S2`\>(): [`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> - -#### Type parameters - -• **S2** = `never` - -#### Returns - -[`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> - -#### Source - -[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) - -*** - ### dispose() > **dispose**(): `void` @@ -138,21 +117,17 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L439) +[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**(): `S` +> **unwrap**(): `never` #### Returns -`S` - -#### Overrides - -`AbstractDisposableResult.unwrap` +`never` #### Source @@ -162,7 +137,7 @@ Just calls the standard .dispose() method of this class. ### unwrapOr() -> **unwrapOr**\<`T`\>(`fallback`): `S` \| `T` +> **unwrapOr**\<`T`\>(`fallback`): `T` #### Type parameters @@ -174,11 +149,7 @@ Just calls the standard .dispose() method of this class. #### Returns -`S` \| `T` - -#### Overrides - -`AbstractDisposableResult.unwrapOr` +`T` #### Source @@ -188,7 +159,7 @@ Just calls the standard .dispose() method of this class. ### fail() -> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Type parameters @@ -204,7 +175,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Inherited from @@ -246,7 +217,7 @@ Just calls the standard .dispose() method of this class. ### success() -> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -260,7 +231,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from diff --git a/doc/quickjs-emscripten-core/classes/DisposableSuccess.md b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md index 4e77d10c..ff6d43a1 100644 --- a/doc/quickjs-emscripten-core/classes/DisposableSuccess.md +++ b/doc/quickjs-emscripten-core/classes/DisposableSuccess.md @@ -4,7 +4,7 @@ [quickjs-emscripten](../../packages.md) / [quickjs-emscripten-core](../exports.md) / DisposableSuccess -# Class: DisposableSuccess\ +# Class: DisposableSuccess\ ## Contents @@ -28,19 +28,17 @@ ## Extends -- `AbstractDisposableResult`\<`S`, `F`\> +- `AbstractDisposableResult` ## Type parameters • **S** -• **F** - ## Constructors ### new DisposableSuccess(value) -> **new DisposableSuccess**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **new DisposableSuccess**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Parameters @@ -48,15 +46,15 @@ #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Overrides -`AbstractDisposableResult.constructor` +`AbstractDisposableResult.constructor` #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) +[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 @@ -66,7 +64,7 @@ #### 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) +[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) *** @@ -76,7 +74,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) +[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 @@ -90,7 +88,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:408](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L408) +[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 @@ -128,7 +126,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L412) +[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) *** @@ -140,13 +138,9 @@ Just calls the standard .dispose() method of this class. `S` -#### Overrides - -`AbstractDisposableResult.unwrap` - #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L418) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -166,19 +160,15 @@ Just calls the standard .dispose() method of this class. `S` \| `T` -#### Overrides - -`AbstractDisposableResult.unwrapOr` - #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L422) +[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)\<`S`, `F`\> +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Type parameters @@ -194,7 +184,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Inherited from @@ -236,7 +226,7 @@ Just calls the standard .dispose() method of this class. ### success() -> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -250,7 +240,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index 6dc08a43..fd74efac 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -111,7 +111,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) +[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) ## Properties @@ -145,7 +145,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) +[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) *** @@ -161,7 +161,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -179,7 +179,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) +[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) *** @@ -195,7 +195,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) *** @@ -211,7 +211,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -227,7 +227,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) +[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) ## Methods @@ -374,7 +374,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) +[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) *** @@ -461,7 +461,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) +[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) *** @@ -556,11 +556,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics ### fail() -> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> - -#### Type parameters - -• **S** +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Parameters @@ -568,7 +564,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Inherited from @@ -600,7 +596,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) +[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) *** @@ -624,7 +620,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) +[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) *** @@ -688,7 +684,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) +[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) *** @@ -714,7 +710,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) +[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) *** @@ -748,7 +744,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) +[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) *** @@ -778,7 +774,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -805,7 +801,7 @@ Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web #### 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) +[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) *** @@ -829,7 +825,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) +[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) *** @@ -854,7 +850,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) +[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) *** @@ -878,7 +874,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) +[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) *** @@ -899,7 +895,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) +[packages/quickjs-emscripten-core/src/context.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) *** @@ -923,7 +919,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) +[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) *** @@ -979,7 +975,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) +[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) *** @@ -1007,7 +1003,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) +[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) #### newError(message) @@ -1027,7 +1023,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) #### newError(undefined) @@ -1043,7 +1039,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) *** @@ -1160,7 +1156,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) +[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) *** @@ -1184,7 +1180,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) +[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) *** @@ -1211,7 +1207,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) +[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) *** @@ -1236,7 +1232,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) #### newPromise(promise) @@ -1262,7 +1258,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) +[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) #### newPromise(newPromiseFn) @@ -1287,7 +1283,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) +[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) *** @@ -1311,7 +1307,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) +[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) *** @@ -1336,7 +1332,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) +[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) *** @@ -1361,7 +1357,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) +[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) *** @@ -1393,7 +1389,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) +[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) *** @@ -1420,7 +1416,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) +[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) *** @@ -1447,7 +1443,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) +[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) *** @@ -1490,7 +1486,7 @@ properties. ### success() -> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -1502,7 +1498,7 @@ properties. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from @@ -1562,7 +1558,7 @@ Does not support BigInt values correctly. #### 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:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index 5a3d26d1..e6379d1a 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -139,7 +139,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) +[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) ## Properties @@ -151,7 +151,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context.ts:185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L185) +[packages/quickjs-emscripten-core/src/context.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L182) ## Accessors @@ -169,7 +169,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) +[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) *** @@ -185,7 +185,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -203,7 +203,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) +[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) *** @@ -219,7 +219,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) *** @@ -235,7 +235,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -251,7 +251,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) +[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) ## Methods @@ -402,7 +402,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) +[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) *** @@ -477,7 +477,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) +[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) *** @@ -546,11 +546,7 @@ interrupted, the error will have name `InternalError` and message ### fail() -> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> - -#### Type parameters - -• **S** +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Parameters @@ -558,7 +554,7 @@ interrupted, the error will have name `InternalError` and message #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Source @@ -582,7 +578,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) +[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) *** @@ -602,7 +598,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) +[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) *** @@ -658,7 +654,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) +[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) *** @@ -684,7 +680,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) +[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) *** @@ -714,7 +710,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) +[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) *** @@ -744,7 +740,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -767,7 +763,7 @@ Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web #### 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) +[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) *** @@ -791,7 +787,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) +[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) *** @@ -812,7 +808,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) +[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) *** @@ -832,7 +828,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) +[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) *** @@ -849,7 +845,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) +[packages/quickjs-emscripten-core/src/context.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) *** @@ -869,7 +865,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) +[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) *** @@ -889,7 +885,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) +[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) *** @@ -913,7 +909,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) +[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) #### newError(message) @@ -929,7 +925,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) #### newError(undefined) @@ -941,7 +937,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) *** @@ -1058,7 +1054,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) +[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) *** @@ -1082,7 +1078,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) +[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) *** @@ -1109,7 +1105,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) +[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) *** @@ -1130,7 +1126,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) #### newPromise(promise) @@ -1152,7 +1148,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) +[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) #### newPromise(newPromiseFn) @@ -1173,7 +1169,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) +[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) *** @@ -1197,7 +1193,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) +[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) *** @@ -1218,7 +1214,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) +[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) *** @@ -1239,7 +1235,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) +[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) *** @@ -1267,7 +1263,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) +[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) *** @@ -1290,7 +1286,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) +[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) *** @@ -1313,7 +1309,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) +[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) *** @@ -1356,7 +1352,7 @@ properties. ### success() -> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -1368,7 +1364,7 @@ properties. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Source @@ -1420,7 +1416,7 @@ Does not support BigInt values correctly. #### 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:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) *** diff --git a/doc/quickjs-emscripten-core/exports.md b/doc/quickjs-emscripten-core/exports.md index 21abec47..939f1b2b 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -40,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) @@ -158,7 +159,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) *** @@ -183,7 +184,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): ### DisposableResult\ -> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`, `F`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`S`, `F`\> +> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`F`\> #### Type parameters @@ -193,7 +194,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -349,7 +350,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) *** @@ -470,7 +471,7 @@ State of a promise. #### 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) +[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) *** @@ -550,7 +551,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) *** @@ -579,6 +580,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`\> @@ -587,7 +600,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) *** @@ -614,7 +627,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) *** @@ -640,7 +653,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-emscripten-core/src/types.ts:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L318) +[packages/quickjs-emscripten-core/src/types.ts:332](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L332) *** @@ -666,7 +679,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) *** @@ -678,7 +691,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) *** @@ -690,7 +703,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) *** @@ -719,7 +732,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L67) +[packages/quickjs-emscripten-core/src/context.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L64) *** @@ -771,7 +784,7 @@ Used as an optional. #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:96](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L96) +[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) *** @@ -891,7 +904,7 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -959,7 +972,7 @@ module code #### 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) +[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) *** @@ -991,9 +1004,17 @@ Bitfield options for QTS_GetOwnPropertyNames > **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:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L116) +[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) *** @@ -1071,7 +1092,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[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) +[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) *** @@ -1095,7 +1116,7 @@ Bitfield options for QTS_NewContext intrinsics #### 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) +[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) *** @@ -1119,7 +1140,7 @@ Bitfield options for QTS_NewContext intrinsics #### 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) +[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 @@ -1152,7 +1173,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131) +[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md index ee63b4a6..ea771a48 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md @@ -103,7 +103,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:39](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L39) *** @@ -123,7 +123,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -137,7 +137,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) *** @@ -151,7 +151,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:244](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L244) +[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) *** @@ -165,7 +165,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) +[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) *** @@ -191,7 +191,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L172) +[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) *** @@ -217,7 +217,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L179) +[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) *** @@ -251,7 +251,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L147) +[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) *** @@ -271,7 +271,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L187) +[packages/quickjs-ffi-types/src/ffi-async.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L188) *** @@ -291,7 +291,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L191) +[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) *** @@ -311,7 +311,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) +[packages/quickjs-ffi-types/src/ffi-async.ts:61](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L61) *** @@ -339,7 +339,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L195) +[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) *** @@ -367,7 +367,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L203) +[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) *** @@ -389,7 +389,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) +[packages/quickjs-ffi-types/src/ffi-async.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L106) *** @@ -411,7 +411,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L110) +[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) *** @@ -431,7 +431,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) +[packages/quickjs-ffi-types/src/ffi-async.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L60) *** @@ -449,7 +449,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L56) *** @@ -467,7 +467,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L54) *** @@ -487,7 +487,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L57) *** @@ -507,7 +507,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:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) *** @@ -527,7 +527,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L58) +[packages/quickjs-ffi-types/src/ffi-async.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L59) *** @@ -547,7 +547,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L82) +[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) *** @@ -567,7 +567,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L86) +[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) *** @@ -581,7 +581,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) +[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) *** @@ -601,7 +601,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) +[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) *** @@ -619,7 +619,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:230](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L230) +[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) *** @@ -641,7 +641,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:219](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L219) +[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) *** @@ -661,7 +661,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:211](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L211) +[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) *** @@ -675,7 +675,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) +[packages/quickjs-ffi-types/src/ffi-async.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L50) *** @@ -687,7 +687,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -701,7 +701,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L158) +[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) *** @@ -713,7 +713,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -727,7 +727,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:165](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L165) +[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) *** @@ -749,7 +749,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L115) +[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) *** @@ -771,7 +771,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L125) +[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) *** @@ -793,7 +793,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:130](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L130) +[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) *** @@ -815,7 +815,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:120](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L120) +[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) *** @@ -835,7 +835,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) +[packages/quickjs-ffi-types/src/ffi-async.ts:79](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L79) *** @@ -855,7 +855,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L95) +[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) *** @@ -875,7 +875,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L99) +[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) *** @@ -889,7 +889,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L51) +[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) *** @@ -903,7 +903,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) +[packages/quickjs-ffi-types/src/ffi-async.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L49) *** @@ -927,7 +927,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:224](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L224) +[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) *** @@ -947,7 +947,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:103](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L103) +[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) *** @@ -965,7 +965,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:104](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L104) +[packages/quickjs-ffi-types/src/ffi-async.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L105) *** @@ -983,7 +983,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L69) +[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) *** @@ -1005,7 +1005,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L70) +[packages/quickjs-ffi-types/src/ffi-async.ts:71](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L71) *** @@ -1025,7 +1025,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L55) *** @@ -1043,7 +1043,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) +[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) *** @@ -1063,7 +1063,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:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L76) *** @@ -1085,7 +1085,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -1103,7 +1103,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L64) +[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) *** @@ -1123,7 +1123,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L65) +[packages/quickjs-ffi-types/src/ffi-async.ts:66](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L66) *** @@ -1143,7 +1143,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:231](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L231) +[packages/quickjs-ffi-types/src/ffi-async.ts:232](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L232) *** @@ -1157,7 +1157,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L52) +[packages/quickjs-ffi-types/src/ffi-async.ts:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L53) *** @@ -1177,7 +1177,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L77) +[packages/quickjs-ffi-types/src/ffi-async.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L78) *** @@ -1199,7 +1199,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L90) +[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) *** @@ -1219,7 +1219,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L239) +[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) *** @@ -1239,7 +1239,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L235) +[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) *** @@ -1253,7 +1253,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) +[packages/quickjs-ffi-types/src/ffi-async.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L46) *** @@ -1273,7 +1273,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:186](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L186) +[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) *** @@ -1293,7 +1293,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) +[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) *** @@ -1311,7 +1311,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) +[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) *** @@ -1329,7 +1329,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) *** @@ -1347,7 +1347,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L44) +[packages/quickjs-ffi-types/src/ffi-async.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L45) *** @@ -1365,7 +1365,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L251) +[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) *** @@ -1385,7 +1385,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) +[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) *** @@ -1405,7 +1405,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L47) +[packages/quickjs-ffi-types/src/ffi-async.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L48) *** @@ -1425,7 +1425,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L42) +[packages/quickjs-ffi-types/src/ffi-async.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L43) *** @@ -1449,7 +1449,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:135](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L135) +[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) *** @@ -1473,7 +1473,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L141) +[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) *** @@ -1491,7 +1491,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:243](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L243) +[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) *** @@ -1511,7 +1511,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:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L41) *** @@ -1531,7 +1531,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:216](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L216) *** @@ -1551,7 +1551,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:259](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L259) +[packages/quickjs-ffi-types/src/ffi-async.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L260) *** @@ -1571,7 +1571,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) *** diff --git a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md index 8184d4e2..a963ebc9 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md @@ -94,7 +94,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:38](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L38) *** @@ -114,7 +114,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -128,7 +128,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) *** @@ -142,7 +142,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) +[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) *** @@ -156,7 +156,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) +[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) *** @@ -182,7 +182,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:139](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L139) +[packages/quickjs-ffi-types/src/ffi.ts:140](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L140) *** @@ -216,7 +216,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L121) +[packages/quickjs-ffi-types/src/ffi.ts:122](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L122) *** @@ -236,7 +236,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) +[packages/quickjs-ffi-types/src/ffi.ts:148](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L148) *** @@ -256,7 +256,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) +[packages/quickjs-ffi-types/src/ffi.ts:60](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L60) *** @@ -284,7 +284,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:151](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L151) +[packages/quickjs-ffi-types/src/ffi.ts:152](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L152) *** @@ -306,7 +306,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) +[packages/quickjs-ffi-types/src/ffi.ts:101](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L101) *** @@ -326,7 +326,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) +[packages/quickjs-ffi-types/src/ffi.ts:59](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L59) *** @@ -344,7 +344,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:55](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L55) *** @@ -362,7 +362,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:53](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L53) *** @@ -382,7 +382,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:56](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L56) *** @@ -402,7 +402,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:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) *** @@ -422,7 +422,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:57](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L57) +[packages/quickjs-ffi-types/src/ffi.ts:58](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L58) *** @@ -442,7 +442,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:81](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L81) +[packages/quickjs-ffi-types/src/ffi.ts:82](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L82) *** @@ -462,7 +462,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:85](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L85) +[packages/quickjs-ffi-types/src/ffi.ts:86](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L86) *** @@ -476,7 +476,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) +[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) *** @@ -496,7 +496,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) +[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) *** @@ -514,7 +514,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:178](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L178) +[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) *** @@ -536,7 +536,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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L168) *** @@ -556,7 +556,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L159) +[packages/quickjs-ffi-types/src/ffi.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L160) *** @@ -570,7 +570,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) +[packages/quickjs-ffi-types/src/ffi.ts:49](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L49) *** @@ -582,7 +582,7 @@ Set at compile time. • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -596,7 +596,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:133](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L133) *** @@ -618,7 +618,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:105](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L105) +[packages/quickjs-ffi-types/src/ffi.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L106) *** @@ -640,7 +640,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:110](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L110) +[packages/quickjs-ffi-types/src/ffi.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L111) *** @@ -660,7 +660,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) +[packages/quickjs-ffi-types/src/ffi.ts:78](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L78) *** @@ -680,7 +680,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:94](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L94) +[packages/quickjs-ffi-types/src/ffi.ts:95](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L95) *** @@ -694,7 +694,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:50](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L50) +[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) *** @@ -708,7 +708,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) +[packages/quickjs-ffi-types/src/ffi.ts:48](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L48) *** @@ -732,7 +732,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:172](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L172) +[packages/quickjs-ffi-types/src/ffi.ts:173](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L173) *** @@ -752,7 +752,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:98](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L98) +[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) *** @@ -770,7 +770,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:99](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L99) +[packages/quickjs-ffi-types/src/ffi.ts:100](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L100) *** @@ -788,7 +788,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:68](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L68) +[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) *** @@ -810,7 +810,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L69) +[packages/quickjs-ffi-types/src/ffi.ts:70](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L70) *** @@ -830,7 +830,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:54](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L54) *** @@ -848,7 +848,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) +[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) *** @@ -868,7 +868,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:75](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L75) *** @@ -890,7 +890,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -908,7 +908,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:63](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L63) +[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) *** @@ -928,7 +928,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L64) +[packages/quickjs-ffi-types/src/ffi.ts:65](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L65) *** @@ -948,7 +948,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:179](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L179) +[packages/quickjs-ffi-types/src/ffi.ts:180](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L180) *** @@ -962,7 +962,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:51](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L51) +[packages/quickjs-ffi-types/src/ffi.ts:52](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L52) *** @@ -982,7 +982,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:76](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L76) +[packages/quickjs-ffi-types/src/ffi.ts:77](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L77) *** @@ -1004,7 +1004,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:89](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L89) +[packages/quickjs-ffi-types/src/ffi.ts:90](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L90) *** @@ -1024,7 +1024,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L187) +[packages/quickjs-ffi-types/src/ffi.ts:188](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L188) *** @@ -1044,7 +1044,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:183](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L183) +[packages/quickjs-ffi-types/src/ffi.ts:184](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L184) *** @@ -1058,7 +1058,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) +[packages/quickjs-ffi-types/src/ffi.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L45) *** @@ -1078,7 +1078,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:146](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L146) +[packages/quickjs-ffi-types/src/ffi.ts:147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L147) *** @@ -1098,7 +1098,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) +[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) *** @@ -1116,7 +1116,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) +[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) *** @@ -1134,7 +1134,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1152,7 +1152,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:43](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L43) +[packages/quickjs-ffi-types/src/ffi.ts:44](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L44) *** @@ -1170,7 +1170,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:199](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L199) +[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) *** @@ -1190,7 +1190,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) +[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1210,7 +1210,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:46](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L46) +[packages/quickjs-ffi-types/src/ffi.ts:47](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L47) *** @@ -1230,7 +1230,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:41](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L41) +[packages/quickjs-ffi-types/src/ffi.ts:42](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L42) *** @@ -1254,7 +1254,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:115](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L115) +[packages/quickjs-ffi-types/src/ffi.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L116) *** @@ -1272,7 +1272,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:191](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L191) +[packages/quickjs-ffi-types/src/ffi.ts:192](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L192) *** @@ -1292,7 +1292,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:40](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L40) *** @@ -1312,7 +1312,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L163) +[packages/quickjs-ffi-types/src/ffi.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L164) *** @@ -1332,7 +1332,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:207](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L207) +[packages/quickjs-ffi-types/src/ffi.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L208) *** @@ -1352,7 +1352,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** diff --git a/doc/quickjs-emscripten/classes/DisposableFail.md b/doc/quickjs-emscripten/classes/DisposableFail.md index 98ec9544..e10ede00 100644 --- a/doc/quickjs-emscripten/classes/DisposableFail.md +++ b/doc/quickjs-emscripten/classes/DisposableFail.md @@ -4,7 +4,7 @@ [quickjs-emscripten](../../packages.md) / [quickjs-emscripten](../exports.md) / DisposableFail -# Class: DisposableFail\ +# Class: DisposableFail\ ## Contents @@ -18,7 +18,6 @@ - [alive](DisposableFail.md#alive) - [Methods](DisposableFail.md#methods) - [`[dispose]`()](DisposableFail.md#dispose) - - [cast()](DisposableFail.md#cast) - [dispose()](DisposableFail.md#dispose) - [unwrap()](DisposableFail.md#unwrap) - [unwrapOr()](DisposableFail.md#unwrapor) @@ -28,19 +27,17 @@ ## Extends -- `AbstractDisposableResult`\<`S`, `F`\> +- `AbstractDisposableResult` ## Type parameters -• **S** - • **F** ## Constructors ### new DisposableFail(error, onUnwrap) -> **new DisposableFail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +> **new DisposableFail**\<`F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Parameters @@ -50,15 +47,15 @@ #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Overrides -`AbstractDisposableResult.constructor` +`AbstractDisposableResult.constructor` #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L428) +[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 @@ -68,7 +65,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L429) +[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 @@ -82,7 +79,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:435](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L435) +[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 @@ -106,24 +103,6 @@ Just calls the standard .dispose() method of this class. *** -### cast() - -> **cast**\<`S2`\>(): [`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> - -#### Type parameters - -• **S2** = `never` - -#### Returns - -[`DisposableFail`](DisposableFail.md)\<`S2`, `F`\> - -#### Source - -[packages/quickjs-emscripten-core/src/lifetime.ts:452](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L452) - -*** - ### dispose() > **dispose**(): `void` @@ -138,21 +117,17 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L439) +[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**(): `S` +> **unwrap**(): `never` #### Returns -`S` - -#### Overrides - -`AbstractDisposableResult.unwrap` +`never` #### Source @@ -162,7 +137,7 @@ Just calls the standard .dispose() method of this class. ### unwrapOr() -> **unwrapOr**\<`T`\>(`fallback`): `S` \| `T` +> **unwrapOr**\<`T`\>(`fallback`): `T` #### Type parameters @@ -174,11 +149,7 @@ Just calls the standard .dispose() method of this class. #### Returns -`S` \| `T` - -#### Overrides - -`AbstractDisposableResult.unwrapOr` +`T` #### Source @@ -188,7 +159,7 @@ Just calls the standard .dispose() method of this class. ### fail() -> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Type parameters @@ -204,7 +175,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Inherited from @@ -246,7 +217,7 @@ Just calls the standard .dispose() method of this class. ### success() -> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -260,7 +231,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from diff --git a/doc/quickjs-emscripten/classes/DisposableSuccess.md b/doc/quickjs-emscripten/classes/DisposableSuccess.md index 2b9f086a..fad44ca8 100644 --- a/doc/quickjs-emscripten/classes/DisposableSuccess.md +++ b/doc/quickjs-emscripten/classes/DisposableSuccess.md @@ -4,7 +4,7 @@ [quickjs-emscripten](../../packages.md) / [quickjs-emscripten](../exports.md) / DisposableSuccess -# Class: DisposableSuccess\ +# Class: DisposableSuccess\ ## Contents @@ -28,19 +28,17 @@ ## Extends -- `AbstractDisposableResult`\<`S`, `F`\> +- `AbstractDisposableResult` ## Type parameters • **S** -• **F** - ## Constructors ### new DisposableSuccess(value) -> **new DisposableSuccess**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **new DisposableSuccess**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Parameters @@ -48,15 +46,15 @@ #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Overrides -`AbstractDisposableResult.constructor` +`AbstractDisposableResult.constructor` #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) +[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 @@ -66,7 +64,7 @@ #### 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) +[packages/quickjs-emscripten-core/src/lifetime.ts:400](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L400) *** @@ -76,7 +74,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:404](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L404) +[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 @@ -90,7 +88,7 @@ #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:408](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L408) +[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 @@ -128,7 +126,7 @@ Just calls the standard .dispose() method of this class. #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L412) +[packages/quickjs-emscripten-core/src/lifetime.ts:410](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L410) *** @@ -140,13 +138,9 @@ Just calls the standard .dispose() method of this class. `S` -#### Overrides - -`AbstractDisposableResult.unwrap` - #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:418](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L418) +[packages/quickjs-emscripten-core/src/lifetime.ts:416](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L416) *** @@ -166,19 +160,15 @@ Just calls the standard .dispose() method of this class. `S` \| `T` -#### Overrides - -`AbstractDisposableResult.unwrapOr` - #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:422](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L422) +[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)\<`S`, `F`\> +> **`static`** **fail**\<`S`, `F`\>(`error`, `onUnwrap`): [`DisposableFail`](DisposableFail.md)\<`F`\> #### Type parameters @@ -194,7 +184,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, `F`\> +[`DisposableFail`](DisposableFail.md)\<`F`\> #### Inherited from @@ -236,7 +226,7 @@ Just calls the standard .dispose() method of this class. ### success() -> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +> **`static`** **success**\<`S`, `F`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -250,7 +240,7 @@ Just calls the standard .dispose() method of this class. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, `F`\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index 8d8391c5..c284544a 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -111,7 +111,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) +[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) ## Properties @@ -145,7 +145,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) +[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) *** @@ -161,7 +161,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -179,7 +179,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) +[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) *** @@ -195,7 +195,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) *** @@ -211,7 +211,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -227,7 +227,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) +[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) ## Methods @@ -374,7 +374,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) +[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) *** @@ -461,7 +461,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) +[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) *** @@ -556,11 +556,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics ### fail() -> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> - -#### Type parameters - -• **S** +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Parameters @@ -568,7 +564,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Inherited from @@ -600,7 +596,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) +[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) *** @@ -624,7 +620,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) +[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) *** @@ -688,7 +684,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) +[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) *** @@ -714,7 +710,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) +[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) *** @@ -748,7 +744,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) +[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) *** @@ -778,7 +774,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -805,7 +801,7 @@ Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web #### 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) +[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) *** @@ -829,7 +825,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) +[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) *** @@ -854,7 +850,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) +[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) *** @@ -878,7 +874,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) +[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) *** @@ -899,7 +895,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) +[packages/quickjs-emscripten-core/src/context.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) *** @@ -923,7 +919,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) +[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) *** @@ -979,7 +975,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) +[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) *** @@ -1007,7 +1003,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) +[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) #### newError(message) @@ -1027,7 +1023,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) #### newError(undefined) @@ -1043,7 +1039,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) *** @@ -1160,7 +1156,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) +[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) *** @@ -1184,7 +1180,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) +[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) *** @@ -1211,7 +1207,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) +[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) *** @@ -1236,7 +1232,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) #### newPromise(promise) @@ -1262,7 +1258,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) +[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) #### newPromise(newPromiseFn) @@ -1287,7 +1283,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) +[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) *** @@ -1311,7 +1307,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) +[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) *** @@ -1336,7 +1332,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) +[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) *** @@ -1361,7 +1357,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) +[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) *** @@ -1393,7 +1389,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) +[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) *** @@ -1420,7 +1416,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) +[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) *** @@ -1447,7 +1443,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) +[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) *** @@ -1490,7 +1486,7 @@ properties. ### success() -> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -1502,7 +1498,7 @@ properties. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Inherited from @@ -1562,7 +1558,7 @@ Does not support BigInt values correctly. #### 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:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 173a54c1..32390f8b 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -139,7 +139,7 @@ to create a new QuickJSContext. #### Source -[packages/quickjs-emscripten-core/src/context.ts:223](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L223) +[packages/quickjs-emscripten-core/src/context.ts:220](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L220) ## Properties @@ -151,7 +151,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context.ts:185](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L185) +[packages/quickjs-emscripten-core/src/context.ts:182](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L182) ## Accessors @@ -169,7 +169,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L254) +[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) *** @@ -185,7 +185,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:312](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L312) +[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) *** @@ -203,7 +203,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:327](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L327) +[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) *** @@ -219,7 +219,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:286](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L286) +[packages/quickjs-emscripten-core/src/context.ts:283](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L283) *** @@ -235,7 +235,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:299](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L299) +[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) *** @@ -251,7 +251,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:273](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L273) +[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) ## Methods @@ -402,7 +402,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:264](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L264) +[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) *** @@ -477,7 +477,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:810](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L810) +[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) *** @@ -546,11 +546,7 @@ interrupted, the error will have name `InternalError` and message ### fail() -> **`protected`** **fail**\<`S`\>(`error`): [`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> - -#### Type parameters - -• **S** +> **`protected`** **fail**(`error`): [`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Parameters @@ -558,7 +554,7 @@ interrupted, the error will have name `InternalError` and message #### Returns -[`DisposableFail`](DisposableFail.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableFail`](DisposableFail.md)\<[`QuickJSHandle`](../exports.md#quickjshandle)\> #### Source @@ -582,7 +578,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:689](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L689) +[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) *** @@ -602,7 +598,7 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:680](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L680) +[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) *** @@ -658,7 +654,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:858](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L858) +[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) *** @@ -684,7 +680,7 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:651](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L651) +[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) *** @@ -714,7 +710,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:714](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L714) +[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) *** @@ -744,7 +740,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:839](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L839) +[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) *** @@ -767,7 +763,7 @@ Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web #### 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) +[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) *** @@ -791,7 +787,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:659](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L659) +[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) *** @@ -812,7 +808,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:668](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L668) +[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) *** @@ -832,7 +828,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:387](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L387) +[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) *** @@ -849,7 +845,7 @@ Create a new QuickJS [array](https://developer.mozilla.org/en-US/docs/Web/JavaSc #### Source -[packages/quickjs-emscripten-core/src/context.ts:429](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L429) +[packages/quickjs-emscripten-core/src/context.ts:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) *** @@ -869,7 +865,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:437](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L437) +[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) *** @@ -889,7 +885,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:395](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L395) +[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) *** @@ -913,7 +909,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:606](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L606) +[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) #### newError(message) @@ -929,7 +925,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:607](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L607) +[packages/quickjs-emscripten-core/src/context.ts:604](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L604) #### newError(undefined) @@ -941,7 +937,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:608](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L608) +[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) *** @@ -1058,7 +1054,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:600](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L600) +[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) *** @@ -1082,7 +1078,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:346](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L346) +[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) *** @@ -1109,7 +1105,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:415](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L415) +[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) *** @@ -1130,7 +1126,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:450](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L450) +[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) #### newPromise(promise) @@ -1152,7 +1148,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:458](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L458) +[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) #### newPromise(newPromiseFn) @@ -1173,7 +1169,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:465](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L465) +[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) *** @@ -1197,7 +1193,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:353](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L353) +[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) *** @@ -1218,7 +1214,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:376](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L376) +[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) *** @@ -1239,7 +1235,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:364](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L364) +[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) *** @@ -1267,7 +1263,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:753](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L753) +[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) *** @@ -1290,7 +1286,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:818](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L818) +[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) *** @@ -1313,7 +1309,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:826](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L826) +[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) *** @@ -1356,7 +1352,7 @@ properties. ### success() -> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +> **`protected`** **success**\<`S`\>(`value`): [`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Type parameters @@ -1368,7 +1364,7 @@ properties. #### Returns -[`DisposableSuccess`](DisposableSuccess.md)\<`S`, [`QuickJSHandle`](../exports.md#quickjshandle)\> +[`DisposableSuccess`](DisposableSuccess.md)\<`S`\> #### Source @@ -1420,7 +1416,7 @@ Does not support BigInt values correctly. #### 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:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) *** diff --git a/doc/quickjs-emscripten/exports.md b/doc/quickjs-emscripten/exports.md index be55879d..1d4d2563 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -40,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) @@ -172,7 +173,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:66 +packages/quickjs-ffi-types/dist/index.d.ts:70 *** @@ -197,7 +198,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): ### DisposableResult\ -> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`, `F`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`S`, `F`\> +> **DisposableResult**\<`S`, `F`\>: [`DisposableSuccess`](classes/DisposableSuccess.md)\<`S`\> \| [`DisposableFail`](classes/DisposableFail.md)\<`F`\> #### Type parameters @@ -207,7 +208,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -217,7 +218,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -packages/quickjs-ffi-types/dist/index.d.ts:528 +packages/quickjs-ffi-types/dist/index.d.ts:534 *** @@ -227,7 +228,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:528 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:326 +packages/quickjs-ffi-types/dist/index.d.ts:332 *** @@ -363,7 +364,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:76 +packages/quickjs-ffi-types/dist/index.d.ts:80 *** @@ -484,7 +485,7 @@ State of a promise. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:141 +packages/quickjs-ffi-types/dist/index.d.ts:145 *** @@ -564,7 +565,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 *** @@ -593,6 +594,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`\> @@ -601,7 +614,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 *** @@ -628,7 +641,7 @@ for the Emscripten stack. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:71 +packages/quickjs-ffi-types/dist/index.d.ts:75 *** @@ -654,7 +667,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:71 #### Source -[packages/quickjs-emscripten-core/src/types.ts:318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L318) +[packages/quickjs-emscripten-core/src/types.ts:332](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L332) *** @@ -680,7 +693,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 *** @@ -692,7 +705,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 *** @@ -704,7 +717,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 *** @@ -733,7 +746,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:67](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L67) +[packages/quickjs-emscripten-core/src/context.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L64) *** @@ -743,7 +756,7 @@ Property key for getting or setting a property on a handle with #### Source -packages/quickjs-ffi-types/dist/index.d.ts:527 +packages/quickjs-ffi-types/dist/index.d.ts:533 *** @@ -785,7 +798,7 @@ Used as an optional. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:81 +packages/quickjs-ffi-types/dist/index.d.ts:85 *** @@ -951,7 +964,7 @@ The default [Intrinsics](exports.md#intrinsics) language features enabled in a Q #### Source -[packages/quickjs-emscripten-core/src/lifetime.ts:457](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L457) +[packages/quickjs-emscripten-core/src/lifetime.ts:453](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/lifetime.ts#L453) *** @@ -1019,7 +1032,7 @@ module code #### Source -packages/quickjs-ffi-types/dist/index.d.ts:90 +packages/quickjs-ffi-types/dist/index.d.ts:94 *** @@ -1051,9 +1064,17 @@ Bitfield options for QTS_GetOwnPropertyNames > **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:150 +packages/quickjs-ffi-types/dist/index.d.ts:154 *** @@ -1131,7 +1152,7 @@ Bitfield options for QTS_NewContext intrinsics #### Source -packages/quickjs-ffi-types/dist/index.d.ts:118 +packages/quickjs-ffi-types/dist/index.d.ts:122 *** @@ -1155,7 +1176,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:118 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:162 +packages/quickjs-ffi-types/dist/index.d.ts:168 *** @@ -1179,7 +1200,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:162 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:141 +packages/quickjs-ffi-types/dist/index.d.ts:145 *** @@ -1258,7 +1279,7 @@ packages/variant-quickjs-wasmfile-release-sync/dist/index.d.ts:18 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:86 +packages/quickjs-ffi-types/dist/index.d.ts:90 *** diff --git a/doc/quickjs-emscripten/interfaces/EmscriptenModule.md b/doc/quickjs-emscripten/interfaces/EmscriptenModule.md index f65dd4ce..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:283 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -59,7 +59,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -79,7 +79,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:275 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:273 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -89,7 +89,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:273 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -99,7 +99,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -109,7 +109,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -119,7 +119,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -129,7 +129,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:278 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -149,7 +149,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +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:240 +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:242 +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:268 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -222,7 +222,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:268 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:271 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -240,7 +240,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:271 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:270 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -273,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:270 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:272 +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:244 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -317,7 +317,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:244 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +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:236 +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:246 +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:263 +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 b7428cfa..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:328 +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 18298f7d..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:240 +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:242 +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:244 +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:236 +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:246 +packages/quickjs-ffi-types/dist/index.d.ts:252 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncEmscriptenModule.md index 9f13cd7d..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:283 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:275 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:273 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:273 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:278 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:281 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:324 +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:323 +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:240 +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:242 +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:268 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -300,7 +300,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:268 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:271 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -322,7 +322,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:271 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:270 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -359,7 +359,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:270 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:272 +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:244 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -407,7 +407,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:244 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +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:236 +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:246 +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:263 +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 0664723a..cc06871a 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md @@ -103,7 +103,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:416 +packages/quickjs-ffi-types/dist/index.d.ts:422 *** @@ -123,7 +123,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:416 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:483 +packages/quickjs-ffi-types/dist/index.d.ts:489 *** @@ -137,7 +137,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:483 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:481 +packages/quickjs-ffi-types/dist/index.d.ts:487 *** @@ -151,7 +151,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:481 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:480 +packages/quickjs-ffi-types/dist/index.d.ts:486 *** @@ -165,7 +165,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:480 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:423 +packages/quickjs-ffi-types/dist/index.d.ts:429 *** @@ -191,7 +191,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:423 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:464 +packages/quickjs-ffi-types/dist/index.d.ts:470 *** @@ -217,7 +217,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:464 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:465 +packages/quickjs-ffi-types/dist/index.d.ts:471 *** @@ -251,7 +251,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:465 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:461 +packages/quickjs-ffi-types/dist/index.d.ts:467 *** @@ -271,7 +271,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:461 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:467 +packages/quickjs-ffi-types/dist/index.d.ts:473 *** @@ -291,7 +291,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:467 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:468 +packages/quickjs-ffi-types/dist/index.d.ts:474 *** @@ -311,7 +311,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:468 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:437 +packages/quickjs-ffi-types/dist/index.d.ts:443 *** @@ -339,7 +339,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:469 +packages/quickjs-ffi-types/dist/index.d.ts:475 *** @@ -367,7 +367,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:469 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:470 +packages/quickjs-ffi-types/dist/index.d.ts:476 *** @@ -389,7 +389,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:470 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:453 +packages/quickjs-ffi-types/dist/index.d.ts:459 *** @@ -411,7 +411,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:453 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:454 +packages/quickjs-ffi-types/dist/index.d.ts:460 *** @@ -431,7 +431,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:454 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:436 +packages/quickjs-ffi-types/dist/index.d.ts:442 *** @@ -449,7 +449,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:436 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:432 +packages/quickjs-ffi-types/dist/index.d.ts:438 *** @@ -467,7 +467,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:432 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:430 +packages/quickjs-ffi-types/dist/index.d.ts:436 *** @@ -487,7 +487,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:433 +packages/quickjs-ffi-types/dist/index.d.ts:439 *** @@ -507,7 +507,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:434 +packages/quickjs-ffi-types/dist/index.d.ts:440 *** @@ -527,7 +527,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:441 *** @@ -547,7 +547,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:446 +packages/quickjs-ffi-types/dist/index.d.ts:452 *** @@ -567,7 +567,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:447 +packages/quickjs-ffi-types/dist/index.d.ts:453 *** @@ -581,7 +581,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:427 +packages/quickjs-ffi-types/dist/index.d.ts:433 *** @@ -601,7 +601,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:427 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:443 +packages/quickjs-ffi-types/dist/index.d.ts:449 *** @@ -619,7 +619,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:475 +packages/quickjs-ffi-types/dist/index.d.ts:481 *** @@ -641,7 +641,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:475 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:473 +packages/quickjs-ffi-types/dist/index.d.ts:479 *** @@ -661,7 +661,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:473 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:471 +packages/quickjs-ffi-types/dist/index.d.ts:477 *** @@ -675,7 +675,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:471 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:426 +packages/quickjs-ffi-types/dist/index.d.ts:432 *** @@ -687,7 +687,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -701,7 +701,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:462 +packages/quickjs-ffi-types/dist/index.d.ts:468 *** @@ -713,7 +713,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:462 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -727,7 +727,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:462 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:463 +packages/quickjs-ffi-types/dist/index.d.ts:469 *** @@ -749,7 +749,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:463 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:455 +packages/quickjs-ffi-types/dist/index.d.ts:461 *** @@ -771,7 +771,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:455 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:457 +packages/quickjs-ffi-types/dist/index.d.ts:463 *** @@ -793,7 +793,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:458 +packages/quickjs-ffi-types/dist/index.d.ts:464 *** @@ -815,7 +815,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:458 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:456 +packages/quickjs-ffi-types/dist/index.d.ts:462 *** @@ -835,7 +835,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:456 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:445 +packages/quickjs-ffi-types/dist/index.d.ts:451 *** @@ -855,7 +855,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:445 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:449 +packages/quickjs-ffi-types/dist/index.d.ts:455 *** @@ -875,7 +875,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:449 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:450 +packages/quickjs-ffi-types/dist/index.d.ts:456 *** @@ -889,7 +889,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:450 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:428 +packages/quickjs-ffi-types/dist/index.d.ts:434 *** @@ -903,7 +903,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:428 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:425 +packages/quickjs-ffi-types/dist/index.d.ts:431 *** @@ -927,7 +927,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:425 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:474 +packages/quickjs-ffi-types/dist/index.d.ts:480 *** @@ -947,7 +947,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:474 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:451 +packages/quickjs-ffi-types/dist/index.d.ts:457 *** @@ -965,7 +965,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:451 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:452 +packages/quickjs-ffi-types/dist/index.d.ts:458 *** @@ -983,7 +983,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:452 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:440 +packages/quickjs-ffi-types/dist/index.d.ts:446 *** @@ -1005,7 +1005,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:440 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:441 +packages/quickjs-ffi-types/dist/index.d.ts:447 *** @@ -1025,7 +1025,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:441 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:431 +packages/quickjs-ffi-types/dist/index.d.ts:437 *** @@ -1043,7 +1043,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:418 +packages/quickjs-ffi-types/dist/index.d.ts:424 *** @@ -1063,7 +1063,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:418 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:442 +packages/quickjs-ffi-types/dist/index.d.ts:448 *** @@ -1085,7 +1085,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:482 +packages/quickjs-ffi-types/dist/index.d.ts:488 *** @@ -1103,7 +1103,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:482 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:438 +packages/quickjs-ffi-types/dist/index.d.ts:444 *** @@ -1123,7 +1123,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:439 +packages/quickjs-ffi-types/dist/index.d.ts:445 *** @@ -1143,7 +1143,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:439 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:476 +packages/quickjs-ffi-types/dist/index.d.ts:482 *** @@ -1157,7 +1157,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:476 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:429 +packages/quickjs-ffi-types/dist/index.d.ts:435 *** @@ -1177,7 +1177,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:444 +packages/quickjs-ffi-types/dist/index.d.ts:450 *** @@ -1199,7 +1199,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:444 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:448 +packages/quickjs-ffi-types/dist/index.d.ts:454 *** @@ -1219,7 +1219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:448 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:478 +packages/quickjs-ffi-types/dist/index.d.ts:484 *** @@ -1239,7 +1239,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:478 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:477 +packages/quickjs-ffi-types/dist/index.d.ts:483 *** @@ -1253,7 +1253,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:477 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:422 +packages/quickjs-ffi-types/dist/index.d.ts:428 *** @@ -1273,7 +1273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:422 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:466 +packages/quickjs-ffi-types/dist/index.d.ts:472 *** @@ -1293,7 +1293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:466 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:420 +packages/quickjs-ffi-types/dist/index.d.ts:426 *** @@ -1311,7 +1311,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:420 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:485 +packages/quickjs-ffi-types/dist/index.d.ts:491 *** @@ -1329,7 +1329,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:485 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:487 +packages/quickjs-ffi-types/dist/index.d.ts:493 *** @@ -1347,7 +1347,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:487 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:421 +packages/quickjs-ffi-types/dist/index.d.ts:427 *** @@ -1365,7 +1365,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:421 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:484 +packages/quickjs-ffi-types/dist/index.d.ts:490 *** @@ -1385,7 +1385,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:484 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:486 +packages/quickjs-ffi-types/dist/index.d.ts:492 *** @@ -1405,7 +1405,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:486 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:424 +packages/quickjs-ffi-types/dist/index.d.ts:430 *** @@ -1425,7 +1425,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:424 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:419 +packages/quickjs-ffi-types/dist/index.d.ts:425 *** @@ -1449,7 +1449,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:419 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:459 +packages/quickjs-ffi-types/dist/index.d.ts:465 *** @@ -1473,7 +1473,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:459 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:460 +packages/quickjs-ffi-types/dist/index.d.ts:466 *** @@ -1491,7 +1491,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:460 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:479 +packages/quickjs-ffi-types/dist/index.d.ts:485 *** @@ -1511,7 +1511,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:479 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:417 +packages/quickjs-ffi-types/dist/index.d.ts:423 *** @@ -1531,7 +1531,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:417 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:472 +packages/quickjs-ffi-types/dist/index.d.ts:478 *** @@ -1551,7 +1551,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:472 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:489 +packages/quickjs-ffi-types/dist/index.d.ts:495 *** @@ -1571,7 +1571,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:489 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:488 +packages/quickjs-ffi-types/dist/index.d.ts:494 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncVariant.md index a660c20a..29b2db4d 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:524 +packages/quickjs-ffi-types/dist/index.d.ts:530 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:524 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:525 +packages/quickjs-ffi-types/dist/index.d.ts:531 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:525 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:523 +packages/quickjs-ffi-types/dist/index.d.ts:529 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md b/doc/quickjs-emscripten/interfaces/QuickJSEmscriptenModule.md index ccdadc34..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:283 +packages/quickjs-ffi-types/dist/index.d.ts:289 *** @@ -69,7 +69,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:283 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:274 +packages/quickjs-ffi-types/dist/index.d.ts:280 *** @@ -83,7 +83,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:274 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:275 +packages/quickjs-ffi-types/dist/index.d.ts:281 *** @@ -97,7 +97,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:275 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:273 +packages/quickjs-ffi-types/dist/index.d.ts:279 *** @@ -111,7 +111,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:273 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:279 +packages/quickjs-ffi-types/dist/index.d.ts:285 *** @@ -125,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:279 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:280 +packages/quickjs-ffi-types/dist/index.d.ts:286 *** @@ -139,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:280 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:277 +packages/quickjs-ffi-types/dist/index.d.ts:283 *** @@ -153,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:277 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:278 +packages/quickjs-ffi-types/dist/index.d.ts:284 *** @@ -167,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:278 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:276 +packages/quickjs-ffi-types/dist/index.d.ts:282 *** @@ -181,7 +181,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:276 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:282 +packages/quickjs-ffi-types/dist/index.d.ts:288 *** @@ -195,7 +195,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:282 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:281 +packages/quickjs-ffi-types/dist/index.d.ts:287 *** @@ -205,7 +205,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:281 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:319 +packages/quickjs-ffi-types/dist/index.d.ts:325 *** @@ -215,7 +215,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:319 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:318 +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:240 +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:242 +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:268 +packages/quickjs-ffi-types/dist/index.d.ts:274 *** @@ -296,7 +296,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:268 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:271 +packages/quickjs-ffi-types/dist/index.d.ts:277 *** @@ -318,7 +318,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:271 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:270 +packages/quickjs-ffi-types/dist/index.d.ts:276 *** @@ -355,7 +355,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:270 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:272 +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:244 +packages/quickjs-ffi-types/dist/index.d.ts:250 *** @@ -403,7 +403,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:244 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:269 +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:236 +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:246 +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:263 +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 66ccf608..399d9caa 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md @@ -94,7 +94,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:340 +packages/quickjs-ffi-types/dist/index.d.ts:346 *** @@ -114,7 +114,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:340 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:398 +packages/quickjs-ffi-types/dist/index.d.ts:404 *** @@ -128,7 +128,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:398 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:396 +packages/quickjs-ffi-types/dist/index.d.ts:402 *** @@ -142,7 +142,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:396 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:395 +packages/quickjs-ffi-types/dist/index.d.ts:401 *** @@ -156,7 +156,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:395 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:347 +packages/quickjs-ffi-types/dist/index.d.ts:353 *** @@ -182,7 +182,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:347 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:382 +packages/quickjs-ffi-types/dist/index.d.ts:388 *** @@ -216,7 +216,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:382 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:380 +packages/quickjs-ffi-types/dist/index.d.ts:386 *** @@ -236,7 +236,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:380 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:384 +packages/quickjs-ffi-types/dist/index.d.ts:390 *** @@ -256,7 +256,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:384 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:361 +packages/quickjs-ffi-types/dist/index.d.ts:367 *** @@ -284,7 +284,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:361 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:385 +packages/quickjs-ffi-types/dist/index.d.ts:391 *** @@ -306,7 +306,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:385 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:376 +packages/quickjs-ffi-types/dist/index.d.ts:382 *** @@ -326,7 +326,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:376 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:360 +packages/quickjs-ffi-types/dist/index.d.ts:366 *** @@ -344,7 +344,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:360 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:356 +packages/quickjs-ffi-types/dist/index.d.ts:362 *** @@ -362,7 +362,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:356 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:354 +packages/quickjs-ffi-types/dist/index.d.ts:360 *** @@ -382,7 +382,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:354 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:357 +packages/quickjs-ffi-types/dist/index.d.ts:363 *** @@ -402,7 +402,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:357 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:358 +packages/quickjs-ffi-types/dist/index.d.ts:364 *** @@ -422,7 +422,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:358 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:359 +packages/quickjs-ffi-types/dist/index.d.ts:365 *** @@ -442,7 +442,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:359 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:370 +packages/quickjs-ffi-types/dist/index.d.ts:376 *** @@ -462,7 +462,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:370 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:371 +packages/quickjs-ffi-types/dist/index.d.ts:377 *** @@ -476,7 +476,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:371 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:351 +packages/quickjs-ffi-types/dist/index.d.ts:357 *** @@ -496,7 +496,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:351 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:367 +packages/quickjs-ffi-types/dist/index.d.ts:373 *** @@ -514,7 +514,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:367 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:390 +packages/quickjs-ffi-types/dist/index.d.ts:396 *** @@ -536,7 +536,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:390 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:388 +packages/quickjs-ffi-types/dist/index.d.ts:394 *** @@ -556,7 +556,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:388 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:386 +packages/quickjs-ffi-types/dist/index.d.ts:392 *** @@ -570,7 +570,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:386 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:350 +packages/quickjs-ffi-types/dist/index.d.ts:356 *** @@ -582,7 +582,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 • **ctx**: [`JSContextPointer`](../exports.md#jscontextpointer) -• **out\_ptrs**: [`JSValuePointerPointer`](../exports.md#jsvaluepointerpointer) +• **out\_ptrs**: [`JSValuePointerPointerPointer`](../exports.md#jsvaluepointerpointerpointer) • **out\_len**: [`UInt32Pointer`](../exports.md#uint32pointer) @@ -596,7 +596,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:381 +packages/quickjs-ffi-types/dist/index.d.ts:387 *** @@ -618,7 +618,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:381 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:377 +packages/quickjs-ffi-types/dist/index.d.ts:383 *** @@ -640,7 +640,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:377 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:378 +packages/quickjs-ffi-types/dist/index.d.ts:384 *** @@ -660,7 +660,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:378 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:369 +packages/quickjs-ffi-types/dist/index.d.ts:375 *** @@ -680,7 +680,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:369 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:373 +packages/quickjs-ffi-types/dist/index.d.ts:379 *** @@ -694,7 +694,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:373 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:352 +packages/quickjs-ffi-types/dist/index.d.ts:358 *** @@ -708,7 +708,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:352 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:349 +packages/quickjs-ffi-types/dist/index.d.ts:355 *** @@ -732,7 +732,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:349 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:389 +packages/quickjs-ffi-types/dist/index.d.ts:395 *** @@ -752,7 +752,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:389 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:374 +packages/quickjs-ffi-types/dist/index.d.ts:380 *** @@ -770,7 +770,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:374 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:375 +packages/quickjs-ffi-types/dist/index.d.ts:381 *** @@ -788,7 +788,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:375 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:364 +packages/quickjs-ffi-types/dist/index.d.ts:370 *** @@ -810,7 +810,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:364 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:365 +packages/quickjs-ffi-types/dist/index.d.ts:371 *** @@ -830,7 +830,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:365 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:355 +packages/quickjs-ffi-types/dist/index.d.ts:361 *** @@ -848,7 +848,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:355 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:342 +packages/quickjs-ffi-types/dist/index.d.ts:348 *** @@ -868,7 +868,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:342 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:366 +packages/quickjs-ffi-types/dist/index.d.ts:372 *** @@ -890,7 +890,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:366 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:397 +packages/quickjs-ffi-types/dist/index.d.ts:403 *** @@ -908,7 +908,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:397 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:362 +packages/quickjs-ffi-types/dist/index.d.ts:368 *** @@ -928,7 +928,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:362 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:363 +packages/quickjs-ffi-types/dist/index.d.ts:369 *** @@ -948,7 +948,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:363 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:391 +packages/quickjs-ffi-types/dist/index.d.ts:397 *** @@ -962,7 +962,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:391 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:353 +packages/quickjs-ffi-types/dist/index.d.ts:359 *** @@ -982,7 +982,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:353 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:368 +packages/quickjs-ffi-types/dist/index.d.ts:374 *** @@ -1004,7 +1004,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:368 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:372 +packages/quickjs-ffi-types/dist/index.d.ts:378 *** @@ -1024,7 +1024,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:372 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:393 +packages/quickjs-ffi-types/dist/index.d.ts:399 *** @@ -1044,7 +1044,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:392 +packages/quickjs-ffi-types/dist/index.d.ts:398 *** @@ -1058,7 +1058,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:392 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:346 +packages/quickjs-ffi-types/dist/index.d.ts:352 *** @@ -1078,7 +1078,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:346 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:383 +packages/quickjs-ffi-types/dist/index.d.ts:389 *** @@ -1098,7 +1098,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:383 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:344 +packages/quickjs-ffi-types/dist/index.d.ts:350 *** @@ -1116,7 +1116,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:344 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:400 +packages/quickjs-ffi-types/dist/index.d.ts:406 *** @@ -1134,7 +1134,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:400 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:402 +packages/quickjs-ffi-types/dist/index.d.ts:408 *** @@ -1152,7 +1152,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:402 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:345 +packages/quickjs-ffi-types/dist/index.d.ts:351 *** @@ -1170,7 +1170,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:345 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:399 +packages/quickjs-ffi-types/dist/index.d.ts:405 *** @@ -1190,7 +1190,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:399 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:401 +packages/quickjs-ffi-types/dist/index.d.ts:407 *** @@ -1210,7 +1210,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:401 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:348 +packages/quickjs-ffi-types/dist/index.d.ts:354 *** @@ -1230,7 +1230,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:348 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:343 +packages/quickjs-ffi-types/dist/index.d.ts:349 *** @@ -1254,7 +1254,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:343 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:379 +packages/quickjs-ffi-types/dist/index.d.ts:385 *** @@ -1272,7 +1272,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:379 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:394 +packages/quickjs-ffi-types/dist/index.d.ts:400 *** @@ -1292,7 +1292,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:394 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:341 +packages/quickjs-ffi-types/dist/index.d.ts:347 *** @@ -1312,7 +1312,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:341 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:387 +packages/quickjs-ffi-types/dist/index.d.ts:393 *** @@ -1332,7 +1332,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:387 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:404 +packages/quickjs-ffi-types/dist/index.d.ts:410 *** @@ -1352,7 +1352,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:404 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:403 +packages/quickjs-ffi-types/dist/index.d.ts:409 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md b/doc/quickjs-emscripten/interfaces/QuickJSSyncVariant.md index 703861ee..5e7e1222 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:510 +packages/quickjs-ffi-types/dist/index.d.ts:516 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:510 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:511 +packages/quickjs-ffi-types/dist/index.d.ts:517 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:511 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:509 +packages/quickjs-ffi-types/dist/index.d.ts:515 *** diff --git a/doc/quickjs-emscripten/interfaces/SourceMapData.md b/doc/quickjs-emscripten/interfaces/SourceMapData.md index 87b4772c..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:199 +packages/quickjs-ffi-types/dist/index.d.ts:205 *** @@ -32,7 +32,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:199 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:198 +packages/quickjs-ffi-types/dist/index.d.ts:204 *** @@ -42,7 +42,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:198 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:197 +packages/quickjs-ffi-types/dist/index.d.ts:203 *** @@ -52,7 +52,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:197 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:196 +packages/quickjs-ffi-types/dist/index.d.ts:202 *** 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/vite.base.config.mts b/packages/internal-tsconfig/vite.base.config.mts index b1a17da4..261d0cdf 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/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 1957e87e..8728bc98 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -11,6 +11,7 @@ import type { JSValuePointerPointer, EitherFFI, UInt32Pointer, + JSValuePointerPointerPointer, } from "@jitl/quickjs-ffi-types" import { debugLog } from "./debug" import type { JSPromiseState } from "./deferred-promise" @@ -52,6 +53,7 @@ import type { VmPropertyDescriptor, } from "./vm-interface" import { QuickJSIterator } from "./QuickJSIterator" +import { JSVoidPointer } from "@jitl/quickjs-ffi-types" export type ContextResult = DisposableResult @@ -871,7 +873,9 @@ export class QuickJSContext handle.value // assert alive const flags = getOwnPropertyNamesOptionsToFlags(options) return Scope.withScope((scope) => { - const outPtr = scope.manage(this.memory.newMutablePointerArray(1)) + const outPtr = scope.manage( + this.memory.newMutablePointerArray(1), + ) const errorPtr = this.ffi.QTS_GetOwnPropertyNames( this.ctx.value, outPtr.value.ptr, @@ -883,12 +887,13 @@ export class QuickJSContext return this.fail(this.memory.heapValueHandle(errorPtr)) } const len = this.uint32Out.value.typedArray[0] + console.log("getPropNames length", len) 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.module._free(ptr) + this.ffi.QTS_FreeVoidPointer(this.ctx.value, ptr as JSVoidPointer) return this.success(createDisposableArray(handles)) }) } diff --git a/packages/quickjs-emscripten-core/src/lifetime.test.ts b/packages/quickjs-emscripten-core/src/lifetime.test.ts index f8497fee..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 { DisposableResult, Lifetime, Scope } from "./lifetime" +import { DisposableResult, Lifetime, Scope, createDisposableArray } from "./lifetime" describe("Lifetime", () => { describe(".consume", () => { @@ -58,6 +58,29 @@ 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", () => { diff --git a/packages/quickjs-emscripten-core/src/lifetime.ts b/packages/quickjs-emscripten-core/src/lifetime.ts index 2bf6389b..1442e2af 100644 --- a/packages/quickjs-emscripten-core/src/lifetime.ts +++ b/packages/quickjs-emscripten-core/src/lifetime.ts @@ -300,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 } diff --git a/packages/quickjs-emscripten-core/src/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 4e2ec885..31cdbe81 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -284,6 +284,10 @@ export function evalOptionsToFlags(evalOptions: ContextEvalOptions | number | un } export interface GetOwnPropertyNamesOptions { + /** Include number properties like array indexes *as numbers* in the result. This is not standards-compliant */ + includeNumbers?: boolean + /** Enable standards-compliant number properties. When set, `includeNumbers` is ignored. */ + numbersAsStrings?: boolean /** Include strings in the result */ includeStrings?: boolean /** Include symbols in the result */ @@ -306,12 +310,22 @@ export function getOwnPropertyNamesOptionsToFlags( return 0 as GetOwnPropertyNamesFlags } - const { includeStrings, includeSymbols, includePrivate, onlyEnumerable } = options + const { + includeStrings, + includeSymbols, + includePrivate, + onlyEnumerable, + 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 } diff --git a/packages/quickjs-emscripten/src/leak.test.ts b/packages/quickjs-emscripten/src/leak.test.ts index 289effb2..4fc880c5 100644 --- a/packages/quickjs-emscripten/src/leak.test.ts +++ b/packages/quickjs-emscripten/src/leak.test.ts @@ -11,6 +11,7 @@ import { } from "." const TEST_LEAK = Boolean(process.env.TEST_LEAK) +const TEST_SLOW = !process.env.TEST_FAST const testOptions = { timeout: Infinity, } @@ -144,7 +145,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 d7326529..39bf6225 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, @@ -36,34 +44,61 @@ import { newVariant, shouldInterruptAfterDeadline, } from "." +import { Scope } from "quickjs-emscripten-core" -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 console.log("test sets:", { TEST_RELEASE, TEST_DEBUG, TEST_NG, TEST_ASYNC, + TEST_SLOW, }) 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,6 +111,10 @@ 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)") @@ -232,7 +271,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", () => @@ -370,64 +409,69 @@ function contextTests(getContext: GetTestContext, isDebug = false) { }) describe("getPropNames", () => { - it("gets array indexes as *numbers*", () => { - const array = vm.newArray() + 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 = vm.unwrapResult( - vm.getPropNames(array, { - onlyEnumerable: true, - }), + const props = manage( + vm + .getPropNames(array, { + includeNumbers: true, + }) + .unwrap(), ) + console.log(props.map((p) => vm.dump(p))) + 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) - props.dispose() }) - it("gets object keys as *strings*, but does not include symbols", () => { - const obj = vm.newObject() - vm.setProp(obj, "a", vm.undefined) + 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) - const props = vm.unwrapResult( - vm.getPropNames(obj, { - onlyEnumerable: true, - includeStrings: true, - }), + const props = manage( + vm.unwrapResult( + vm.getPropNames(obj, { + onlyEnumerable: true, + includeStrings: true, + }), + ), ) 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") - props.dispose() }) - it('gets object keys that are symbols only when "includeSymbols" is true', () => { - const obj = vm.newObject() - const symA = vm.newUniqueSymbol("a") + 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 = vm.unwrapResult( - vm.getPropNames(obj, { - onlyEnumerable: true, - includeSymbols: true, - }), + const props = manage( + vm.unwrapResult( + vm.getPropNames(obj, { + onlyEnumerable: true, + includeSymbols: true, + }), + ), ) assert.strictEqual(props.length, 1) - assert.ok(vm.eq(props[0], symA)) - props.dispose() + assert.strictEqual(vm.typeof(props[0]), "symbol") }) }) diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 1c554639..b7116d5c 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, @@ -157,14 +158,14 @@ export interface QuickJSAsyncFFI { ) => void QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, ) => JSValuePointer QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/quickjs-ffi-types/src/ffi-types.ts b/packages/quickjs-ffi-types/src/ffi-types.ts index c5d09f66..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. */ @@ -198,6 +203,10 @@ export const GetOwnPropertyNamesFlags = { 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 = { diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index daf0c7d4..9acb646f 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, @@ -131,7 +132,7 @@ export interface QuickJSFFI { ) => void QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index ac4ff706..7ddc5392 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -84,6 +84,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 diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md index 34ad3a0d..e1d7cba9 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md @@ -81,6 +81,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", 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 181a778b..37038386 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, @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index ac409557..c9398f20 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -77,6 +77,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 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 44195038..cf4f132e 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 daf27f32..cb9d32b5 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, @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 0e676971..14f4e5c9 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 272ab743..21dab7dc 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -84,6 +84,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 diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md index 07abec77..e9491173 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", 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 181a778b..37038386 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, @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index f1218bf2..fe329b08 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -77,6 +77,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 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 44195038..cf4f132e 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 daf27f32..cb9d32b5 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, @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 0e676971..14f4e5c9 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 1fa3ba45..ceb0ed48 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -84,6 +84,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 diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md index 4efcd258..6424a2ad 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", 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 181a778b..37038386 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, @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 25fca458..5311976c 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -77,6 +77,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 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 44195038..cf4f132e 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 daf27f32..cb9d32b5 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, @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 0e676971..14f4e5c9 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index e6497434..eddec1fc 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -84,6 +84,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 diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md index 101c3089..4d9a63b7 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", 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 181a778b..37038386 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, @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index 8937eba3..0a0065d1 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -77,6 +77,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 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 44195038..cf4f132e 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 daf27f32..cb9d32b5 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, @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, 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 0e676971..14f4e5c9 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index e5962386..d3b9aa55 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -84,6 +84,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 diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md index c2c388c3..a9fa31e9 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md @@ -81,6 +81,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", diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index 181a778b..37038386 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, @@ -312,7 +313,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -328,7 +329,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index a5ee4d7d..64e740a8 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -77,6 +77,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 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 44195038..cf4f132e 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index daf27f32..cb9d32b5 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, @@ -308,7 +309,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, @@ -324,7 +325,7 @@ export class QuickJSAsyncFFI { QTS_GetOwnPropertyNames_MaybeAsync: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 0e676971..14f4e5c9 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, @@ -257,7 +258,7 @@ export class QuickJSFFI { QTS_GetOwnPropertyNames: ( ctx: JSContextPointer, - out_ptrs: JSValuePointerPointer, + out_ptrs: JSValuePointerPointerPointer, out_len: UInt32Pointer, obj: JSValuePointer | JSValueConstPointer, flags: number, diff --git a/scripts/prepareVariants.ts b/scripts/prepareVariants.ts index daf4c355..66d6febe 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,6 +217,7 @@ 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") diff --git a/yarn.lock b/yarn.lock index c7b58860..c75568ab 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 @@ -5277,17 +5279,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 +5324,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 +5554,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 +5591,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 +6210,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 +6380,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 +6460,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:^1.0.0": + version: 1.0.1 + resolution: "tinypool@npm:1.0.1" + checksum: eaceb93784b8e27e60c0e3e2c7d11c29e1e79b2a025b2c232215db73b90fe22bd4753ad53fc8e801c2b5a63b94a823af549555d8361272bc98271de7dd4a9925 languageName: node linkType: hard -"tinypool@npm:^0.8.1": - version: 0.8.1 - resolution: "tinypool@npm:0.8.1" - checksum: 3fae8acc22b7d0364eb202b64f61f0d8b10dcead6bef9b8fab1836857dcecd0e34fadc47ab309754ead2cb29bfa4b3467a9fc0daae23669b19ff403ae1364b5c +"tinyrainbow@npm:^1.2.0": + version: 1.2.0 + resolution: "tinyrainbow@npm:1.2.0" + checksum: 2924444db6804355e5ba2b6e586c7f77329d93abdd7257a069a0f4530dff9f16de484e80479094e3f39273462541b003a65ee3a6afc2d12555aa745132deba5d languageName: node linkType: hard -"tinyspy@npm:^2.2.0": - version: 2.2.0 - resolution: "tinyspy@npm:2.2.0" - checksum: bcc5a08c2dc7574d32e6dcc2e760ad95a3cf30249c22799815b6389179427c95573d27d2d965ebc5fca2b6d338c46678cd7337ea2a9cebacee3dc662176b07cb +"tinyspy@npm:^3.0.0": + version: 3.0.0 + resolution: "tinyspy@npm:3.0.0" + checksum: b5b686acff2b88de60ff8ecf89a2042320406aaeee2fba1828a7ea8a925fad3ed9f5e4d7a068154a9134473c472aa03da8ca92ee994bc57a741c5ede5fa7de4d languageName: node linkType: hard @@ -6704,13 +6675,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 +6800,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 +6892,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 +6963,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 +7008,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 5e4ac0231b2dc9cf51892e0414c7ab092e70bf5eacdb9c4a8cdd941bdd325544eb4ffe8eb89586aa6e399f9a34739f330482c64c13300bf1b7c5b130101d7e7c + checksum: abb916e3496a3fa9e9d05ecd806332dc4000aa0e433f0cb1e99f9dd1fa5c06d2c66656874b9860a683cec0f32abe1519599babef02e5c0ca80e9afbcdbddfdbd languageName: node linkType: hard @@ -7147,15 +7102,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 +7227,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 From 310f07241be1d8c75a842fc48dfe36c521a84a68 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 12:17:38 -0400 Subject: [PATCH 16/43] getPropNames -> getOwnPropertyNames --- .../quickjs-emscripten-core/src/context.ts | 13 +++++-- .../quickjs-emscripten-core/src/errors.ts | 4 ++ packages/quickjs-emscripten-core/src/types.ts | 19 ++++----- .../quickjs-emscripten/src/quickjs.test.ts | 39 ++++++++++++++----- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 8728bc98..fb2a002a 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -18,7 +18,12 @@ 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 { QuickJSNotImplemented, QuickJSPromisePending, QuickJSUnwrapError } from "./errors" +import { + QuickJSEmptyGetOwnPropertyNames, + QuickJSNotImplemented, + QuickJSPromisePending, + QuickJSUnwrapError, +} from "./errors" import type { Disposable, DisposableArray, DisposableFail, DisposableSuccess } from "./lifetime" import { DisposableResult, @@ -865,13 +870,16 @@ export class QuickJSContext * `Object.getOwnPropertyNames(handle)`. * Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). */ - getPropNames( + getOwnPropertyNames( handle: QuickJSHandle, options: GetOwnPropertyNamesOptions, ): ContextResult> { 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), @@ -887,7 +895,6 @@ export class QuickJSContext return this.fail(this.memory.heapValueHandle(errorPtr)) } const len = this.uint32Out.value.typedArray[0] - console.log("getPropNames length", len) const ptr = outPtr.value.typedArray[0] const pointerArray = new Uint32Array(this.module.HEAP8.buffer, ptr, len) const handles = Array.from(pointerArray).map((ptr) => 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/types.ts b/packages/quickjs-emscripten-core/src/types.ts index 31cdbe81..a5684914 100644 --- a/packages/quickjs-emscripten-core/src/types.ts +++ b/packages/quickjs-emscripten-core/src/types.ts @@ -41,6 +41,7 @@ export type JSValueConst = Lifetime +// | Lifetime /** * Wraps a C pointer to a QuickJS JSValue, which represents a Javascript value inside @@ -285,15 +286,15 @@ export function evalOptionsToFlags(evalOptions: ContextEvalOptions | number | un export interface GetOwnPropertyNamesOptions { /** Include number properties like array indexes *as numbers* in the result. This is not standards-compliant */ - includeNumbers?: boolean + numbers?: boolean /** Enable standards-compliant number properties. When set, `includeNumbers` is ignored. */ numbersAsStrings?: boolean /** Include strings in the result */ - includeStrings?: boolean + strings?: boolean /** Include symbols in the result */ - includeSymbols?: boolean - /** Include private properties in the result */ - includePrivate?: boolean + symbols?: boolean + /** Include implementation-specific private properties in the result */ + quickjsPrivate?: boolean /** Only include the enumerable properties */ onlyEnumerable?: boolean } @@ -311,11 +312,11 @@ export function getOwnPropertyNamesOptionsToFlags( } const { - includeStrings, - includeSymbols, - includePrivate, + strings: includeStrings, + symbols: includeSymbols, + quickjsPrivate: includePrivate, onlyEnumerable, - includeNumbers, + numbers: includeNumbers, numbersAsStrings, } = options let flags = 0 diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index 39bf6225..5ee92282 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -408,7 +408,7 @@ function contextTests(getContext: GetTestContext, isDebug = false) { }) }) - describe("getPropNames", () => { + describe("getOwnPropertyNames", () => { it("gets array indexes as *numbers*", ({ manage }) => { const array = manage(vm.newArray()) vm.setProp(array, 0, vm.undefined) @@ -417,8 +417,8 @@ function contextTests(getContext: GetTestContext, isDebug = false) { const props = manage( vm - .getPropNames(array, { - includeNumbers: true, + .getOwnPropertyNames(array, { + numbers: true, }) .unwrap(), ) @@ -440,12 +440,12 @@ function contextTests(getContext: GetTestContext, isDebug = false) { vm.setProp(obj, sym, vm.undefined) const props = manage( - vm.unwrapResult( - vm.getPropNames(obj, { + vm + .getOwnPropertyNames(obj, { onlyEnumerable: true, - includeStrings: true, - }), - ), + strings: true, + }) + .unwrap(), ) assert.strictEqual(props.length, 3) @@ -463,9 +463,9 @@ function contextTests(getContext: GetTestContext, isDebug = false) { const props = manage( vm.unwrapResult( - vm.getPropNames(obj, { + vm.getOwnPropertyNames(obj, { onlyEnumerable: true, - includeSymbols: true, + symbols: true, }), ), ) @@ -473,6 +473,25 @@ function contextTests(getContext: GetTestContext, isDebug = false) { 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", () => { From 481f178194e19390e804cdb4c41969b4e5d1b168 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 12:29:36 -0400 Subject: [PATCH 17/43] Iterator -> IterableIterator --- packages/quickjs-emscripten-core/src/QuickJSIterator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts index 038a415c..a70d128a 100644 --- a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts +++ b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts @@ -28,7 +28,7 @@ import type { QuickJSHandle } from "./types" */ export class QuickJSIterator extends UsingDisposable - implements Disposable, Iterator> + implements Disposable, IterableIterator> { public owner: QuickJSRuntime private _next: QuickJSHandle | undefined @@ -42,6 +42,10 @@ export class QuickJSIterator this.owner = context.runtime } + [Symbol.iterator]() { + return this + } + next(value?: QuickJSHandle): IteratorResult, any> { if (!this.alive || this._isDone) { return { From 2b9369d01cd0045df3d609169494a3b699bdce2d Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 12:49:04 -0400 Subject: [PATCH 18/43] improve getOwnPropertyNames docs --- .../quickjs-emscripten-core/src/context.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index fb2a002a..9337abdc 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -12,6 +12,7 @@ import type { EitherFFI, UInt32Pointer, JSValuePointerPointerPointer, + JSVoidPointer, } from "@jitl/quickjs-ffi-types" import { debugLog } from "./debug" import type { JSPromiseState } from "./deferred-promise" @@ -58,7 +59,6 @@ import type { VmPropertyDescriptor, } from "./vm-interface" import { QuickJSIterator } from "./QuickJSIterator" -import { JSVoidPointer } from "@jitl/quickjs-ffi-types" export type ContextResult = DisposableResult @@ -868,7 +868,17 @@ export class QuickJSContext /** * `Object.getOwnPropertyNames(handle)`. - * Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). + * 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 + * - including symbols + * - only iterating over enumerable properties + * + * To emulate the standard, use these options: + * ```typescript + * context.getOwnPropertyNames(handle, { strings: true, numbersAsStrings: true }) + * ``` */ getOwnPropertyNames( handle: QuickJSHandle, @@ -924,13 +934,13 @@ export class QuickJSContext * } * ``` */ - getIterator(handle: QuickJSHandle): ContextResult { + getIterator(iterableHandle: QuickJSHandle): ContextResult { const SymbolIterator = (this._SymbolIterator ??= this.memory.manage( this.getWellKnownSymbol("iterator"), )) return Scope.withScope((scope) => { - const methodHandle = scope.manage(this.getProp(handle, SymbolIterator)) - const iteratorCallResult = this.callFunction(methodHandle, handle) + const methodHandle = scope.manage(this.getProp(iterableHandle, SymbolIterator)) + const iteratorCallResult = this.callFunction(methodHandle, iterableHandle) if (iteratorCallResult.error) { return iteratorCallResult } From 28f868890ef53644c46ae327c2690d8e47ba0dbf Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 13:17:18 -0400 Subject: [PATCH 19/43] improve iteration docs and add defaults to getOwnPropertyNames --- .../quickjs-emscripten-core/src/context.ts | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 9337abdc..2dfb7d01 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -855,7 +855,18 @@ export class QuickJSContext } /** - * `handle.length`. + * `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) @@ -871,19 +882,36 @@ export class QuickJSContext * 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 - * - including symbols - * - only iterating over enumerable properties + * - fetching array indexes as numbers (`numbers: true`) + * - including symbols (`symbols: true`) + * - only iterating over enumerable properties (`onlyEnumerable: true`) * - * To emulate the standard, use these options: + * 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, - ): ContextResult> { + options: GetOwnPropertyNamesOptions = { + strings: true, + numbersAsStrings: true, + }, + ): ContextResult> { this.runtime.assertOwned(handle) handle.value // assert alive const flags = getOwnPropertyNamesOptionsToFlags(options) @@ -923,14 +951,10 @@ export class QuickJSContext * is considered done if the handle is disposed. * * ```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() - * } + * 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)) * } * ``` */ From ff7a4c3d8f5a466fe76202e89364b32cd3da5eb8 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 13:17:28 -0400 Subject: [PATCH 20/43] add callMethod convinience function --- .../quickjs-emscripten-core/src/context.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 2dfb7d01..97108a11 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -1074,6 +1074,25 @@ export class QuickJSContext 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[] = [], + ): ContextResult { + return this.getProp(thisHandle, key).consume((func) => + this.callFunction(func, thisHandle, ...args), + ) + } + /** * Like [`eval(code)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description). * From c6270f3e6830e29daf6eb44cd174f8952b1af909 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Mon, 26 Aug 2024 13:46:43 -0400 Subject: [PATCH 21/43] add callFunction example --- .../quickjs-emscripten-core/src/context.ts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 97108a11..d2ef0ab1 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -1035,7 +1035,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 @@ -1046,13 +1047,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[], + ): ContextResult callFunction( func: QuickJSHandle, thisVal: QuickJSHandle, ...args: QuickJSHandle[] + ): ContextResult + callFunction( + func: QuickJSHandle, + thisVal: QuickJSHandle, + ...restArgs: Array ): ContextResult { 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) => @@ -1089,7 +1117,7 @@ export class QuickJSContext args: QuickJSHandle[] = [], ): ContextResult { return this.getProp(thisHandle, key).consume((func) => - this.callFunction(func, thisHandle, ...args), + this.callFunction(func, thisHandle, args), ) } From f7c36919ddfac55d24adec7915a4a003b71036a7 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 12:42:55 -0400 Subject: [PATCH 22/43] enable debug logging per runtime --- c/interface.c | 123 ++++++++++++------ .../src/context-asyncify.ts | 3 +- .../quickjs-emscripten-core/src/context.ts | 2 +- .../quickjs-emscripten-core/src/runtime.ts | 42 +++++- packages/quickjs-ffi-types/src/ffi-async.ts | 4 + packages/quickjs-ffi-types/src/ffi.ts | 4 + 6 files changed, 131 insertions(+), 47 deletions(-) diff --git a/c/interface.c b/c/interface.c index 08f37701..fd10a3ed 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_GetContextData(ctx)->debug_log) +#define IF_DEBUG_RT if (QTS_GetRuntimeData(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_GetRuntimeData(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_GetContextData(JSContext *ctx) { + return QTS_GetRuntimeData(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)); } @@ -710,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); @@ -731,7 +761,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]; + char msg[LOG_LEN]; #endif if (detectModule) { if (JS_DetectModule((const char *)js_code, js_code_length)) { @@ -778,10 +808,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. @@ -795,10 +825,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 @@ -965,6 +995,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_GetRuntimeData(rt)->debug_log = (bool)is_enabled; +#endif +} + int QTS_BuildIsDebug() { #ifdef QTS_DEBUG_MODE return 1; @@ -1016,11 +1059,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, @@ -1101,11 +1144,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; @@ -1146,11 +1189,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; @@ -1163,11 +1206,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); diff --git a/packages/quickjs-emscripten-core/src/context-asyncify.ts b/packages/quickjs-emscripten-core/src/context-asyncify.ts index a397e622..d377d157 100644 --- a/packages/quickjs-emscripten-core/src/context-asyncify.ts +++ b/packages/quickjs-emscripten-core/src/context-asyncify.ts @@ -8,7 +8,6 @@ import type { } from "@jitl/quickjs-ffi-types" import type { ContextResult } 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" @@ -65,7 +64,7 @@ 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) diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index d2ef0ab1..c4fd43cb 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -1366,7 +1366,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) diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index b59cfdc2..c9102a20 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -328,6 +328,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:", ...msg) + } + } + private getSystemContext() { if (!this.context) { // We own this context and should dispose of it. @@ -370,7 +404,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 } @@ -379,7 +413,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 } @@ -410,14 +444,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-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index b7116d5c..1d68c672 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -53,6 +53,8 @@ export interface QuickJSAsyncFFI { QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer QTS_FreeContext: (ctx: JSContextPointer) => void QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void @@ -242,6 +244,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.ts b/packages/quickjs-ffi-types/src/ffi.ts index 9acb646f..804c92ee 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -52,6 +52,8 @@ export interface QuickJSFFI { QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer QTS_FreeContext: (ctx: JSContextPointer) => void QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void @@ -190,6 +192,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 From ac639960a127be6ac25a3bef048cbca3c44216aa Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 12:43:39 -0400 Subject: [PATCH 23/43] regen --- packages/quickjs-ffi-types/src/ffi-async.ts | 4 ++-- packages/quickjs-ffi-types/src/ffi.ts | 4 ++-- .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ .../src/ffi.ts | 24 +++++++++++++++++++ 22 files changed, 484 insertions(+), 4 deletions(-) diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 1d68c672..4e0f5072 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -38,6 +38,8 @@ export interface QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG: boolean + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer QTS_NewError: (ctx: JSContextPointer) => JSValuePointer QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void @@ -53,8 +55,6 @@ export interface QuickJSAsyncFFI { QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer QTS_FreeContext: (ctx: JSContextPointer) => void QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index 804c92ee..ae713cd0 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -37,6 +37,8 @@ export interface QuickJSFFI { /** Set at compile time. */ readonly DEBUG: boolean + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer QTS_NewError: (ctx: JSContextPointer) => JSValuePointer QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void @@ -52,8 +54,6 @@ export interface QuickJSFFI { QTS_NewRuntime: () => JSRuntimePointer QTS_FreeRuntime: (rt: JSRuntimePointer) => void QTS_NewContext: (rt: JSRuntimePointer, intrinsics: IntrinsicsFlags) => JSContextPointer - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer QTS_FreeContext: (ctx: JSContextPointer) => void QTS_FreeValuePointer: (ctx: JSContextPointer, value: JSValuePointer) => void QTS_FreeValuePointerRuntime: (rt: JSRuntimePointer, value: JSValuePointer) => void 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 37038386..fbff87a5 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -466,6 +478,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/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts index cf4f132e..63539116 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts index cb9d32b5..ced44369 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -463,6 +475,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/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts index 14f4e5c9..14247e19 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts index 37038386..fbff87a5 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -466,6 +478,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/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts index cf4f132e..63539116 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts index cb9d32b5..ced44369 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -463,6 +475,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/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts index 14f4e5c9..14247e19 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts index 37038386..fbff87a5 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -466,6 +478,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/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts index cf4f132e..63539116 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts index cb9d32b5..ced44369 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -463,6 +475,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/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts index 14f4e5c9..14247e19 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts index 37038386..fbff87a5 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -466,6 +478,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/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts index cf4f132e..63539116 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts index cb9d32b5..ced44369 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -463,6 +475,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/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts index 14f4e5c9..14247e19 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index 37038386..fbff87a5 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -466,6 +478,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/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index cf4f132e..63539116 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index cb9d32b5..ced44369 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -39,6 +39,18 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -463,6 +475,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/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 14f4e5c9..14247e19 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -38,6 +38,18 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false + QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetRuntimeData", + "number", + ["number"], + ) + + QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( + "QTS_GetContextData", + "number", + ["number"], + ) + QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, @@ -359,6 +371,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", []) From 420555a0d6fabf9225fb8ba2df4915abf0f641da Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:07:05 -0400 Subject: [PATCH 24/43] docs for debug mode changes --- README.md | 58 +++++++++++-------- packages/quickjs-emscripten-core/src/debug.ts | 8 ++- .../quickjs-emscripten-core/src/runtime.ts | 6 +- 3 files changed, 47 insertions(+), 25 deletions(-) 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/packages/quickjs-emscripten-core/src/debug.ts b/packages/quickjs-emscripten-core/src/debug.ts index 354ac402..c74a9484 100644 --- a/packages/quickjs-emscripten-core/src/debug.ts +++ b/packages/quickjs-emscripten-core/src/debug.ts @@ -5,13 +5,19 @@ 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 } +export function isDebugMode() { + return QTS_DEBUG +} + /** * @private */ diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index c9102a20..83a2a620 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -8,7 +8,7 @@ import type { } from "@jitl/quickjs-ffi-types" import { maybeAsyncFn } from "./asyncify-helpers" import { QuickJSContext } from "./context" -import { debugLog } from "./debug" +import { QTS_DEBUG, debugLog } from "./debug" import { QuickJSWrongOwner } from "./errors" import type { Disposable } from "./lifetime" import { DisposableResult, Lifetime, Scope, UsingDisposable } from "./lifetime" @@ -116,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() { From 9c5ae6c6c53cfae110856739e60d6273a9f66796 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:09:46 -0400 Subject: [PATCH 25/43] debug log improvement --- packages/quickjs-emscripten-core/src/debug.ts | 2 +- packages/quickjs-emscripten-core/src/runtime.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/debug.ts b/packages/quickjs-emscripten-core/src/debug.ts index c74a9484..6eeaad72 100644 --- a/packages/quickjs-emscripten-core/src/debug.ts +++ b/packages/quickjs-emscripten-core/src/debug.ts @@ -23,6 +23,6 @@ export function isDebugMode() { */ export function debugLog(...args: any[]) { if (QTS_DEBUG) { - console.log(...args) + console.log("quickjs-emscripten:", ...args) } } diff --git a/packages/quickjs-emscripten-core/src/runtime.ts b/packages/quickjs-emscripten-core/src/runtime.ts index 83a2a620..adf77513 100644 --- a/packages/quickjs-emscripten-core/src/runtime.ts +++ b/packages/quickjs-emscripten-core/src/runtime.ts @@ -8,7 +8,7 @@ import type { } from "@jitl/quickjs-ffi-types" import { maybeAsyncFn } from "./asyncify-helpers" import { QuickJSContext } from "./context" -import { QTS_DEBUG, debugLog } from "./debug" +import { QTS_DEBUG } from "./debug" import { QuickJSWrongOwner } from "./errors" import type { Disposable } from "./lifetime" import { DisposableResult, Lifetime, Scope, UsingDisposable } from "./lifetime" @@ -362,7 +362,7 @@ export class QuickJSRuntime extends UsingDisposable implements Disposable { */ debugLog(...msg: unknown[]) { if (this._debugMode) { - console.log("QuickJS:", ...msg) + console.log("quickjs-emscripten:", ...msg) } } From 1b0657a82392967a20c2bffff20d497b3c021370 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:13:44 -0400 Subject: [PATCH 26/43] runtime data func not callable from js --- c/interface.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/c/interface.c b/c/interface.c index fd10a3ed..59d47105 100644 --- a/c/interface.c +++ b/c/interface.c @@ -59,8 +59,8 @@ #define LOG_LEN 500 #ifdef QTS_DEBUG_MODE -#define IF_DEBUG if (QTS_GetContextData(ctx)->debug_log) -#define IF_DEBUG_RT if (QTS_GetRuntimeData(rt)->debug_log) +#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); @@ -101,22 +101,22 @@ #define IntrinsicsFlags enum QTS_Intrinsic #define EvalDetectModule int -typedef struct QTS_RuntimeData { +typedef struct qts_RuntimeData { bool debug_log; -} QTS_RuntimeData; +} qts_RuntimeData; -QTS_RuntimeData *QTS_GetRuntimeData(JSRuntime *rt) { - QTS_RuntimeData *data = JS_GetRuntimeOpaque(rt); +qts_RuntimeData *qts_get_runtime_data(JSRuntime *rt) { + qts_RuntimeData *data = JS_GetRuntimeOpaque(rt); if (data == NULL) { - data = malloc(sizeof(QTS_RuntimeData)); + data = malloc(sizeof(qts_RuntimeData)); data->debug_log = false; JS_SetRuntimeOpaque(rt, data); } return data; } -QTS_RuntimeData *QTS_GetContextData(JSContext *ctx) { - return QTS_GetRuntimeData(JS_GetRuntime(ctx)); +qts_RuntimeData *qts_get_context_rt_data(JSContext *ctx) { + return qts_get_runtime_data(JS_GetRuntime(ctx)); } void qts_log(char *msg) { @@ -1004,7 +1004,7 @@ int QTS_GetDebugLogEnabled(JSRuntime *rt) { void QTS_SetDebugLogEnabled(JSRuntime *rt, int is_enabled) { #ifdef QTS_DEBUG_MODE - QTS_GetRuntimeData(rt)->debug_log = (bool)is_enabled; + qts_get_runtime_data(rt)->debug_log = (bool)is_enabled; #endif } From 37b0d858044ac37de847761cc00e132cb5db50d5 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:14:06 -0400 Subject: [PATCH 27/43] regen --- packages/quickjs-ffi-types/src/ffi-async.ts | 2 -- packages/quickjs-ffi-types/src/ffi.ts | 2 -- .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../variant-quickjs-wasmfile-debug-sync/src/ffi.ts | 12 ------------ .../src/ffi.ts | 12 ------------ .../variant-quickjs-wasmfile-release-sync/src/ffi.ts | 12 ------------ 22 files changed, 244 deletions(-) diff --git a/packages/quickjs-ffi-types/src/ffi-async.ts b/packages/quickjs-ffi-types/src/ffi-async.ts index 4e0f5072..8f50f7b2 100644 --- a/packages/quickjs-ffi-types/src/ffi-async.ts +++ b/packages/quickjs-ffi-types/src/ffi-async.ts @@ -38,8 +38,6 @@ export interface QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG: boolean - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer QTS_NewError: (ctx: JSContextPointer) => JSValuePointer QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void diff --git a/packages/quickjs-ffi-types/src/ffi.ts b/packages/quickjs-ffi-types/src/ffi.ts index ae713cd0..cf9a2096 100644 --- a/packages/quickjs-ffi-types/src/ffi.ts +++ b/packages/quickjs-ffi-types/src/ffi.ts @@ -37,8 +37,6 @@ export interface QuickJSFFI { /** Set at compile time. */ readonly DEBUG: boolean - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer QTS_Throw: (ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer) => JSValuePointer QTS_NewError: (ctx: JSContextPointer) => JSValuePointer QTS_RuntimeSetMemoryLimit: (rt: JSRuntimePointer, limit: number) => void 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 fbff87a5..ee3ce88b 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts index 63539116..323a3abc 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts index ced44369..83989cf6 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts index 14247e19..419f408d 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts index fbff87a5..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts index 63539116..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts index ced44369..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts index 14247e19..419f408d 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-browser-release-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts index fbff87a5..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts index 63539116..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts index ced44369..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts index 14247e19..419f408d 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts index fbff87a5..ee3ce88b 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts index 63539116..323a3abc 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts index ced44369..83989cf6 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts index 14247e19..419f408d 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts index fbff87a5..ee3ce88b 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts index 63539116..323a3abc 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-debug-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = true - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts index ced44369..83989cf6 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-asyncify/src/ffi.ts @@ -39,18 +39,6 @@ export class QuickJSAsyncFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, diff --git a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts index 14247e19..419f408d 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts +++ b/packages/variant-quickjs-wasmfile-release-sync/src/ffi.ts @@ -38,18 +38,6 @@ export class QuickJSFFI { /** Set at compile time. */ readonly DEBUG = false - QTS_GetRuntimeData: (rt: JSRuntimePointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetRuntimeData", - "number", - ["number"], - ) - - QTS_GetContextData: (ctx: JSContextPointer) => QTS_RuntimeDataPointer = this.module.cwrap( - "QTS_GetContextData", - "number", - ["number"], - ) - QTS_Throw: ( ctx: JSContextPointer, error: JSValuePointer | JSValueConstPointer, From 7b128b2b4513be432b2d0ebeca1d9855def54c3e Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:25:27 -0400 Subject: [PATCH 28/43] fix build issue --- c/interface.c | 2 -- packages/quickjs-emscripten-core/src/memory.ts | 13 +++++++++---- packages/quickjs-emscripten/src/quickjs.test.ts | 6 ++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/c/interface.c b/c/interface.c index 59d47105..48cedffd 100644 --- a/c/interface.c +++ b/c/interface.c @@ -760,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[LOG_LEN]; -#endif if (detectModule) { if (JS_DetectModule((const char *)js_code, js_code_length)) { QTS_DEBUG("QTS_Eval: Detected module = true"); diff --git a/packages/quickjs-emscripten-core/src/memory.ts b/packages/quickjs-emscripten-core/src/memory.ts index 8447807d..19628f8a 100644 --- a/packages/quickjs-emscripten-core/src/memory.ts +++ b/packages/quickjs-emscripten-core/src/memory.ts @@ -10,21 +10,26 @@ import type { QuickJSHandle } from "./types" /** * @private */ -type HeapUint8Array = { +export type HeapUint8Array = { pointer: JSVoidPointer numBytes: number } -// Add more types as needed. -type TypedArray = Int32Array | Uint32Array +/** + * Add more types as needed. + * @private + */ +export type TypedArray = Int32Array | Uint32Array -interface TypedArrayConstructor { +/** @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 diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index 5ee92282..e6fa6b44 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -43,8 +43,8 @@ import { RELEASE_ASYNC, newVariant, shouldInterruptAfterDeadline, + Scope, } from "." -import { Scope } from "quickjs-emscripten-core" const TEST_SLOW = !process.env.TEST_FAST const TEST_NG = TEST_SLOW && !process.env.TEST_NO_NG @@ -117,7 +117,7 @@ function contextTests(getContext: GetTestContext, isDebug = false) { } // 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}` @@ -423,8 +423,6 @@ function contextTests(getContext: GetTestContext, isDebug = false) { .unwrap(), ) - console.log(props.map((p) => vm.dump(p))) - assert.strictEqual(props.length, 3) assert.strictEqual(vm.dump(props[0]), 0) assert.strictEqual(vm.dump(props[1]), 1) From 0106a864ff4764ad174dcbc8304d5ab9f777a41a Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:26:33 -0400 Subject: [PATCH 29/43] gen doc --- .../interfaces/QuickJSAsyncFFI.md | 60 +++- .../interfaces/QuickJSFFI.md | 60 +++- doc/README.md | 58 ++-- .../classes/QuickJSAsyncContext.md | 295 ++++++++++++------ .../classes/QuickJSAsyncRuntime.md | 99 +++++- .../classes/QuickJSContext.md | 283 +++++++++++------ .../classes/QuickJSRuntime.md | 93 +++++- doc/quickjs-emscripten-core/exports.md | 48 ++- .../interfaces/AsyncRuntimeOptions.md | 16 +- .../interfaces/ContextEvalOptions.md | 10 +- .../interfaces/ContextOptions.md | 2 +- .../interfaces/JSModuleLoader.md | 2 +- .../interfaces/JSModuleLoaderAsync.md | 2 +- .../interfaces/JSModuleNormalizer.md | 4 +- .../interfaces/JSModuleNormalizerAsync.md | 2 +- .../interfaces/QuickJSAsyncFFI.md | 60 +++- .../interfaces/QuickJSFFI.md | 60 +++- .../interfaces/RuntimeOptions.md | 16 +- .../interfaces/RuntimeOptionsBase.md | 14 +- .../namespaces/errors/README.md | 1 + .../QuickJSEmptyGetOwnPropertyNames.md | 59 ++++ doc/quickjs-emscripten/README.md | 58 ++-- .../classes/QuickJSAsyncContext.md | 295 ++++++++++++------ .../classes/QuickJSAsyncRuntime.md | 99 +++++- .../classes/QuickJSContext.md | 283 +++++++++++------ .../classes/QuickJSRuntime.md | 93 +++++- doc/quickjs-emscripten/exports.md | 52 ++- .../interfaces/AsyncRuntimeOptions.md | 16 +- .../interfaces/ContextEvalOptions.md | 10 +- .../interfaces/ContextOptions.md | 2 +- .../interfaces/JSModuleLoader.md | 2 +- .../interfaces/JSModuleLoaderAsync.md | 2 +- .../interfaces/JSModuleNormalizer.md | 4 +- .../interfaces/JSModuleNormalizerAsync.md | 2 +- .../interfaces/QuickJSAsyncFFI.md | 188 ++++++----- .../interfaces/QuickJSAsyncVariant.md | 6 +- .../interfaces/QuickJSFFI.md | 60 +++- .../interfaces/QuickJSSyncVariant.md | 6 +- .../interfaces/RuntimeOptions.md | 16 +- .../interfaces/RuntimeOptionsBase.md | 14 +- .../namespaces/errors/README.md | 1 + .../QuickJSEmptyGetOwnPropertyNames.md | 59 ++++ 42 files changed, 1820 insertions(+), 692 deletions(-) create mode 100644 doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md create mode 100644 doc/quickjs-emscripten/namespaces/errors/classes/QuickJSEmptyGetOwnPropertyNames.md diff --git a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md index ac2b03c5..db50ca6a 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSAsyncFFI.md @@ -37,6 +37,7 @@ 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) @@ -81,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) @@ -123,7 +125,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) +[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) *** @@ -137,7 +139,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -151,7 +153,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -571,6 +573,24 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_GetFalse > **QTS\_GetFalse**: () => [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) @@ -1085,7 +1105,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) *** @@ -1311,7 +1331,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) +[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) *** @@ -1329,7 +1349,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:257](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L257) *** @@ -1365,7 +1385,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) +[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) *** @@ -1385,7 +1405,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) *** @@ -1429,6 +1449,26 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_SetProp > **QTS\_SetProp**: (`ctx`, `this_val`, `prop_name`, `prop_value`) => `void` @@ -1551,7 +1591,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L260) +[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) *** @@ -1571,7 +1611,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) +[packages/quickjs-ffi-types/src/ffi-async.ts: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 7158ea5d..eb92840e 100644 --- a/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md +++ b/doc/@jitl/quickjs-ffi-types/interfaces/QuickJSFFI.md @@ -33,6 +33,7 @@ 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) @@ -73,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) @@ -114,7 +116,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -128,7 +130,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -142,7 +144,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -466,6 +468,24 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_GetFalse > **QTS\_GetFalse**: () => [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) @@ -890,7 +910,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -1116,7 +1136,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1134,7 +1154,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) *** @@ -1170,7 +1190,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) +[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1190,7 +1210,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** @@ -1234,6 +1254,26 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_SetProp > **QTS\_SetProp**: (`ctx`, `this_val`, `prop_name`, `prop_value`) => `void` @@ -1332,7 +1372,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L208) +[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) *** @@ -1352,7 +1392,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) +[packages/quickjs-ffi-types/src/ffi.ts:206](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L206) *** 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/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index fd74efac..2e255e60 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -29,6 +29,7 @@ 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) @@ -43,9 +44,9 @@ host functions as though they were synchronous. - [getIterator()](QuickJSAsyncContext.md#getiterator) - [getLength()](QuickJSAsyncContext.md#getlength) - [getNumber()](QuickJSAsyncContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSAsyncContext.md#getownpropertynames) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) - - [getPropNames()](QuickJSAsyncContext.md#getpropnames) - [getString()](QuickJSAsyncContext.md#getstring) - [getSymbol()](QuickJSAsyncContext.md#getsymbol) - [getWellKnownSymbol()](QuickJSAsyncContext.md#getwellknownsymbol) @@ -111,7 +112,7 @@ to create a new QuickJSContext. #### 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:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -127,7 +128,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:32](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L32) +[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 @@ -145,7 +146,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -161,7 +162,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -179,7 +180,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -195,7 +196,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:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -211,7 +212,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -227,7 +228,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) +[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 @@ -253,9 +254,12 @@ Just calls the standard .dispose() method of this class. ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`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 @@ -263,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 + +`ContextResult`\<[`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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) @@ -271,6 +312,36 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver • ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +##### Returns + +`ContextResult`\<[`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`): `ContextResult`\<[`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 `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> @@ -281,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:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -318,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -349,7 +420,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -374,7 +445,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -400,7 +471,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -434,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) *** @@ -461,7 +532,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** @@ -524,7 +595,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** @@ -550,7 +621,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L45) +[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) *** @@ -572,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -596,7 +667,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -620,13 +691,13 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) +[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**(`handle`): `ContextResult`\<`QuickJSIterator`\> +> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> `handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). Returns a host iterator that wraps and proxies calls to a guest iterator handle. @@ -635,20 +706,16 @@ Once the iterator is done, the handle is automatically disposed, and the iterato is considered done if the handle is disposed. ```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() - } +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 -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) #### Returns @@ -660,7 +727,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -668,7 +735,16 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) > **getLength**(`handle`): `undefined` \| `number` -`handle.length`. +`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 @@ -678,13 +754,15 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) `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:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -710,7 +788,61 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) +[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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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) *** @@ -744,7 +876,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -774,34 +906,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) - -*** - -### getPropNames() - -> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -`Object.getOwnPropertyNames(handle)`. -Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). - -#### Parameters - -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) - -• **options**: `GetOwnPropertyNamesOptions` - -#### Returns - -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -#### Inherited from - -[`quickjs-emscripten-core.QuickJSContext.getPropNames`](QuickJSContext.md#getpropnames) - -#### Source - -[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -825,7 +930,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -850,7 +955,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) *** @@ -874,7 +979,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -895,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:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -919,7 +1024,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -951,7 +1056,7 @@ See [Emscripten's docs on Asyncify](https://emscripten.org/docs/porting/asyncify #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L92) +[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) *** @@ -975,7 +1080,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -1003,7 +1108,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) +[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) @@ -1023,7 +1128,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### 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:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -1039,7 +1144,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -1156,7 +1261,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1180,7 +1285,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1207,7 +1312,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1232,7 +1337,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) +[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) @@ -1258,7 +1363,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) +[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) @@ -1283,7 +1388,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1307,7 +1412,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1332,7 +1437,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1357,7 +1462,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** @@ -1389,7 +1494,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) *** @@ -1416,7 +1521,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) *** @@ -1443,7 +1548,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1480,7 +1585,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) *** @@ -1506,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1530,7 +1635,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1558,7 +1663,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1589,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) +[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 73a83341..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:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) +[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 @@ -141,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) +[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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) +[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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) +[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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) +[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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) +[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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) +[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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) +[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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) +[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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) +[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 e6379d1a..abe39f70 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -54,6 +54,7 @@ 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) @@ -67,9 +68,9 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [getIterator()](QuickJSContext.md#getiterator) - [getLength()](QuickJSContext.md#getlength) - [getNumber()](QuickJSContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSContext.md#getownpropertynames) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) - - [getPropNames()](QuickJSContext.md#getpropnames) - [getString()](QuickJSContext.md#getstring) - [getSymbol()](QuickJSContext.md#getsymbol) - [getWellKnownSymbol()](QuickJSContext.md#getwellknownsymbol) @@ -139,7 +140,7 @@ to create a new QuickJSContext. #### 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:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -151,7 +152,7 @@ The runtime that created this context. #### 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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L187) ## Accessors @@ -169,7 +170,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -185,7 +186,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -203,7 +204,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -219,7 +220,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:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -235,7 +236,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -251,7 +252,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) +[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 @@ -281,9 +282,12 @@ Just calls the standard .dispose() method of this class. ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`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 @@ -291,15 +295,15 @@ 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 `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> @@ -307,13 +311,76 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`ContextResult`\<[`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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -342,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -373,7 +440,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -402,7 +469,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -424,7 +491,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -454,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) *** @@ -477,7 +544,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** @@ -540,7 +607,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** @@ -558,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -578,7 +645,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -598,13 +665,13 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) +[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**(`handle`): `ContextResult`\<`QuickJSIterator`\> +> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> `handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). Returns a host iterator that wraps and proxies calls to a guest iterator handle. @@ -613,20 +680,16 @@ Once the iterator is done, the handle is automatically disposed, and the iterato is considered done if the handle is disposed. ```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() - } +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 -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) #### Returns @@ -634,7 +697,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -642,7 +705,16 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) > **getLength**(`handle`): `undefined` \| `number` -`handle.length`. +`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 @@ -652,9 +724,11 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) `undefined` \| `number` +a number if the handle has a numeric length property, otherwise `undefined`. + #### Source -[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -680,7 +754,57 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) +[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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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) *** @@ -710,7 +834,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -740,30 +864,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) - -*** - -### getPropNames() - -> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -`Object.getOwnPropertyNames(handle)`. -Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). - -#### Parameters - -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) - -• **options**: `GetOwnPropertyNamesOptions` - -#### Returns - -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -#### Source - -[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -787,7 +888,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -808,7 +909,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) *** @@ -828,7 +929,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -845,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:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -865,7 +966,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -885,7 +986,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -909,7 +1010,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) +[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) @@ -925,7 +1026,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### 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:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -937,7 +1038,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -1054,7 +1155,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1078,7 +1179,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1105,7 +1206,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1126,7 +1227,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) +[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) @@ -1148,7 +1249,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) +[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) @@ -1169,7 +1270,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1193,7 +1294,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1214,7 +1315,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1235,7 +1336,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** @@ -1263,7 +1364,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) *** @@ -1286,7 +1387,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) *** @@ -1309,7 +1410,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1346,7 +1447,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) *** @@ -1368,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1388,7 +1489,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1416,7 +1517,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1443,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) +[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/QuickJSRuntime.md b/doc/quickjs-emscripten-core/classes/QuickJSRuntime.md index 2edee6de..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) @@ -94,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) +[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 @@ -142,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) +[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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) +[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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) +[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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) +[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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) +[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:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L136) +[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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) +[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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) +[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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) +[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:311](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L311) +[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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) +[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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L168) +[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/exports.md b/doc/quickjs-emscripten-core/exports.md index 939f1b2b..ae015ee7 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -74,6 +74,7 @@ - [newQuickJSAsyncWASMModuleFromVariant()](exports.md#newquickjsasyncwasmmodulefromvariant) - [newQuickJSWASMModuleFromVariant()](exports.md#newquickjswasmmodulefromvariant) - [newVariant()](exports.md#newvariant) + - [setDebugMode()](exports.md#setdebugmode) - [shouldInterruptAfterDeadline()](exports.md#shouldinterruptafterdeadline) ## Namespaces @@ -146,7 +147,7 @@ #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L19) +[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) *** @@ -337,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) *** @@ -396,7 +397,7 @@ for the Emscripten stack. #### 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) *** @@ -406,7 +407,7 @@ for the Emscripten stack. #### 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) *** @@ -416,7 +417,7 @@ for the Emscripten stack. #### 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) *** @@ -426,7 +427,7 @@ for the Emscripten stack. #### 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) *** @@ -436,7 +437,7 @@ for the Emscripten stack. #### 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) *** @@ -446,7 +447,7 @@ for the Emscripten stack. #### 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) *** @@ -653,7 +654,7 @@ for the Emscripten stack. #### Source -[packages/quickjs-emscripten-core/src/types.ts:332](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L332) +[packages/quickjs-emscripten-core/src/types.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L333) *** @@ -719,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) *** @@ -732,7 +733,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L64) +[packages/quickjs-emscripten-core/src/context.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L69) *** @@ -894,7 +895,7 @@ 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) *** @@ -1383,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/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/QuickJSAsyncFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md index ea771a48..cbcad748 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSAsyncFFI.md @@ -37,6 +37,7 @@ 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) @@ -81,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) @@ -123,7 +125,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) +[packages/quickjs-ffi-types/src/ffi-async.ts:250](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L250) *** @@ -137,7 +139,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L246) +[packages/quickjs-ffi-types/src/ffi-async.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L248) *** @@ -151,7 +153,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:245](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L245) +[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) *** @@ -571,6 +573,24 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_GetFalse > **QTS\_GetFalse**: () => [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) @@ -1085,7 +1105,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:247](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L247) +[packages/quickjs-ffi-types/src/ffi-async.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L249) *** @@ -1311,7 +1331,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:253](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L253) +[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) *** @@ -1329,7 +1349,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:255](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L255) +[packages/quickjs-ffi-types/src/ffi-async.ts:257](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L257) *** @@ -1365,7 +1385,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:252](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L252) +[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) *** @@ -1385,7 +1405,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:254](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L254) +[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) *** @@ -1429,6 +1449,26 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_SetProp > **QTS\_SetProp**: (`ctx`, `this_val`, `prop_name`, `prop_value`) => `void` @@ -1551,7 +1591,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:260](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L260) +[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) *** @@ -1571,7 +1611,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi-async.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-async.ts#L256) +[packages/quickjs-ffi-types/src/ffi-async.ts: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/QuickJSFFI.md b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md index a963ebc9..4251716a 100644 --- a/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten-core/interfaces/QuickJSFFI.md @@ -33,6 +33,7 @@ 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) @@ -73,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) @@ -114,7 +116,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) +[packages/quickjs-ffi-types/src/ffi.ts:198](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L198) *** @@ -128,7 +130,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L194) +[packages/quickjs-ffi-types/src/ffi.ts:196](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L196) *** @@ -142,7 +144,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:193](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L193) +[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) *** @@ -466,6 +468,24 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_GetFalse > **QTS\_GetFalse**: () => [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) @@ -890,7 +910,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:195](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L195) +[packages/quickjs-ffi-types/src/ffi.ts:197](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L197) *** @@ -1116,7 +1136,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:201](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L201) +[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) *** @@ -1134,7 +1154,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L203) +[packages/quickjs-ffi-types/src/ffi.ts:205](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L205) *** @@ -1170,7 +1190,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:200](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L200) +[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) *** @@ -1190,7 +1210,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:202](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L202) +[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) *** @@ -1234,6 +1254,26 @@ Set at compile time. *** +### 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) + +*** + ### QTS\_SetProp > **QTS\_SetProp**: (`ctx`, `this_val`, `prop_name`, `prop_value`) => `void` @@ -1332,7 +1372,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:208](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L208) +[packages/quickjs-ffi-types/src/ffi.ts:210](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L210) *** @@ -1352,7 +1392,7 @@ Set at compile time. #### Source -[packages/quickjs-ffi-types/src/ffi.ts:204](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi.ts#L204) +[packages/quickjs-ffi-types/src/ffi.ts: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/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/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/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index c284544a..37f91d36 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -29,6 +29,7 @@ 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) @@ -43,9 +44,9 @@ host functions as though they were synchronous. - [getIterator()](QuickJSAsyncContext.md#getiterator) - [getLength()](QuickJSAsyncContext.md#getlength) - [getNumber()](QuickJSAsyncContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSAsyncContext.md#getownpropertynames) - [getPromiseState()](QuickJSAsyncContext.md#getpromisestate) - [getProp()](QuickJSAsyncContext.md#getprop) - - [getPropNames()](QuickJSAsyncContext.md#getpropnames) - [getString()](QuickJSAsyncContext.md#getstring) - [getSymbol()](QuickJSAsyncContext.md#getsymbol) - [getWellKnownSymbol()](QuickJSAsyncContext.md#getwellknownsymbol) @@ -111,7 +112,7 @@ to create a new QuickJSContext. #### 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:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -127,7 +128,7 @@ The runtime that created this context. #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:32](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L32) +[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 @@ -145,7 +146,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -161,7 +162,7 @@ false after the object has been [dispose](QuickJSAsyncContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -179,7 +180,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -195,7 +196,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:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -211,7 +212,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -227,7 +228,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) +[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 @@ -253,9 +254,12 @@ Just calls the standard .dispose() method of this class. ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`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 @@ -263,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 + +`ContextResult`\<[`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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters • **func**: [`QuickJSHandle`](../exports.md#quickjshandle) @@ -271,6 +312,36 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver • ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] +##### Returns + +`ContextResult`\<[`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`): `ContextResult`\<[`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 `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> @@ -281,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/src/context.ts:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -318,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -349,7 +420,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -374,7 +445,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -400,7 +471,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -434,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) *** @@ -461,7 +532,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** @@ -524,7 +595,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** @@ -550,7 +621,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:45](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L45) +[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) *** @@ -572,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -596,7 +667,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -620,13 +691,13 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) +[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**(`handle`): `ContextResult`\<`QuickJSIterator`\> +> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> `handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). Returns a host iterator that wraps and proxies calls to a guest iterator handle. @@ -635,20 +706,16 @@ Once the iterator is done, the handle is automatically disposed, and the iterato is considered done if the handle is disposed. ```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() - } +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 -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) #### Returns @@ -660,7 +727,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -668,7 +735,16 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) > **getLength**(`handle`): `undefined` \| `number` -`handle.length`. +`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 @@ -678,13 +754,15 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) `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:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -710,7 +788,61 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) +[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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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) *** @@ -744,7 +876,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -774,34 +906,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) - -*** - -### getPropNames() - -> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -`Object.getOwnPropertyNames(handle)`. -Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). - -#### Parameters - -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) - -• **options**: `GetOwnPropertyNamesOptions` - -#### Returns - -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -#### Inherited from - -[`quickjs-emscripten.QuickJSContext.getPropNames`](QuickJSContext.md#getpropnames) - -#### Source - -[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -825,7 +930,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -850,7 +955,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) *** @@ -874,7 +979,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -895,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:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -919,7 +1024,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -951,7 +1056,7 @@ See [Emscripten's docs on Asyncify](https://emscripten.org/docs/porting/asyncify #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:92](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L92) +[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) *** @@ -975,7 +1080,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -1003,7 +1108,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) +[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) @@ -1023,7 +1128,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### 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:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -1039,7 +1144,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -1156,7 +1261,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1180,7 +1285,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1207,7 +1312,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1232,7 +1337,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) +[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) @@ -1258,7 +1363,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) +[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) @@ -1283,7 +1388,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1307,7 +1412,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1332,7 +1437,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1357,7 +1462,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** @@ -1389,7 +1494,7 @@ You may need to call [runtime](QuickJSAsyncContext.md#runtime).[QuickJSRuntime#e #### Source -[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) *** @@ -1416,7 +1521,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) *** @@ -1443,7 +1548,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1480,7 +1585,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) *** @@ -1506,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1530,7 +1635,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1558,7 +1663,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1589,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) +[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 2d47537d..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) @@ -93,7 +96,7 @@ false after the object has been [dispose](QuickJSAsyncRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) +[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 @@ -141,7 +144,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) +[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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) +[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/src/runtime.ts:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[packages/quickjs-emscripten-core/src/runtime.ts: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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) +[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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) +[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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) +[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) *** @@ -316,7 +366,7 @@ See [setInterruptHandler](QuickJSAsyncRuntime.md#setinterrupthandler). #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) +[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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) +[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/src/runtime.ts:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) +[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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) +[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/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 32390f8b..2d35df5e 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -54,6 +54,7 @@ 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) @@ -67,9 +68,9 @@ See [QuickJSRuntime](QuickJSRuntime.md) for more information. - [getIterator()](QuickJSContext.md#getiterator) - [getLength()](QuickJSContext.md#getlength) - [getNumber()](QuickJSContext.md#getnumber) + - [getOwnPropertyNames()](QuickJSContext.md#getownpropertynames) - [getPromiseState()](QuickJSContext.md#getpromisestate) - [getProp()](QuickJSContext.md#getprop) - - [getPropNames()](QuickJSContext.md#getpropnames) - [getString()](QuickJSContext.md#getstring) - [getSymbol()](QuickJSContext.md#getsymbol) - [getWellKnownSymbol()](QuickJSContext.md#getwellknownsymbol) @@ -139,7 +140,7 @@ to create a new QuickJSContext. #### 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:225](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L225) ## Properties @@ -151,7 +152,7 @@ The runtime that created this context. #### 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:187](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L187) ## Accessors @@ -169,7 +170,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L251) +[packages/quickjs-emscripten-core/src/context.ts:256](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L256) *** @@ -185,7 +186,7 @@ false after the object has been [dispose](QuickJSContext.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/context.ts:309](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L309) +[packages/quickjs-emscripten-core/src/context.ts:314](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L314) *** @@ -203,7 +204,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:324](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L324) +[packages/quickjs-emscripten-core/src/context.ts:329](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L329) *** @@ -219,7 +220,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:288](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L288) *** @@ -235,7 +236,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:296](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L296) +[packages/quickjs-emscripten-core/src/context.ts:301](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L301) *** @@ -251,7 +252,7 @@ You can set properties to create global variables. #### Source -[packages/quickjs-emscripten-core/src/context.ts:270](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L270) +[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 @@ -281,9 +282,12 @@ Just calls the standard .dispose() method of this class. ### callFunction() -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +#### callFunction(func, thisVal, args) + +> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`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 @@ -291,15 +295,15 @@ 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 `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> @@ -307,13 +311,76 @@ 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`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> + +##### Parameters + +• **func**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• **thisVal**: [`QuickJSHandle`](../exports.md#quickjshandle) + +• ...**args**: [`QuickJSHandle`](../exports.md#quickjshandle)[] + +##### Returns + +`ContextResult`\<[`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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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:1009](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1009) +[packages/quickjs-emscripten-core/src/context.ts:1114](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1114) *** @@ -342,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1335](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1335) +[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) *** @@ -373,7 +440,7 @@ Javascript string or number (which will be converted automatically to a JSValue) #### Source -[packages/quickjs-emscripten-core/src/context.ts:960](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L960) +[packages/quickjs-emscripten-core/src/context.ts:1001](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1001) *** @@ -402,7 +469,7 @@ will result in an error. #### Source -[packages/quickjs-emscripten-core/src/context.ts:261](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L261) +[packages/quickjs-emscripten-core/src/context.ts:266](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L266) *** @@ -424,7 +491,7 @@ Returns `handle.toString()` if it cannot be serialized to JSON. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1147](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1147) +[packages/quickjs-emscripten-core/src/context.ts:1235](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1235) *** @@ -454,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1318](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1318) +[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) *** @@ -477,7 +544,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:807](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L807) +[packages/quickjs-emscripten-core/src/context.ts:812](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L812) *** @@ -540,7 +607,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1069](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1069) +[packages/quickjs-emscripten-core/src/context.ts:1157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1157) *** @@ -558,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1344](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1344) +[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) *** @@ -578,7 +645,7 @@ Coverts `handle` to a JavaScript ArrayBuffer #### Source -[packages/quickjs-emscripten-core/src/context.ts:686](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L686) +[packages/quickjs-emscripten-core/src/context.ts:691](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L691) *** @@ -598,13 +665,13 @@ Converts `handle` to a Javascript bigint. #### Source -[packages/quickjs-emscripten-core/src/context.ts:677](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L677) +[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**(`handle`): `ContextResult`\<`QuickJSIterator`\> +> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> `handle[Symbol.iterator]()`. See [QuickJSIterator]([object Object]). Returns a host iterator that wraps and proxies calls to a guest iterator handle. @@ -613,20 +680,16 @@ Once the iterator is done, the handle is automatically disposed, and the iterato is considered done if the handle is disposed. ```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() - } +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 -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) +• **iterableHandle**: [`QuickJSHandle`](../exports.md#quickjshandle) #### Returns @@ -634,7 +697,7 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) #### Source -[packages/quickjs-emscripten-core/src/context.ts:920](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L920) +[packages/quickjs-emscripten-core/src/context.ts:961](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L961) *** @@ -642,7 +705,16 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) > **getLength**(`handle`): `undefined` \| `number` -`handle.length`. +`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 @@ -652,9 +724,11 @@ for (const nextResult of context.unwrapResult(context.getIterator(arrayHandle)) `undefined` \| `number` +a number if the handle has a numeric length property, otherwise `undefined`. + #### Source -[packages/quickjs-emscripten-core/src/context.ts:855](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L855) +[packages/quickjs-emscripten-core/src/context.ts:871](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L871) *** @@ -680,7 +754,57 @@ Converts `handle` into a Javascript number. #### Source -[packages/quickjs-emscripten-core/src/context.ts:648](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L648) +[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`): `ContextResult`\<[`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 + +`ContextResult`\<[`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) *** @@ -710,7 +834,7 @@ resultHandle.dispose(); #### Source -[packages/quickjs-emscripten-core/src/context.ts:711](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L711) +[packages/quickjs-emscripten-core/src/context.ts:716](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L716) *** @@ -740,30 +864,7 @@ Javascript string (which will be converted automatically). #### Source -[packages/quickjs-emscripten-core/src/context.ts:836](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L836) - -*** - -### getPropNames() - -> **getPropNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -`Object.getOwnPropertyNames(handle)`. -Similar to the [standard semantics](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames). - -#### Parameters - -• **handle**: [`QuickJSHandle`](../exports.md#quickjshandle) - -• **options**: `GetOwnPropertyNamesOptions` - -#### Returns - -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`JSValue`](../exports.md#jsvalue)\>\> - -#### Source - -[packages/quickjs-emscripten-core/src/context.ts:868](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L868) +[packages/quickjs-emscripten-core/src/context.ts:841](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L841) *** @@ -787,7 +888,7 @@ Converts `handle` to a Javascript string. #### Source -[packages/quickjs-emscripten-core/src/context.ts:656](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L656) +[packages/quickjs-emscripten-core/src/context.ts:661](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L661) *** @@ -808,7 +909,7 @@ registry in the guest, it will be created with Symbol.for on the host. #### Source -[packages/quickjs-emscripten-core/src/context.ts:665](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L665) +[packages/quickjs-emscripten-core/src/context.ts:670](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L670) *** @@ -828,7 +929,7 @@ Access a well-known symbol that is a property of the global Symbol object, like #### Source -[packages/quickjs-emscripten-core/src/context.ts:384](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L384) +[packages/quickjs-emscripten-core/src/context.ts:389](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L389) *** @@ -845,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:426](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L426) +[packages/quickjs-emscripten-core/src/context.ts:431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L431) *** @@ -865,7 +966,7 @@ Create a new QuickJS [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/ #### Source -[packages/quickjs-emscripten-core/src/context.ts:434](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L434) +[packages/quickjs-emscripten-core/src/context.ts:439](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L439) *** @@ -885,7 +986,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:392](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L392) +[packages/quickjs-emscripten-core/src/context.ts:397](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L397) *** @@ -909,7 +1010,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:603](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L603) +[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) @@ -925,7 +1026,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### 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:609](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L609) #### newError(undefined) @@ -937,7 +1038,7 @@ Create a QuickJS [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScrip ##### Source -[packages/quickjs-emscripten-core/src/context.ts:605](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L605) +[packages/quickjs-emscripten-core/src/context.ts:610](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L610) *** @@ -1054,7 +1155,7 @@ return deferred.handle #### Source -[packages/quickjs-emscripten-core/src/context.ts:597](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L597) +[packages/quickjs-emscripten-core/src/context.ts:602](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L602) *** @@ -1078,7 +1179,7 @@ Converts a Javascript number into a QuickJS value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:343](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L343) +[packages/quickjs-emscripten-core/src/context.ts:348](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L348) *** @@ -1105,7 +1206,7 @@ Like [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R #### Source -[packages/quickjs-emscripten-core/src/context.ts:412](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L412) +[packages/quickjs-emscripten-core/src/context.ts:417](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L417) *** @@ -1126,7 +1227,7 @@ resources; see the documentation on [QuickJSDeferredPromise](QuickJSDeferredProm ##### Source -[packages/quickjs-emscripten-core/src/context.ts:447](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L447) +[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) @@ -1148,7 +1249,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:455](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L455) +[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) @@ -1169,7 +1270,7 @@ You can still resolve/reject the created promise "early" using its methods. ##### Source -[packages/quickjs-emscripten-core/src/context.ts:462](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L462) +[packages/quickjs-emscripten-core/src/context.ts:467](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L467) *** @@ -1193,7 +1294,7 @@ Create a QuickJS [string](https://developer.mozilla.org/en-US/docs/Web/JavaScrip #### Source -[packages/quickjs-emscripten-core/src/context.ts:350](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L350) +[packages/quickjs-emscripten-core/src/context.ts:355](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L355) *** @@ -1214,7 +1315,7 @@ All symbols created with the same key will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:373](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L373) +[packages/quickjs-emscripten-core/src/context.ts:378](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L378) *** @@ -1235,7 +1336,7 @@ No two symbols created with this function will be the same value. #### Source -[packages/quickjs-emscripten-core/src/context.ts:361](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L361) +[packages/quickjs-emscripten-core/src/context.ts:366](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L366) *** @@ -1263,7 +1364,7 @@ You may need to call [runtime](QuickJSContext.md#runtime).[QuickJSRuntime#execut #### Source -[packages/quickjs-emscripten-core/src/context.ts:750](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L750) +[packages/quickjs-emscripten-core/src/context.ts:755](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L755) *** @@ -1286,7 +1387,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:815](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L815) +[packages/quickjs-emscripten-core/src/context.ts:820](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L820) *** @@ -1309,7 +1410,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs #### Source -[packages/quickjs-emscripten-core/src/context.ts:823](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L823) +[packages/quickjs-emscripten-core/src/context.ts:828](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L828) *** @@ -1346,7 +1447,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:945](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L945) +[packages/quickjs-emscripten-core/src/context.ts:986](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L986) *** @@ -1368,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1340](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1340) +[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) *** @@ -1388,7 +1489,7 @@ Throw an error in the VM, interrupted whatever current execution is in progress #### Source -[packages/quickjs-emscripten-core/src/context.ts:1106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1106) +[packages/quickjs-emscripten-core/src/context.ts:1194](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1194) *** @@ -1416,7 +1517,7 @@ Does not support BigInt values correctly. #### Source -[packages/quickjs-emscripten-core/src/context.ts:639](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L639) +[packages/quickjs-emscripten-core/src/context.ts:644](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L644) *** @@ -1443,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:1190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1190) +[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/QuickJSRuntime.md b/doc/quickjs-emscripten/classes/QuickJSRuntime.md index 16c3cd29..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) @@ -94,7 +97,7 @@ false after the object has been [dispose](QuickJSRuntime.md#dispose-1)d #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L121) +[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 @@ -142,7 +145,7 @@ QuickJSWrongOwner if owned by a different runtime. #### Source -[packages/quickjs-emscripten-core/src/runtime.ts:323](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L323) +[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:292](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L292) +[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:125](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L125) +[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:303](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L303) +[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:239](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L239) +[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:190](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L190) +[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:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L136) +[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:215](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L215) +[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:177](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L177) +[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:203](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L203) +[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:311](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L311) +[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:277](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L277) +[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:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/runtime.ts#L168) +[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/exports.md b/doc/quickjs-emscripten/exports.md index 1d4d2563..211cc711 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -88,6 +88,7 @@ - [newQuickJSWASMModule()](exports.md#newquickjswasmmodule) - [newQuickJSWASMModuleFromVariant()](exports.md#newquickjswasmmodulefromvariant) - [newVariant()](exports.md#newvariant) + - [setDebugMode()](exports.md#setdebugmode) - [shouldInterruptAfterDeadline()](exports.md#shouldinterruptafterdeadline) ## Namespaces @@ -160,7 +161,7 @@ #### Source -[packages/quickjs-emscripten-core/src/context-asyncify.ts:19](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context-asyncify.ts#L19) +[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) *** @@ -218,7 +219,7 @@ An `Array` that also implements [Disposable](interfaces/Disposable.md): #### Source -packages/quickjs-ffi-types/dist/index.d.ts:534 +packages/quickjs-ffi-types/dist/index.d.ts:538 *** @@ -351,7 +352,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) *** @@ -410,7 +411,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) *** @@ -420,7 +421,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) *** @@ -430,7 +431,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) *** @@ -440,7 +441,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) *** @@ -450,7 +451,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) *** @@ -460,7 +461,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) *** @@ -667,7 +668,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:75 #### Source -[packages/quickjs-emscripten-core/src/types.ts:332](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L332) +[packages/quickjs-emscripten-core/src/types.ts:333](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/types.ts#L333) *** @@ -733,7 +734,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) *** @@ -746,7 +747,7 @@ Property key for getting or setting a property on a handle with #### Source -[packages/quickjs-emscripten-core/src/context.ts:64](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L64) +[packages/quickjs-emscripten-core/src/context.ts:69](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L69) *** @@ -756,7 +757,7 @@ Property key for getting or setting a property on a handle with #### Source -packages/quickjs-ffi-types/dist/index.d.ts:533 +packages/quickjs-ffi-types/dist/index.d.ts:537 *** @@ -954,7 +955,7 @@ 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) *** @@ -1654,6 +1655,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/interfaces/AsyncRuntimeOptions.md b/doc/quickjs-emscripten/interfaces/AsyncRuntimeOptions.md index 3d5166ad..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/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/interfaces/ContextEvalOptions.md b/doc/quickjs-emscripten/interfaces/ContextEvalOptions.md index 7acf967f..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/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/interfaces/ContextOptions.md b/doc/quickjs-emscripten/interfaces/ContextOptions.md index d1404c91..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/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/interfaces/JSModuleLoader.md b/doc/quickjs-emscripten/interfaces/JSModuleLoader.md index 6967295f..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/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/interfaces/JSModuleLoaderAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleLoaderAsync.md index 3226ea0f..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/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/interfaces/JSModuleNormalizer.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizer.md index ea8ba5e7..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/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/interfaces/JSModuleNormalizerAsync.md b/doc/quickjs-emscripten/interfaces/JSModuleNormalizerAsync.md index bbb79216..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/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/interfaces/QuickJSAsyncFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md index cc06871a..0d45618c 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSAsyncFFI.md @@ -37,6 +37,7 @@ 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) @@ -81,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) @@ -103,7 +105,7 @@ Set at compile time. #### Source -packages/quickjs-ffi-types/dist/index.d.ts:422 +packages/quickjs-ffi-types/dist/index.d.ts:424 *** @@ -123,7 +125,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:422 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:489 +packages/quickjs-ffi-types/dist/index.d.ts:493 *** @@ -137,7 +139,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:489 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:487 +packages/quickjs-ffi-types/dist/index.d.ts:491 *** @@ -151,7 +153,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:487 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:486 +packages/quickjs-ffi-types/dist/index.d.ts:490 *** @@ -165,7 +167,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:486 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:429 +packages/quickjs-ffi-types/dist/index.d.ts:431 *** @@ -191,7 +193,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:429 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:470 +packages/quickjs-ffi-types/dist/index.d.ts:472 *** @@ -217,7 +219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:470 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:471 +packages/quickjs-ffi-types/dist/index.d.ts:473 *** @@ -251,7 +253,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:471 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:467 +packages/quickjs-ffi-types/dist/index.d.ts:469 *** @@ -271,7 +273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:467 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:473 +packages/quickjs-ffi-types/dist/index.d.ts:475 *** @@ -291,7 +293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:473 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:474 +packages/quickjs-ffi-types/dist/index.d.ts:476 *** @@ -311,7 +313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:474 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:443 +packages/quickjs-ffi-types/dist/index.d.ts:445 *** @@ -339,7 +341,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:443 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:475 +packages/quickjs-ffi-types/dist/index.d.ts:477 *** @@ -367,7 +369,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:475 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:476 +packages/quickjs-ffi-types/dist/index.d.ts:478 *** @@ -389,7 +391,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:476 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:459 +packages/quickjs-ffi-types/dist/index.d.ts:461 *** @@ -411,7 +413,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:459 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:460 +packages/quickjs-ffi-types/dist/index.d.ts:462 *** @@ -431,7 +433,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:460 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:442 +packages/quickjs-ffi-types/dist/index.d.ts:444 *** @@ -449,7 +451,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:442 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:438 +packages/quickjs-ffi-types/dist/index.d.ts:440 *** @@ -467,7 +469,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:438 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:436 +packages/quickjs-ffi-types/dist/index.d.ts:438 *** @@ -487,7 +489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:436 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:439 +packages/quickjs-ffi-types/dist/index.d.ts:441 *** @@ -507,7 +509,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:442 *** @@ -527,7 +529,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:440 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:441 +packages/quickjs-ffi-types/dist/index.d.ts:443 *** @@ -547,7 +549,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:441 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:452 +packages/quickjs-ffi-types/dist/index.d.ts:454 *** @@ -567,7 +569,25 @@ packages/quickjs-ffi-types/dist/index.d.ts:452 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:453 +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 *** @@ -581,7 +601,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:453 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:433 +packages/quickjs-ffi-types/dist/index.d.ts:435 *** @@ -601,7 +621,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:433 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:449 +packages/quickjs-ffi-types/dist/index.d.ts:451 *** @@ -619,7 +639,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:449 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:481 +packages/quickjs-ffi-types/dist/index.d.ts:483 *** @@ -641,7 +661,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:481 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:479 +packages/quickjs-ffi-types/dist/index.d.ts:481 *** @@ -661,7 +681,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:479 *** @@ -675,7 +695,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:477 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:432 +packages/quickjs-ffi-types/dist/index.d.ts:434 *** @@ -701,7 +721,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:432 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:468 +packages/quickjs-ffi-types/dist/index.d.ts:470 *** @@ -727,7 +747,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:468 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:469 +packages/quickjs-ffi-types/dist/index.d.ts:471 *** @@ -749,7 +769,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:469 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:461 +packages/quickjs-ffi-types/dist/index.d.ts:463 *** @@ -771,7 +791,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:461 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:463 +packages/quickjs-ffi-types/dist/index.d.ts:465 *** @@ -793,7 +813,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:463 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:464 +packages/quickjs-ffi-types/dist/index.d.ts:466 *** @@ -815,7 +835,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:464 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:462 +packages/quickjs-ffi-types/dist/index.d.ts:464 *** @@ -835,7 +855,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:462 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:451 +packages/quickjs-ffi-types/dist/index.d.ts:453 *** @@ -855,7 +875,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:451 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:455 +packages/quickjs-ffi-types/dist/index.d.ts:457 *** @@ -875,7 +895,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:455 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:456 +packages/quickjs-ffi-types/dist/index.d.ts:458 *** @@ -889,7 +909,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:456 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:434 +packages/quickjs-ffi-types/dist/index.d.ts:436 *** @@ -903,7 +923,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:434 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:431 +packages/quickjs-ffi-types/dist/index.d.ts:433 *** @@ -927,7 +947,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:431 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:480 +packages/quickjs-ffi-types/dist/index.d.ts:482 *** @@ -947,7 +967,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:480 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:457 +packages/quickjs-ffi-types/dist/index.d.ts:459 *** @@ -965,7 +985,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:457 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:458 +packages/quickjs-ffi-types/dist/index.d.ts:460 *** @@ -983,7 +1003,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:458 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:446 +packages/quickjs-ffi-types/dist/index.d.ts:448 *** @@ -1005,7 +1025,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:446 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:447 +packages/quickjs-ffi-types/dist/index.d.ts:449 *** @@ -1025,7 +1045,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:447 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:437 +packages/quickjs-ffi-types/dist/index.d.ts:439 *** @@ -1043,7 +1063,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:437 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:424 +packages/quickjs-ffi-types/dist/index.d.ts:426 *** @@ -1063,7 +1083,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:424 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:448 +packages/quickjs-ffi-types/dist/index.d.ts:450 *** @@ -1085,7 +1105,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:448 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:488 +packages/quickjs-ffi-types/dist/index.d.ts:492 *** @@ -1103,7 +1123,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:488 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:444 +packages/quickjs-ffi-types/dist/index.d.ts:446 *** @@ -1123,7 +1143,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:444 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:445 +packages/quickjs-ffi-types/dist/index.d.ts:447 *** @@ -1143,7 +1163,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:445 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:482 +packages/quickjs-ffi-types/dist/index.d.ts:484 *** @@ -1157,7 +1177,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:482 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:435 +packages/quickjs-ffi-types/dist/index.d.ts:437 *** @@ -1177,7 +1197,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:435 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:450 +packages/quickjs-ffi-types/dist/index.d.ts:452 *** @@ -1199,7 +1219,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:450 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:454 +packages/quickjs-ffi-types/dist/index.d.ts:456 *** @@ -1219,7 +1239,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:454 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:484 +packages/quickjs-ffi-types/dist/index.d.ts:486 *** @@ -1239,7 +1259,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:484 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:483 +packages/quickjs-ffi-types/dist/index.d.ts:485 *** @@ -1253,7 +1273,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:483 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:428 +packages/quickjs-ffi-types/dist/index.d.ts:430 *** @@ -1273,7 +1293,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:428 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:472 +packages/quickjs-ffi-types/dist/index.d.ts:474 *** @@ -1293,7 +1313,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:472 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:426 +packages/quickjs-ffi-types/dist/index.d.ts:428 *** @@ -1311,7 +1331,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:426 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:491 +packages/quickjs-ffi-types/dist/index.d.ts:495 *** @@ -1329,7 +1349,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:491 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:493 +packages/quickjs-ffi-types/dist/index.d.ts:497 *** @@ -1347,7 +1367,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:493 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:427 +packages/quickjs-ffi-types/dist/index.d.ts:429 *** @@ -1365,7 +1385,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:427 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:490 +packages/quickjs-ffi-types/dist/index.d.ts:494 *** @@ -1385,7 +1405,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:490 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:492 +packages/quickjs-ffi-types/dist/index.d.ts:496 *** @@ -1405,7 +1425,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:492 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:430 +packages/quickjs-ffi-types/dist/index.d.ts:432 *** @@ -1425,7 +1445,27 @@ packages/quickjs-ffi-types/dist/index.d.ts:430 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:425 +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 *** @@ -1449,7 +1489,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:425 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:465 +packages/quickjs-ffi-types/dist/index.d.ts:467 *** @@ -1473,7 +1513,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:465 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:466 +packages/quickjs-ffi-types/dist/index.d.ts:468 *** @@ -1491,7 +1531,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:466 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:485 +packages/quickjs-ffi-types/dist/index.d.ts:487 *** @@ -1511,7 +1551,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:485 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:423 +packages/quickjs-ffi-types/dist/index.d.ts:425 *** @@ -1531,7 +1571,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:423 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:478 +packages/quickjs-ffi-types/dist/index.d.ts:480 *** @@ -1551,7 +1591,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:478 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:495 +packages/quickjs-ffi-types/dist/index.d.ts:499 *** @@ -1571,7 +1611,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:495 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:494 +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 29b2db4d..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:530 +packages/quickjs-ffi-types/dist/index.d.ts:534 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:530 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:531 +packages/quickjs-ffi-types/dist/index.d.ts:535 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:531 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:529 +packages/quickjs-ffi-types/dist/index.d.ts:533 *** diff --git a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md index 399d9caa..0239d3df 100644 --- a/doc/quickjs-emscripten/interfaces/QuickJSFFI.md +++ b/doc/quickjs-emscripten/interfaces/QuickJSFFI.md @@ -33,6 +33,7 @@ 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) @@ -73,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) @@ -114,7 +116,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:346 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:404 +packages/quickjs-ffi-types/dist/index.d.ts:406 *** @@ -128,7 +130,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:404 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:402 +packages/quickjs-ffi-types/dist/index.d.ts:404 *** @@ -142,7 +144,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:402 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:401 +packages/quickjs-ffi-types/dist/index.d.ts:403 *** @@ -466,6 +468,24 @@ 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 + +*** + ### QTS\_GetFalse > **QTS\_GetFalse**: () => [`JSValueConstPointer`](../exports.md#jsvalueconstpointer) @@ -890,7 +910,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:372 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:403 +packages/quickjs-ffi-types/dist/index.d.ts:405 *** @@ -1116,7 +1136,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:350 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:406 +packages/quickjs-ffi-types/dist/index.d.ts:408 *** @@ -1134,7 +1154,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:406 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:408 +packages/quickjs-ffi-types/dist/index.d.ts:410 *** @@ -1170,7 +1190,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:351 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:405 +packages/quickjs-ffi-types/dist/index.d.ts:407 *** @@ -1190,7 +1210,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:405 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:407 +packages/quickjs-ffi-types/dist/index.d.ts:409 *** @@ -1234,6 +1254,26 @@ 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 + +*** + ### QTS\_SetProp > **QTS\_SetProp**: (`ctx`, `this_val`, `prop_name`, `prop_value`) => `void` @@ -1332,7 +1372,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:393 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:410 +packages/quickjs-ffi-types/dist/index.d.ts:412 *** @@ -1352,7 +1392,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:410 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:409 +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 5e7e1222..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:516 +packages/quickjs-ffi-types/dist/index.d.ts:520 *** @@ -50,7 +50,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:516 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:517 +packages/quickjs-ffi-types/dist/index.d.ts:521 *** @@ -60,7 +60,7 @@ packages/quickjs-ffi-types/dist/index.d.ts:517 #### Source -packages/quickjs-ffi-types/dist/index.d.ts:515 +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 73a39b32..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/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/interfaces/RuntimeOptionsBase.md b/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md index bbd598e9..9b35030b 100644 --- a/doc/quickjs-emscripten/interfaces/RuntimeOptionsBase.md +++ b/doc/quickjs-emscripten/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/namespaces/errors/README.md b/doc/quickjs-emscripten/namespaces/errors/README.md index daf79147..9b6039da 100644 --- a/doc/quickjs-emscripten/namespaces/errors/README.md +++ b/doc/quickjs-emscripten/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/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/) From f53f1c3959bb66d5bfdac07a51ef29391ab521b2 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:54:39 -0400 Subject: [PATCH 30/43] doc --- packages/quickjs-emscripten-core/src/debug.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/quickjs-emscripten-core/src/debug.ts b/packages/quickjs-emscripten-core/src/debug.ts index 6eeaad72..1cf4487e 100644 --- a/packages/quickjs-emscripten-core/src/debug.ts +++ b/packages/quickjs-emscripten-core/src/debug.ts @@ -14,6 +14,7 @@ export function setDebugMode(enabled: boolean = true) { QTS_DEBUG = enabled } +/** Get the global debug mode */ export function isDebugMode() { return QTS_DEBUG } From d0d5840196f9a7f221c8c600dde486a1088d0f57 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:54:58 -0400 Subject: [PATCH 31/43] for some reason lockfile changed --- yarn.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index c75568ab..36155294 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5244,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" From 9d80b4ddae0cd133aa2ec92448c9eaf04ef25de8 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 13:56:40 -0400 Subject: [PATCH 32/43] test: turn on debug mode via env var --- packages/quickjs-emscripten/src/quickjs.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index e6fa6b44..8906175f 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -44,6 +44,7 @@ import { newVariant, shouldInterruptAfterDeadline, Scope, + setDebugMode, } from "." const TEST_SLOW = !process.env.TEST_FAST @@ -51,14 +52,20 @@ 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 From 0bd818b3ff5bfe2329d5775cbf0771345dbcf978 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 14:33:46 -0400 Subject: [PATCH 33/43] fix test leak --- packages/quickjs-emscripten/src/quickjs.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index 8906175f..04866748 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -443,6 +443,7 @@ function contextTests(getContext: GetTestContext, isDebug = false) { vm.setProp(obj, "c", vm.undefined) const sym = vm.newUniqueSymbol("d") vm.setProp(obj, sym, vm.undefined) + sym.dispose() const props = manage( vm From 69bc3d9ee060742dd14f99acc4eacfe891ba8dcc Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 15:26:26 -0400 Subject: [PATCH 34/43] changelog, naming adjustments --- CHANGELOG.md | 28 +++++++++++++++++++ .../src/context-asyncify.ts | 4 +-- .../quickjs-emscripten-core/src/context.ts | 20 ++++++------- 3 files changed, 40 insertions(+), 12 deletions(-) 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/packages/quickjs-emscripten-core/src/context-asyncify.ts b/packages/quickjs-emscripten-core/src/context-asyncify.ts index d377d157..02db51de 100644 --- a/packages/quickjs-emscripten-core/src/context-asyncify.ts +++ b/packages/quickjs-emscripten-core/src/context-asyncify.ts @@ -6,7 +6,7 @@ import type { JSRuntimePointer, JSValuePointer, } from "@jitl/quickjs-ffi-types" -import type { ContextResult } from "./context" +import type { QuickJSContextResult } from "./context" import { QuickJSContext } from "./context" import type { Lifetime } from "./lifetime" import type { QuickJSModuleCallbacks } from "./module" @@ -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 diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index c4fd43cb..657b5265 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -60,7 +60,7 @@ import type { } from "./vm-interface" import { QuickJSIterator } from "./QuickJSIterator" -export type ContextResult = DisposableResult +export type QuickJSContextResult = DisposableResult /** * Property key for getting or setting a property on a handle with @@ -752,7 +752,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")) @@ -763,7 +763,7 @@ 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) => { @@ -911,7 +911,7 @@ export class QuickJSContext strings: true, numbersAsStrings: true, }, - ): ContextResult> { + ): QuickJSContextResult> { this.runtime.assertOwned(handle) handle.value // assert alive const flags = getOwnPropertyNamesOptionsToFlags(options) @@ -958,7 +958,7 @@ export class QuickJSContext * } * ``` */ - getIterator(iterableHandle: QuickJSHandle): ContextResult { + getIterator(iterableHandle: QuickJSHandle): QuickJSContextResult { const SymbolIterator = (this._SymbolIterator ??= this.memory.manage( this.getWellKnownSymbol("iterator"), )) @@ -1061,17 +1061,17 @@ export class QuickJSContext func: QuickJSHandle, thisVal: QuickJSHandle, args?: QuickJSHandle[], - ): ContextResult + ): QuickJSContextResult callFunction( func: QuickJSHandle, thisVal: QuickJSHandle, ...args: QuickJSHandle[] - ): ContextResult + ): QuickJSContextResult callFunction( func: QuickJSHandle, thisVal: QuickJSHandle, ...restArgs: Array - ): ContextResult { + ): QuickJSContextResult { this.runtime.assertOwned(func) let args const firstArg = restArgs[0] @@ -1115,7 +1115,7 @@ export class QuickJSContext thisHandle: QuickJSHandle, key: QuickJSPropertyKey, args: QuickJSHandle[] = [], - ): ContextResult { + ): QuickJSContextResult { return this.getProp(thisHandle, key).consume((func) => this.callFunction(func, thisHandle, args), ) @@ -1164,7 +1164,7 @@ export class QuickJSContext * See {@link EvalFlags} for number semantics. */ options?: number | ContextEvalOptions, - ): ContextResult { + ): QuickJSContextResult { const detectModule = (options === undefined ? 1 : 0) as EvalDetectModule const flags = evalOptionsToFlags(options) as EvalFlags const resultPtr = this.memory From 5504852d089e5bb3e6e8ff6eedbb331c99a4397d Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 15:28:10 -0400 Subject: [PATCH 35/43] fix type rename error --- .../quickjs-emscripten-core/src/QuickJSIterator.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts index a70d128a..adcd8547 100644 --- a/packages/quickjs-emscripten-core/src/QuickJSIterator.ts +++ b/packages/quickjs-emscripten-core/src/QuickJSIterator.ts @@ -1,4 +1,4 @@ -import type { ContextResult, QuickJSContext } from "./context" +import type { QuickJSContextResult, QuickJSContext } from "./context" import { DisposableResult, Lifetime, UsingDisposable } from "./lifetime" import type { QuickJSRuntime } from "./runtime" import type { QuickJSHandle } from "./types" @@ -28,7 +28,7 @@ import type { QuickJSHandle } from "./types" */ export class QuickJSIterator extends UsingDisposable - implements Disposable, IterableIterator> + implements Disposable, IterableIterator> { public owner: QuickJSRuntime private _next: QuickJSHandle | undefined @@ -46,7 +46,7 @@ export class QuickJSIterator return this } - next(value?: QuickJSHandle): IteratorResult, any> { + next(value?: QuickJSHandle): IteratorResult, any> { if (!this.alive || this._isDone) { return { done: true, @@ -58,7 +58,7 @@ export class QuickJSIterator return this.callIteratorMethod(nextMethod, value) } - return(value?: QuickJSHandle): IteratorResult, any> { + return(value?: QuickJSHandle): IteratorResult, any> { if (!this.alive) { return { done: true, @@ -84,7 +84,7 @@ export class QuickJSIterator return result } - throw(e?: any): IteratorResult, any> { + throw(e?: any): IteratorResult, any> { if (!this.alive) { return { done: true, @@ -116,7 +116,7 @@ export class QuickJSIterator private callIteratorMethod( method: QuickJSHandle, input?: QuickJSHandle, - ): IteratorResult, any> { + ): IteratorResult, any> { const callResult = input ? this.context.callFunction(method, this.handle, input) : this.context.callFunction(method, this.handle) From 33b870ec43658f53cc4f241aecae6c179d62f392 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 15:39:01 -0400 Subject: [PATCH 36/43] fix node test build --- packages/internal-tsconfig/tsconfig.json | 1 + packages/quickjs-emscripten/package.json | 2 +- packages/quickjs-emscripten/tsconfig.node.json | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 packages/quickjs-emscripten/tsconfig.node.json diff --git a/packages/internal-tsconfig/tsconfig.json b/packages/internal-tsconfig/tsconfig.json index 7168b281..6bc2677d 100644 --- a/packages/internal-tsconfig/tsconfig.json +++ b/packages/internal-tsconfig/tsconfig.json @@ -32,6 +32,7 @@ // "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'). */ diff --git a/packages/quickjs-emscripten/package.json b/packages/quickjs-emscripten/package.json index 9707a456..f2ab5a44 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.node.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/tsconfig.node.json b/packages/quickjs-emscripten/tsconfig.node.json new file mode 100644 index 00000000..7412f5b6 --- /dev/null +++ b/packages/quickjs-emscripten/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": ".output", + "rootDir": "src", + "paths": { + "#variants": ["./src/variants.ts", "./src/variants.js"] + } + } +} From 80e107cb85684a5278602b3c8f4c312d646b5df4 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 15:40:49 -0400 Subject: [PATCH 37/43] tweak to ensure path stuff doesnt affect build --- packages/quickjs-emscripten/package.json | 2 +- .../{tsconfig.node.json => tsconfig.build.json} | 0 packages/quickjs-emscripten/tsup.config.ts | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) rename packages/quickjs-emscripten/{tsconfig.node.json => tsconfig.build.json} (100%) diff --git a/packages/quickjs-emscripten/package.json b/packages/quickjs-emscripten/package.json index f2ab5a44..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 tsconfig.node.json && ./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/tsconfig.node.json b/packages/quickjs-emscripten/tsconfig.build.json similarity index 100% rename from packages/quickjs-emscripten/tsconfig.node.json rename to packages/quickjs-emscripten/tsconfig.build.json diff --git a/packages/quickjs-emscripten/tsup.config.ts b/packages/quickjs-emscripten/tsup.config.ts index 54855028..47d83b03 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.node.json", format: "esm", target: ["node16", ...browsers], }), extendConfig({ entry: ["src/index.ts", "src/variants.ts"], + tsconfig: "./tsconfig.node.json", format: "cjs", }), extendConfig({ From 31aa729730db62cd4b3408d5517c7b0c2ee36495 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 15:45:34 -0400 Subject: [PATCH 38/43] restore previous build tsconfig --- packages/quickjs-emscripten-core/tsconfig.build.json | 9 +++++++++ packages/quickjs-emscripten-core/tsup.config.ts | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 packages/quickjs-emscripten-core/tsconfig.build.json 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/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", +}) From 2af655dec0aee1adb274bd5867784339efe1097c Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 16:34:23 -0400 Subject: [PATCH 39/43] disable asyncify-advise, its just really spammy --- packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile | 1 - packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md | 1 - .../variant-quickjs-singlefile-browser-debug-asyncify/Makefile | 1 - .../variant-quickjs-singlefile-browser-debug-asyncify/README.md | 1 - packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile | 1 - .../variant-quickjs-singlefile-cjs-debug-asyncify/README.md | 1 - packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile | 1 - .../variant-quickjs-singlefile-mjs-debug-asyncify/README.md | 1 - packages/variant-quickjs-wasmfile-debug-asyncify/Makefile | 1 - packages/variant-quickjs-wasmfile-debug-asyncify/README.md | 1 - scripts/prepareVariants.ts | 2 +- 11 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index 7ddc5392..503b6680 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -91,7 +91,6 @@ 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 diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md index e1d7cba9..5a194c53 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/README.md @@ -88,7 +88,6 @@ Variant-specific Emscripten build flags: "--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-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 21dab7dc..4aace500 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -92,7 +92,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 diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md index e9491173..38304e33 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/README.md @@ -77,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/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index ceb0ed48..e5f1938e 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -92,7 +92,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 diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md index 6424a2ad..b99a07f5 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/README.md @@ -77,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/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index eddec1fc..b2146452 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -92,7 +92,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 diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md index 4d9a63b7..5d8e35e2 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/README.md @@ -77,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-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index d3b9aa55..afbbc1b7 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -91,7 +91,6 @@ 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 diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md index a9fa31e9..2a559f55 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/README.md +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/README.md @@ -88,7 +88,6 @@ Variant-specific Emscripten build flags: "--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/scripts/prepareVariants.ts b/scripts/prepareVariants.ts index 66d6febe..7c683b4d 100755 --- a/scripts/prepareVariants.ts +++ b/scripts/prepareVariants.ts @@ -223,7 +223,7 @@ function getCflags(targetName: string, variant: BuildVariant) { 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", From 9652df4c9c23fc3b2cfdfd1a746e2566edb8f1b6 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 16:36:36 -0400 Subject: [PATCH 40/43] derp naming --- packages/quickjs-emscripten/tsup.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/quickjs-emscripten/tsup.config.ts b/packages/quickjs-emscripten/tsup.config.ts index 47d83b03..8ae8bb05 100644 --- a/packages/quickjs-emscripten/tsup.config.ts +++ b/packages/quickjs-emscripten/tsup.config.ts @@ -12,13 +12,13 @@ const browsers: Extract> = [ const configs = [ extendConfig({ entry: ["src/index.ts", "src/variants.ts"], - tsconfig: "./tsconfig.node.json", + tsconfig: "./tsconfig.build.json", format: "esm", target: ["node16", ...browsers], }), extendConfig({ entry: ["src/index.ts", "src/variants.ts"], - tsconfig: "./tsconfig.node.json", + tsconfig: "./tsconfig.build.json", format: "cjs", }), extendConfig({ From 6f7194277ca624f7263ca60bc13b0af83e056c0e Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 17:03:00 -0400 Subject: [PATCH 41/43] stuff --- .vscode/settings.json | 3 ++ .../README.md | 1 - .../README.md | 1 - .../README.md | 1 - .../README.md | 1 - .../quickjs-wasmfile-debug-asyncify/README.md | 1 - .../classes/QuickJSAsyncContext.md | 32 +++++++++---------- .../classes/QuickJSContext.md | 28 ++++++++-------- .../classes/QuickJSAsyncContext.md | 32 +++++++++---------- .../classes/QuickJSContext.md | 28 ++++++++-------- .../quickjs-emscripten/src/quickjs.test.ts | 2 +- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- .../Makefile | 7 ++-- templates/Variant.mk | 7 ++-- 32 files changed, 127 insertions(+), 150 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 58084395..9ad76c27 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,5 +10,8 @@ "stdbool.h": "c", "emscripten.h": "c", "quickjs-atom.h": "c" + }, + "files.exclude": { + ".yarn/releases/*": true } } diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md index 7340b641..4623ca4d 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md @@ -101,7 +101,6 @@ Variant-specific Emscripten build flags: "--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-singlefile-browser-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md index 7fd86b08..ebee4f29 100644 --- a/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md @@ -90,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-asyncify/README.md b/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md index cf788561..0b243d0d 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md @@ -90,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-asyncify/README.md b/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md index 6032cbba..52805212 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md @@ -90,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-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md index 5580d361..f6f33a94 100644 --- a/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md +++ b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md @@ -101,7 +101,6 @@ Variant-specific Emscripten build flags: "--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/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index 2e255e60..381ebb48 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -256,7 +256,7 @@ Just calls the standard .dispose() method of this class. #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **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). @@ -277,7 +277,7 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver ##### Returns -`ContextResult`\<[`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 @@ -302,7 +302,7 @@ console.log(context.dump(resultHandle)) // 42 #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Parameters @@ -314,7 +314,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Returns -`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Inherited from @@ -328,7 +328,7 @@ console.log(context.dump(resultHandle)) // 42 ### callMethod() -> **callMethod**(`thisHandle`, `key`, `args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> `handle[key](...args)` @@ -344,7 +344,7 @@ Call a method on a JSValue. This is a convenience method that calls [getProp](Qu #### Returns -`ContextResult`\<[`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 @@ -538,7 +538,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`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). @@ -582,7 +582,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -`ContextResult`\<[`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 @@ -601,7 +601,7 @@ interrupted, the error will have name `InternalError` and message ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -617,7 +617,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source @@ -697,7 +697,7 @@ Converts `handle` to a Javascript bigint. ### getIterator() -> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> +> **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. @@ -719,7 +719,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Returns -`ContextResult`\<`QuickJSIterator`\> +`QuickJSContextResult`\<`QuickJSIterator`\> #### Inherited from @@ -794,7 +794,7 @@ Converts `handle` into a Javascript number. ### getOwnPropertyNames() -> **getOwnPropertyNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **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), @@ -828,7 +828,7 @@ for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { #### Returns -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`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. @@ -1468,7 +1468,7 @@ No two symbols created with this function will be the same value. ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`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 @@ -1482,7 +1482,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index abe39f70..0e9bf229 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -284,7 +284,7 @@ Just calls the standard .dispose() method of this class. #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **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). @@ -305,7 +305,7 @@ a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it ##### Returns -`ContextResult`\<[`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 @@ -330,7 +330,7 @@ console.log(context.dump(resultHandle)) // 42 #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Parameters @@ -342,7 +342,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Returns -`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Implementation of @@ -356,7 +356,7 @@ console.log(context.dump(resultHandle)) // 42 ### callMethod() -> **callMethod**(`thisHandle`, `key`, `args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> `handle[key](...args)` @@ -372,7 +372,7 @@ Call a method on a JSValue. This is a convenience method that calls [getProp](Qu #### Returns -`ContextResult`\<[`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 @@ -550,7 +550,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`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). @@ -594,7 +594,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -`ContextResult`\<[`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 @@ -671,7 +671,7 @@ Converts `handle` to a Javascript bigint. ### getIterator() -> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> +> **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. @@ -693,7 +693,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Returns -`ContextResult`\<`QuickJSIterator`\> +`QuickJSContextResult`\<`QuickJSIterator`\> #### Source @@ -760,7 +760,7 @@ Converts `handle` into a Javascript number. ### getOwnPropertyNames() -> **getOwnPropertyNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **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), @@ -794,7 +794,7 @@ for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { #### Returns -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`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. @@ -1342,7 +1342,7 @@ No two symbols created with this function will be the same value. ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`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 @@ -1356,7 +1356,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index 37f91d36..4ef767d3 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -256,7 +256,7 @@ Just calls the standard .dispose() method of this class. #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **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). @@ -277,7 +277,7 @@ a promise, use [resolvePromise](QuickJSAsyncContext.md#resolvepromise) to conver ##### Returns -`ContextResult`\<[`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 @@ -302,7 +302,7 @@ console.log(context.dump(resultHandle)) // 42 #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Parameters @@ -314,7 +314,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Returns -`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Inherited from @@ -328,7 +328,7 @@ console.log(context.dump(resultHandle)) // 42 ### callMethod() -> **callMethod**(`thisHandle`, `key`, `args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> `handle[key](...args)` @@ -344,7 +344,7 @@ Call a method on a JSValue. This is a convenience method that calls [getProp](Qu #### Returns -`ContextResult`\<[`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 @@ -538,7 +538,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`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). @@ -582,7 +582,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -`ContextResult`\<[`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 @@ -601,7 +601,7 @@ interrupted, the error will have name `InternalError` and message ### evalCodeAsync() -> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **evalCodeAsync**(`code`, `filename`, `options`?): `Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> Asyncified version of [evalCode](QuickJSAsyncContext.md#evalcode). @@ -617,7 +617,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Source @@ -697,7 +697,7 @@ Converts `handle` to a Javascript bigint. ### getIterator() -> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> +> **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. @@ -719,7 +719,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Returns -`ContextResult`\<`QuickJSIterator`\> +`QuickJSContextResult`\<`QuickJSIterator`\> #### Inherited from @@ -794,7 +794,7 @@ Converts `handle` into a Javascript number. ### getOwnPropertyNames() -> **getOwnPropertyNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **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), @@ -828,7 +828,7 @@ for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { #### Returns -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`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. @@ -1468,7 +1468,7 @@ No two symbols created with this function will be the same value. ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`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 @@ -1482,7 +1482,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Inherited from diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 2d35df5e..be34f1df 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -284,7 +284,7 @@ Just calls the standard .dispose() method of this class. #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, `args`?): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **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). @@ -305,7 +305,7 @@ a promise, use [resolvePromise](QuickJSContext.md#resolvepromise) to convert it ##### Returns -`ContextResult`\<[`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 @@ -330,7 +330,7 @@ console.log(context.dump(resultHandle)) // 42 #### callFunction(func, thisVal, args) -> **callFunction**(`func`, `thisVal`, ...`args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callFunction**(`func`, `thisVal`, ...`args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Parameters @@ -342,7 +342,7 @@ console.log(context.dump(resultHandle)) // 42 ##### Returns -`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> ##### Implementation of @@ -356,7 +356,7 @@ console.log(context.dump(resultHandle)) // 42 ### callMethod() -> **callMethod**(`thisHandle`, `key`, `args`): `ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> +> **callMethod**(`thisHandle`, `key`, `args`): `QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\> `handle[key](...args)` @@ -372,7 +372,7 @@ Call a method on a JSValue. This is a convenience method that calls [getProp](Qu #### Returns -`ContextResult`\<[`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 @@ -550,7 +550,7 @@ See [Equality comparisons and sameness](https://developer.mozilla.org/en-US/docs ### evalCode() -> **evalCode**(`code`, `filename`, `options`?): `ContextResult`\<[`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). @@ -594,7 +594,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics. #### Returns -`ContextResult`\<[`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 @@ -671,7 +671,7 @@ Converts `handle` to a Javascript bigint. ### getIterator() -> **getIterator**(`iterableHandle`): `ContextResult`\<`QuickJSIterator`\> +> **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. @@ -693,7 +693,7 @@ for (using entriesHandle of context.getIterator(mapHandle).unwrap()) { #### Returns -`ContextResult`\<`QuickJSIterator`\> +`QuickJSContextResult`\<`QuickJSIterator`\> #### Source @@ -760,7 +760,7 @@ Converts `handle` into a Javascript number. ### getOwnPropertyNames() -> **getOwnPropertyNames**(`handle`, `options`): `ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +> **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), @@ -794,7 +794,7 @@ for (using prop of context.getOwnPropertyNames(objectHandle).unwrap()) { #### Returns -`ContextResult`\<[`DisposableArray`](../exports.md#disposablearrayt)\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`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. @@ -1342,7 +1342,7 @@ No two symbols created with this function will be the same value. ### resolvePromise() -> **resolvePromise**(`promiseLikeHandle`): `Promise`\<`ContextResult`\<[`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 @@ -1356,7 +1356,7 @@ A handle to a Promise-like value with a `.then(onSuccess, onError)` method. #### Returns -`Promise`\<`ContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> +`Promise`\<`QuickJSContextResult`\<[`QuickJSHandle`](../exports.md#quickjshandle)\>\> #### Remarks diff --git a/packages/quickjs-emscripten/src/quickjs.test.ts b/packages/quickjs-emscripten/src/quickjs.test.ts index 04866748..f9fc2336 100644 --- a/packages/quickjs-emscripten/src/quickjs.test.ts +++ b/packages/quickjs-emscripten/src/quickjs.test.ts @@ -1307,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/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index 503b6680..3bc532c0 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -7,8 +7,6 @@ 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 @@ -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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index c9398f20..83d5811d 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -7,8 +7,6 @@ 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 @@ -100,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 ############################################################################### @@ -159,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-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index 6a1fd431..98d6e0ae 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 29d60b2d..10308dc0 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 4aace500..8f80d526 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -7,8 +7,6 @@ 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 @@ -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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index fe329b08..d28a634b 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index ba2108e3..a72cb500 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index de2f1c5a..9cffc527 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index e5f1938e..2e9e6cde 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -7,8 +7,6 @@ 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 @@ -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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 5311976c..27f4f5c1 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index f6830e25..d30fd3ae 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index fed5b654..29680ee7 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index b2146452..faeaecc4 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -7,8 +7,6 @@ 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 @@ -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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index 0a0065d1..1341f156 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index 4381ed25..b92a31fc 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index c28f31d3..c87c13ea 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index afbbc1b7..38276b41 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -7,8 +7,6 @@ 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 @@ -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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 64e740a8..11f43c90 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -7,8 +7,6 @@ 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 @@ -100,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 ############################################################################### @@ -159,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-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index b9ef42a7..9bf233f7 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index c88f8e2d..4445f6e5 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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/templates/Variant.mk b/templates/Variant.mk index a4a57b8b..e3e1584d 100644 --- a/templates/Variant.mk +++ b/templates/Variant.mk @@ -7,8 +7,6 @@ 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 ############################################################################### @@ -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) From 06a83bfe9afd94f1895fc1864f299959d9390ea8 Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 17:11:39 -0400 Subject: [PATCH 42/43] [[ -> [ for docker build --- packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile | 4 ++-- packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile | 4 ++-- .../variant-quickjs-ng-wasmfile-release-asyncify/Makefile | 4 ++-- packages/variant-quickjs-ng-wasmfile-release-sync/Makefile | 4 ++-- .../Makefile | 4 ++-- .../variant-quickjs-singlefile-browser-debug-sync/Makefile | 4 ++-- .../Makefile | 4 ++-- .../variant-quickjs-singlefile-browser-release-sync/Makefile | 4 ++-- .../variant-quickjs-singlefile-cjs-debug-asyncify/Makefile | 4 ++-- packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile | 4 ++-- .../variant-quickjs-singlefile-cjs-release-asyncify/Makefile | 4 ++-- packages/variant-quickjs-singlefile-cjs-release-sync/Makefile | 4 ++-- .../variant-quickjs-singlefile-mjs-debug-asyncify/Makefile | 4 ++-- packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile | 4 ++-- .../variant-quickjs-singlefile-mjs-release-asyncify/Makefile | 4 ++-- packages/variant-quickjs-singlefile-mjs-release-sync/Makefile | 4 ++-- packages/variant-quickjs-wasmfile-debug-asyncify/Makefile | 4 ++-- packages/variant-quickjs-wasmfile-debug-sync/Makefile | 4 ++-- packages/variant-quickjs-wasmfile-release-asyncify/Makefile | 4 ++-- packages/variant-quickjs-wasmfile-release-sync/Makefile | 4 ++-- templates/Variant.mk | 4 ++-- 21 files changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index 3bc532c0..16fa99c8 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -145,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) diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index 83d5811d..ef572faa 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -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) diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index 98d6e0ae..fa97b618 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -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) diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 10308dc0..6f37e049 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -133,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) diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 8f80d526..97ac9d0e 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -146,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) diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index d28a634b..20313d1e 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -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) diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index a72cb500..61068155 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -141,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) diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index 9cffc527..66f97d57 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -134,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) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 2e9e6cde..4fd5522f 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -146,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) diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 27f4f5c1..2d3fd16e 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -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) diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index d30fd3ae..b2c3f5e4 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -141,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) diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index 29680ee7..c29d2205 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -134,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) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index faeaecc4..3137c992 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -146,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) diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index 1341f156..f3fb14a2 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -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) diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index b92a31fc..7e6179a2 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -141,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) diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index c87c13ea..a7548983 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -134,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) diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index 38276b41..64ce94bb 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -145,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) diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 11f43c90..1e379e0b 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -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) diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index 9bf233f7..809201bb 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -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) diff --git a/packages/variant-quickjs-wasmfile-release-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index 4445f6e5..750e7b6c 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -133,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) diff --git a/templates/Variant.mk b/templates/Variant.mk index e3e1584d..2bfcf7e2 100644 --- a/templates/Variant.mk +++ b/templates/Variant.mk @@ -128,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) From a6ca6f4d93ca3f0940d4c9645805ac8bfef7723b Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Sat, 31 Aug 2024 17:18:14 -0400 Subject: [PATCH 43/43] lint --- packages/internal-tsconfig/vite.base.config.mts | 2 +- packages/quickjs-emscripten-core/src/context.ts | 1 - packages/quickjs-emscripten/src/leak.test.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/internal-tsconfig/vite.base.config.mts b/packages/internal-tsconfig/vite.base.config.mts index 261d0cdf..01d7a116 100644 --- a/packages/internal-tsconfig/vite.base.config.mts +++ b/packages/internal-tsconfig/vite.base.config.mts @@ -8,7 +8,7 @@ export default defineConfig({ }, plugins: [tsconfigPaths()], test: { - onStackTrace(error, frame) { + onStackTrace(_error, _frame) { return true }, }, diff --git a/packages/quickjs-emscripten-core/src/context.ts b/packages/quickjs-emscripten-core/src/context.ts index 657b5265..da43fbbd 100644 --- a/packages/quickjs-emscripten-core/src/context.ts +++ b/packages/quickjs-emscripten-core/src/context.ts @@ -14,7 +14,6 @@ import type { 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 diff --git a/packages/quickjs-emscripten/src/leak.test.ts b/packages/quickjs-emscripten/src/leak.test.ts index 4fc880c5..e3d09973 100644 --- a/packages/quickjs-emscripten/src/leak.test.ts +++ b/packages/quickjs-emscripten/src/leak.test.ts @@ -11,7 +11,6 @@ import { } from "." const TEST_LEAK = Boolean(process.env.TEST_LEAK) -const TEST_SLOW = !process.env.TEST_FAST const testOptions = { timeout: Infinity, }