quickjs-emscripten-sync 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -2
- package/dist/quickjs-emscripten-sync.mjs +590 -450
- package/dist/quickjs-emscripten-sync.umd.js +17 -10
- package/package.json +6 -6
- package/src/contextex.test.ts +43 -0
- package/src/contextex.ts +65 -0
- package/src/edge.test.ts +70 -0
- package/src/index.test.ts +36 -39
- package/src/index.ts +6 -2
- package/src/marshal/index.test.ts +2 -2
- package/src/vmmap.ts +1 -1
- package/src/wrapper.ts +44 -32
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { QuickJSContext } from 'quickjs-emscripten';
|
|
2
2
|
import type { QuickJSDeferredPromise } from 'quickjs-emscripten';
|
|
3
3
|
import type { QuickJSHandle } from 'quickjs-emscripten';
|
|
4
4
|
import type { SuccessOrFail } from 'quickjs-emscripten';
|
|
@@ -8,7 +8,7 @@ import type { VmCallResult } from 'quickjs-emscripten';
|
|
|
8
8
|
* The Arena class manages all generated handles at once by quickjs-emscripten and automatically converts objects between the host and the QuickJS VM.
|
|
9
9
|
*/
|
|
10
10
|
export declare class Arena {
|
|
11
|
-
context:
|
|
11
|
+
context: QuickJSContextEx;
|
|
12
12
|
_map: VMMap;
|
|
13
13
|
_registeredMap: VMMap;
|
|
14
14
|
_registeredMapDispose: Set<any>;
|
|
@@ -129,6 +129,8 @@ export declare type Options = {
|
|
|
129
129
|
isHandleWrappable?: (handle: QuickJSHandle, ctx: QuickJSContext) => boolean;
|
|
130
130
|
/** Compatibility with quickjs-emscripten prior to v0.15. Inject code for compatibility into context at Arena class initialization time. */
|
|
131
131
|
compat?: boolean;
|
|
132
|
+
/** Experimental: use QuickJSContextEx, which wraps existing QuickJSContext. */
|
|
133
|
+
experimentalContextEx?: boolean;
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
declare type Options_2 = {
|
|
@@ -150,6 +152,10 @@ declare type Options_3 = {
|
|
|
150
152
|
custom?: Iterable<(obj: QuickJSHandle, ctx: QuickJSContext) => any>;
|
|
151
153
|
};
|
|
152
154
|
|
|
155
|
+
declare type QuickJSContextEx = QuickJSContext & {
|
|
156
|
+
disposeEx?: () => void;
|
|
157
|
+
};
|
|
158
|
+
|
|
153
159
|
export declare function unmarshal(handle: QuickJSHandle, options: Options_3): any;
|
|
154
160
|
|
|
155
161
|
export declare class VMMap {
|