diff --git a/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md b/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md index f604697c..d87401a9 100644 --- a/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md +++ b/doc/@jitl/quickjs-asmjs-mjs-release-sync/README.md @@ -80,8 +80,7 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s WASM=0", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=32MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md index 1c128bbc..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 5MB", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md b/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md index dd47a4b7..beeca5e2 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md @@ -94,7 +94,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 5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/doc/@jitl/quickjs-ng-wasmfile-release-asyncify/README.md b/doc/@jitl/quickjs-ng-wasmfile-release-asyncify/README.md index 34ca85a1..1384d2cc 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-release-asyncify/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-release-asyncify/README.md @@ -97,8 +97,7 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s 5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/doc/@jitl/quickjs-ng-wasmfile-release-sync/README.md b/doc/@jitl/quickjs-ng-wasmfile-release-sync/README.md index 174b1e5f..f274ae8f 100644 --- a/doc/@jitl/quickjs-ng-wasmfile-release-sync/README.md +++ b/doc/@jitl/quickjs-ng-wasmfile-release-sync/README.md @@ -90,8 +90,7 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s 5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-browser-debug-asyncify/README.md index c5970af0..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 5MB", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md index e589e840..01563189 100644 --- a/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-debug-sync/README.md @@ -83,7 +83,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s 5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/doc/@jitl/quickjs-singlefile-browser-release-asyncify/README.md b/doc/@jitl/quickjs-singlefile-browser-release-asyncify/README.md index 232af59d..36cd5931 100644 --- a/doc/@jitl/quickjs-singlefile-browser-release-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-release-asyncify/README.md @@ -86,8 +86,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-browser-release-sync/README.md b/doc/@jitl/quickjs-singlefile-browser-release-sync/README.md index 8945458b..63480bc7 100644 --- a/doc/@jitl/quickjs-singlefile-browser-release-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-browser-release-sync/README.md @@ -79,8 +79,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/README.md index 2526d1c5..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 5MB", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md index 82581951..2f70a692 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-debug-sync/README.md @@ -83,7 +83,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s 5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/doc/@jitl/quickjs-singlefile-cjs-release-asyncify/README.md b/doc/@jitl/quickjs-singlefile-cjs-release-asyncify/README.md index c750703e..46778d06 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-release-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-release-asyncify/README.md @@ -86,8 +86,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-cjs-release-sync/README.md b/doc/@jitl/quickjs-singlefile-cjs-release-sync/README.md index 8bcf43ea..830ed202 100644 --- a/doc/@jitl/quickjs-singlefile-cjs-release-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-cjs-release-sync/README.md @@ -79,8 +79,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md b/doc/@jitl/quickjs-singlefile-mjs-debug-asyncify/README.md index e7f0fdc2..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 5MB", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md b/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md index 0d50ab6d..7cb244b7 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-debug-sync/README.md @@ -83,7 +83,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s 5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/doc/@jitl/quickjs-singlefile-mjs-release-asyncify/README.md b/doc/@jitl/quickjs-singlefile-mjs-release-asyncify/README.md index af6798e9..4e8e77f0 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-release-asyncify/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-release-asyncify/README.md @@ -86,8 +86,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-singlefile-mjs-release-sync/README.md b/doc/@jitl/quickjs-singlefile-mjs-release-sync/README.md index 7793c0f1..c1f99406 100644 --- a/doc/@jitl/quickjs-singlefile-mjs-release-sync/README.md +++ b/doc/@jitl/quickjs-singlefile-mjs-release-sync/README.md @@ -79,8 +79,7 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s 5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md b/doc/@jitl/quickjs-wasmfile-debug-asyncify/README.md index b8d3399d..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 5MB", "-O3" ] ``` diff --git a/doc/@jitl/quickjs-wasmfile-debug-sync/README.md b/doc/@jitl/quickjs-wasmfile-debug-sync/README.md index 2869189e..b54dfe0e 100644 --- a/doc/@jitl/quickjs-wasmfile-debug-sync/README.md +++ b/doc/@jitl/quickjs-wasmfile-debug-sync/README.md @@ -94,7 +94,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 5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/doc/@jitl/quickjs-wasmfile-release-asyncify/README.md b/doc/@jitl/quickjs-wasmfile-release-asyncify/README.md index 91ecd840..3e85eec7 100644 --- a/doc/@jitl/quickjs-wasmfile-release-asyncify/README.md +++ b/doc/@jitl/quickjs-wasmfile-release-asyncify/README.md @@ -97,8 +97,7 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s 5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/doc/@jitl/quickjs-wasmfile-release-sync/README.md b/doc/@jitl/quickjs-wasmfile-release-sync/README.md index 179daca1..0f5cb10b 100644 --- a/doc/@jitl/quickjs-wasmfile-release-sync/README.md +++ b/doc/@jitl/quickjs-wasmfile-release-sync/README.md @@ -90,8 +90,7 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s 5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/doc/quickjs-emscripten-core/README.md b/doc/quickjs-emscripten-core/README.md index 52802552..ba1cb0c9 100644 --- a/doc/quickjs-emscripten-core/README.md +++ b/doc/quickjs-emscripten-core/README.md @@ -368,7 +368,7 @@ Compiled to pure Javascript, no WebAssembly required. | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | | releaseMode | release | Optimized for performance; use when building/deploying your application. | | syncMode | sync | The default, normal build. Note that both variants support regular async functions. | -| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | +| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | | exports | import | Has these package.json export conditions | *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md index a3d6469a..754d4bc9 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSAsyncContext.md @@ -389,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -505,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -643,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1611,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten-core/classes/QuickJSContext.md b/doc/quickjs-emscripten-core/classes/QuickJSContext.md index a759d044..bf3f1ad7 100644 --- a/doc/quickjs-emscripten-core/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten-core/classes/QuickJSContext.md @@ -409,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -521,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -625,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1469,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten-core/exports.md b/doc/quickjs-emscripten-core/exports.md index c328efd2..51df2323 100644 --- a/doc/quickjs-emscripten-core/exports.md +++ b/doc/quickjs-emscripten-core/exports.md @@ -237,7 +237,7 @@ by the runtime. ### InterruptHandler -> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` +> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` \| `void` Callback called regularly while the VM executes code. Determines if a VM's execution should be interrupted. @@ -248,7 +248,7 @@ Determines if a VM's execution should be interrupted. #### Returns -`boolean` \| `undefined` +`boolean` \| `undefined` \| `void` `true` to interrupt JS execution inside the VM. diff --git a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnwrapError.md b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnwrapError.md index 69367ca2..107581ae 100644 --- a/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnwrapError.md +++ b/doc/quickjs-emscripten-core/namespaces/errors/classes/QuickJSUnwrapError.md @@ -12,10 +12,9 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md - [Extends](QuickJSUnwrapError.md#extends) - [Constructors](QuickJSUnwrapError.md#constructors) - - [new QuickJSUnwrapError(cause, context)](QuickJSUnwrapError.md#new-quickjsunwraperrorcause-context) + - [new QuickJSUnwrapError(cause)](QuickJSUnwrapError.md#new-quickjsunwraperrorcause) - [Properties](QuickJSUnwrapError.md#properties) - [cause](QuickJSUnwrapError.md#cause) - - [context?](QuickJSUnwrapError.md#context) - [name](QuickJSUnwrapError.md#name) ## Extends @@ -24,16 +23,14 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md ## Constructors -### new QuickJSUnwrapError(cause, context) +### new QuickJSUnwrapError(cause) -> **new QuickJSUnwrapError**(`cause`, `context`?): [`QuickJSUnwrapError`](QuickJSUnwrapError.md) +> **new QuickJSUnwrapError**(`cause`): [`QuickJSUnwrapError`](QuickJSUnwrapError.md) #### Parameters • **cause**: `unknown` -• **context?**: [`QuickJSContext`](../../../classes/QuickJSContext.md) - #### Returns [`QuickJSUnwrapError`](QuickJSUnwrapError.md) @@ -58,16 +55,6 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md *** -### 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"` diff --git a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md index 9ddba201..d5fdcc5b 100644 --- a/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md @@ -389,7 +389,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -505,7 +505,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -643,7 +643,7 @@ See [EvalFlags](../exports.md#evalflags) for number semantics #### Source -[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1611,7 +1611,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten/classes/QuickJSContext.md b/doc/quickjs-emscripten/classes/QuickJSContext.md index 7bcf5952..00d400b9 100644 --- a/doc/quickjs-emscripten/classes/QuickJSContext.md +++ b/doc/quickjs-emscripten/classes/QuickJSContext.md @@ -409,7 +409,7 @@ socket.on("data", chunk => { #### Source -[packages/quickjs-emscripten-core/src/context.ts:1423](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1423) +[packages/quickjs-emscripten-core/src/context.ts:1431](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1431) *** @@ -521,7 +521,7 @@ socket.write(dataLifetime?.value) #### Source -[packages/quickjs-emscripten-core/src/context.ts:1406](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1406) +[packages/quickjs-emscripten-core/src/context.ts:1414](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1414) *** @@ -625,7 +625,7 @@ interrupted, the error will have name `InternalError` and message #### Source -[packages/quickjs-emscripten-core/src/context.ts:1432](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1432) +[packages/quickjs-emscripten-core/src/context.ts:1440](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1440) *** @@ -1469,7 +1469,7 @@ properties. #### Source -[packages/quickjs-emscripten-core/src/context.ts:1428](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1428) +[packages/quickjs-emscripten-core/src/context.ts:1436](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-emscripten-core/src/context.ts#L1436) *** diff --git a/doc/quickjs-emscripten/exports.md b/doc/quickjs-emscripten/exports.md index ad64d4e4..fc574efb 100644 --- a/doc/quickjs-emscripten/exports.md +++ b/doc/quickjs-emscripten/exports.md @@ -251,7 +251,7 @@ by the runtime. ### InterruptHandler -> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` +> **InterruptHandler**: (`runtime`) => `boolean` \| `undefined` \| `void` Callback called regularly while the VM executes code. Determines if a VM's execution should be interrupted. @@ -262,7 +262,7 @@ Determines if a VM's execution should be interrupted. #### Returns -`boolean` \| `undefined` +`boolean` \| `undefined` \| `void` `true` to interrupt JS execution inside the VM. diff --git a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md index 2b7e83e1..085c7c0e 100644 --- a/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md +++ b/doc/quickjs-emscripten/namespaces/errors/classes/QuickJSUnwrapError.md @@ -12,10 +12,9 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md - [Extends](QuickJSUnwrapError.md#extends) - [Constructors](QuickJSUnwrapError.md#constructors) - - [new QuickJSUnwrapError(cause, context)](QuickJSUnwrapError.md#new-quickjsunwraperrorcause-context) + - [new QuickJSUnwrapError(cause)](QuickJSUnwrapError.md#new-quickjsunwraperrorcause) - [Properties](QuickJSUnwrapError.md#properties) - [cause](QuickJSUnwrapError.md#cause) - - [context?](QuickJSUnwrapError.md#context) - [name](QuickJSUnwrapError.md#name) ## Extends @@ -24,16 +23,14 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md ## Constructors -### new QuickJSUnwrapError(cause, context) +### new QuickJSUnwrapError(cause) -> **new QuickJSUnwrapError**(`cause`, `context`?): [`QuickJSUnwrapError`](QuickJSUnwrapError.md) +> **new QuickJSUnwrapError**(`cause`): [`QuickJSUnwrapError`](QuickJSUnwrapError.md) #### Parameters • **cause**: `unknown` -• **context?**: [`QuickJSContext`](../../../classes/QuickJSContext.md) - #### Returns [`QuickJSUnwrapError`](QuickJSUnwrapError.md) @@ -58,16 +55,6 @@ Error thrown if [QuickJSContext#unwrapResult](../../../classes/QuickJSContext.md *** -### 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"` diff --git a/packages/quickjs-emscripten-core/README.md b/packages/quickjs-emscripten-core/README.md index 040f4414..8bd5dd5c 100644 --- a/packages/quickjs-emscripten-core/README.md +++ b/packages/quickjs-emscripten-core/README.md @@ -337,5 +337,5 @@ Compiled to pure Javascript, no WebAssembly required. | library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. Version [2024-02-14+36911f0d](https://github.com/bellard/quickjs/commit/36911f0d3ab1a4c190a4d5cbe7c2db225a455389) vendored to quickjs-emscripten on 2024-06-15. | | releaseMode | release | Optimized for performance; use when building/deploying your application. | | syncMode | sync | The default, normal build. Note that both variants support regular async functions. | -| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | +| emscriptenInclusion | asmjs | The C library code is compiled to Javascript, no WebAssembly used. Sometimes called "asmjs". This is the slowest possible option, and is intended for constrained environments that do not support WebAssembly, like quickjs-for-quickjs. | | exports | import | Has these package.json export conditions | diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile b/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile index 27beabdd..9c361420 100644 --- a/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/Makefile @@ -79,8 +79,6 @@ CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s WASM=0 CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=32MB -CFLAGS_WASM+=-s INITIAL_MEMORY=64MB CFLAGS_MJS+=-s ENVIRONMENT=web,worker,node diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/README.md b/packages/variant-quickjs-asmjs-mjs-release-sync/README.md index 5792de20..8d648b7f 100644 --- a/packages/variant-quickjs-asmjs-mjs-release-sync/README.md +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/README.md @@ -67,8 +67,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s WASM=0", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=32MB", - "-s INITIAL_MEMORY=64MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-asmjs-mjs-release-sync/package.json b/packages/variant-quickjs-asmjs-mjs-release-sync/package.json index 444224ef..18f33659 100644 --- a/packages/variant-quickjs-asmjs-mjs-release-sync/package.json +++ b/packages/variant-quickjs-asmjs-mjs-release-sync/package.json @@ -36,11 +36,6 @@ "default": "./dist/index.mjs" }, "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "default": "./dist/ffi.mjs" - }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", "import": "./dist/emscripten-module.mjs", diff --git a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile index 866b4597..0c7b8510 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-asyncify/Makefile @@ -87,7 +87,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 STACK_SIZE=5MB 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 2e1d11ca..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 STACK_SIZE=5MB", "-O3" ] ``` diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile index 97612ae0..4ed5ea56 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/Makefile @@ -80,7 +80,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 STACK_SIZE=5MB CFLAGS_WASM+=-DQTS_SANITIZE_LEAK CFLAGS_WASM+=-fsanitize=leak CFLAGS_WASM+=-g2 diff --git a/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md b/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md index d4823759..c3e762f9 100644 --- a/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md +++ b/packages/variant-quickjs-ng-wasmfile-debug-sync/README.md @@ -81,7 +81,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 STACK_SIZE=5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile index 9ba254ba..f19d7c40 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/Makefile @@ -84,7 +84,6 @@ CFLAGS_WASM+=--closure 1 CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-ng-wasmfile-release-asyncify/README.md b/packages/variant-quickjs-ng-wasmfile-release-asyncify/README.md index fac26c00..6624c67a 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-asyncify/README.md +++ b/packages/variant-quickjs-ng-wasmfile-release-asyncify/README.md @@ -84,7 +84,6 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s STACK_SIZE=5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile index 820ffaca..9fdbb5e2 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/Makefile @@ -77,7 +77,6 @@ CFLAGS_WASM+=--closure 1 CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-ng-wasmfile-release-sync/README.md b/packages/variant-quickjs-ng-wasmfile-release-sync/README.md index 6152549b..cb980f8b 100644 --- a/packages/variant-quickjs-ng-wasmfile-release-sync/README.md +++ b/packages/variant-quickjs-ng-wasmfile-release-sync/README.md @@ -77,7 +77,6 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s STACK_SIZE=5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile index 28db52c7..0220c700 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-asyncify/Makefile @@ -88,7 +88,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 STACK_SIZE=5MB 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 cd112c4c..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 STACK_SIZE=5MB", "-O3" ] ``` diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile index 7c519dab..99753be5 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/Makefile @@ -81,7 +81,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 STACK_SIZE=5MB CFLAGS_WASM+=-DQTS_SANITIZE_LEAK CFLAGS_WASM+=-fsanitize=leak CFLAGS_WASM+=-g2 diff --git a/packages/variant-quickjs-singlefile-browser-debug-sync/README.md b/packages/variant-quickjs-singlefile-browser-debug-sync/README.md index f4038c68..47cabbbc 100644 --- a/packages/variant-quickjs-singlefile-browser-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-browser-debug-sync/README.md @@ -70,7 +70,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile index a2ec0c4e..7b621a43 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/Makefile @@ -85,7 +85,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-singlefile-browser-release-asyncify/README.md b/packages/variant-quickjs-singlefile-browser-release-asyncify/README.md index a8286b9b..18e25022 100644 --- a/packages/variant-quickjs-singlefile-browser-release-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-browser-release-asyncify/README.md @@ -73,7 +73,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile index a2945c15..c26d0df3 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-browser-release-sync/Makefile @@ -78,7 +78,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-singlefile-browser-release-sync/README.md b/packages/variant-quickjs-singlefile-browser-release-sync/README.md index 6092d13b..1c708546 100644 --- a/packages/variant-quickjs-singlefile-browser-release-sync/README.md +++ b/packages/variant-quickjs-singlefile-browser-release-sync/README.md @@ -66,7 +66,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile index 2d4a2e5d..3d1bc746 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-asyncify/Makefile @@ -88,7 +88,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 STACK_SIZE=5MB 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 b44c5714..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 STACK_SIZE=5MB", "-O3" ] ``` diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile index 898fe3dc..8736d1ca 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/Makefile @@ -81,7 +81,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 STACK_SIZE=5MB CFLAGS_WASM+=-DQTS_SANITIZE_LEAK CFLAGS_WASM+=-fsanitize=leak CFLAGS_WASM+=-g2 diff --git a/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md b/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md index d48fb303..ffc735a7 100644 --- a/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-cjs-debug-sync/README.md @@ -70,7 +70,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile index a4e0522b..1a9147ff 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/Makefile @@ -85,7 +85,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=web,worker,node diff --git a/packages/variant-quickjs-singlefile-cjs-release-asyncify/README.md b/packages/variant-quickjs-singlefile-cjs-release-asyncify/README.md index c6733518..532103c9 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-cjs-release-asyncify/README.md @@ -73,7 +73,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile index eb5eff28..420d3e11 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/Makefile @@ -78,7 +78,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=web,worker,node diff --git a/packages/variant-quickjs-singlefile-cjs-release-sync/README.md b/packages/variant-quickjs-singlefile-cjs-release-sync/README.md index f2b9c3e1..e85c6210 100644 --- a/packages/variant-quickjs-singlefile-cjs-release-sync/README.md +++ b/packages/variant-quickjs-singlefile-cjs-release-sync/README.md @@ -66,7 +66,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile index 2a9142f3..35d57242 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-asyncify/Makefile @@ -88,7 +88,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 STACK_SIZE=5MB 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 d9aefe7b..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 STACK_SIZE=5MB", "-O3" ] ``` diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile index 5fa52d50..047b64a1 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/Makefile @@ -81,7 +81,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 STACK_SIZE=5MB CFLAGS_WASM+=-DQTS_SANITIZE_LEAK CFLAGS_WASM+=-fsanitize=leak CFLAGS_WASM+=-g2 diff --git a/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md b/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md index 6c39525d..a8380376 100644 --- a/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md +++ b/packages/variant-quickjs-singlefile-mjs-debug-sync/README.md @@ -70,7 +70,6 @@ Variant-specific Emscripten build flags: "--pre-js $(TEMPLATES)/pre-wasmOffsetConverter.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile index df264ef4..3bc6fe6d 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/Makefile @@ -85,7 +85,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_MJS+=-s ENVIRONMENT=node diff --git a/packages/variant-quickjs-singlefile-mjs-release-asyncify/README.md b/packages/variant-quickjs-singlefile-mjs-release-asyncify/README.md index c1d8cb44..d6b327d4 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-asyncify/README.md +++ b/packages/variant-quickjs-singlefile-mjs-release-asyncify/README.md @@ -73,7 +73,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile index 486066ae..cb82ebb1 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/Makefile @@ -78,7 +78,6 @@ CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js CFLAGS_WASM+=-s SINGLE_FILE=1 -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_MJS+=-s ENVIRONMENT=node diff --git a/packages/variant-quickjs-singlefile-mjs-release-sync/README.md b/packages/variant-quickjs-singlefile-mjs-release-sync/README.md index 02025285..1a1801c2 100644 --- a/packages/variant-quickjs-singlefile-mjs-release-sync/README.md +++ b/packages/variant-quickjs-singlefile-mjs-release-sync/README.md @@ -66,7 +66,6 @@ Variant-specific Emscripten build flags: "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s SINGLE_FILE=1", - "-s STACK_SIZE=5MB" + "-s SINGLE_FILE=1" ] ``` diff --git a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile index 6b75427e..6cfd4321 100644 --- a/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-asyncify/Makefile @@ -87,7 +87,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 STACK_SIZE=5MB 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 fbbb8520..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 STACK_SIZE=5MB", "-O3" ] ``` diff --git a/packages/variant-quickjs-wasmfile-debug-sync/Makefile b/packages/variant-quickjs-wasmfile-debug-sync/Makefile index 23c353c6..415ec9b8 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-debug-sync/Makefile @@ -80,7 +80,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 STACK_SIZE=5MB CFLAGS_WASM+=-DQTS_SANITIZE_LEAK CFLAGS_WASM+=-fsanitize=leak CFLAGS_WASM+=-g2 diff --git a/packages/variant-quickjs-wasmfile-debug-sync/README.md b/packages/variant-quickjs-wasmfile-debug-sync/README.md index 15b114be..57a672a7 100644 --- a/packages/variant-quickjs-wasmfile-debug-sync/README.md +++ b/packages/variant-quickjs-wasmfile-debug-sync/README.md @@ -81,7 +81,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 STACK_SIZE=5MB", "-DQTS_SANITIZE_LEAK", "-fsanitize=leak", "-g2" diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile index bce631db..f2559296 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/Makefile +++ b/packages/variant-quickjs-wasmfile-release-asyncify/Makefile @@ -84,7 +84,6 @@ CFLAGS_WASM+=--closure 1 CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-wasmfile-release-asyncify/README.md b/packages/variant-quickjs-wasmfile-release-asyncify/README.md index 0383ff66..0f41e6cf 100644 --- a/packages/variant-quickjs-wasmfile-release-asyncify/README.md +++ b/packages/variant-quickjs-wasmfile-release-asyncify/README.md @@ -84,7 +84,6 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s STACK_SIZE=5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/packages/variant-quickjs-wasmfile-release-sync/Makefile b/packages/variant-quickjs-wasmfile-release-sync/Makefile index 3903fa6d..4dd86c44 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/Makefile +++ b/packages/variant-quickjs-wasmfile-release-sync/Makefile @@ -77,7 +77,6 @@ CFLAGS_WASM+=--closure 1 CFLAGS_WASM+=-s FILESYSTEM=0 CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-extension.js CFLAGS_WASM+=--pre-js $(TEMPLATES)/pre-wasmMemory.js -CFLAGS_WASM+=-s STACK_SIZE=5MB CFLAGS_CJS+=-s ENVIRONMENT=node CFLAGS_MJS+=-s ENVIRONMENT=node CFLAGS_BROWSER+=-s ENVIRONMENT=web,worker diff --git a/packages/variant-quickjs-wasmfile-release-sync/README.md b/packages/variant-quickjs-wasmfile-release-sync/README.md index 3ca74479..a95a36fb 100644 --- a/packages/variant-quickjs-wasmfile-release-sync/README.md +++ b/packages/variant-quickjs-wasmfile-release-sync/README.md @@ -77,7 +77,6 @@ Variant-specific Emscripten build flags: "--closure 1", "-s FILESYSTEM=0", "--pre-js $(TEMPLATES)/pre-extension.js", - "--pre-js $(TEMPLATES)/pre-wasmMemory.js", - "-s STACK_SIZE=5MB" + "--pre-js $(TEMPLATES)/pre-wasmMemory.js" ] ``` diff --git a/scripts/prepareVariants.ts b/scripts/prepareVariants.ts index 6c52ba03..7854060f 100755 --- a/scripts/prepareVariants.ts +++ b/scripts/prepareVariants.ts @@ -365,7 +365,12 @@ async function main() { main: js ? "./dist/index.js" : "./dist/index.mjs", module: mjs ? "./dist/index.mjs" : undefined, } - + const ffiExports = { + types: "./dist/ffi.d.ts", + import: mjs ? "./dist/ffi.mjs" : "./dist/ffi.js", + require: js ? "./dist/ffi.js" : undefined, + default: js ? "./dist/ffi.js" : "./dist/ffi.mjs", + } const emscriptenExports = { types: variant.exports.browser ? "./dist/emscripten-module.browser.d.ts" @@ -422,12 +427,8 @@ async function main() { default: indexExports.main, }, "./package.json": "./package.json", - "./ffi": { - types: "./dist/ffi.d.ts", - import: mjs ? "./dist/ffi.mjs" : "./dist/ffi.js", - require: js ? "./dist/ffi.js" : undefined, - default: js ? "./dist/ffi.js" : "./dist/ffi.mjs", - }, + "./ffi": + variant.emscriptenInclusion !== EmscriptenInclusion.AsmJs ? ffiExports : undefined, "./wasm": variant.emscriptenInclusion === EmscriptenInclusion.Separate ? "./dist/emscripten-module.wasm" diff --git a/variants.json b/variants.json index 9d3869f8..e5cdcf64 100644 --- a/variants.json +++ b/variants.json @@ -1214,11 +1214,6 @@ "default": "./dist/index.mjs" }, "./package.json": "./package.json", - "./ffi": { - "types": "./dist/ffi.d.ts", - "import": "./dist/ffi.mjs", - "default": "./dist/ffi.mjs" - }, "./emscripten-module": { "types": "./dist/emscripten-module.d.ts", "import": "./dist/emscripten-module.mjs",