feat: use compileStreaming when loading wasm parsers

This commit is contained in:
Boris Verkhovskiy 2025-09-01 20:08:20 -06:00 committed by GitHub
parent b75196bb81
commit 9b23cd5394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 27 deletions

View file

@ -11,13 +11,11 @@ declare namespace RuntimeExports {
* maximum number of bytes to read. You can omit this parameter to scan the
* string until the first 0 byte. If maxBytesToRead is passed, and the string
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
* string will cut short at that byte index (i.e. maxBytesToRead will not
* produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
* frequent uses of UTF8ToString() with and without maxBytesToRead may throw
* JS JIT optimizations off, so it is worth to consider consistently using one
* string will cut short at that byte index.
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
* @return {string}
*/
function UTF8ToString(ptr: number, maxBytesToRead?: number): string;
function UTF8ToString(ptr: number, maxBytesToRead?: number | undefined, ignoreNul?: boolean | undefined): string;
function lengthBytesUTF8(str: string): number;
function stringToUTF16(str: string, outPtr: number, maxBytesToWrite: number): number;
/**
@ -25,7 +23,7 @@ declare namespace RuntimeExports {
* @param {Object=} localScope
* @param {number=} handle
*/
function loadWebAssemblyModule(binary: Uint8Array, flags: Record<string, boolean>, libName?: string, localScope?: Record<string, unknown>, handle?: number): Promise<Record<string, () => number>>;
function loadWebAssemblyModule(binary: Uint8Array | WebAssembly.Module, flags: Record<string, boolean>, libName?: string, localScope?: Record<string, unknown>, handle?: number): Promise<Record<string, () => number>>;
/**
* @param {number} ptr
* @param {string} type