mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Code mode scripts now run on @earendil-works/dquickts 0.2.0 (Bellard's QuickJS compiled to WebAssembly) instead of quickjs-wasi (QuickJS-NG): about 1.3 to 1.9 times faster, with a larger wasm (about 850 KB). - Deep recursion fails with InternalError: stack overflow instead of RangeError; the inline and remote sandboxes allow about 950 calls. - Deterministic runs: the fingerprint names the engine, and Math.random() gives other values for a seed. - Tests: no tool runs after an interrupted async function, and a loop of interrupted async functions ends with a timeout.
11 lines
495 B
TypeScript
11 lines
495 B
TypeScript
import { expect, test, vi } from "vitest";
|
|
import { createCodemodeExtension } from "../src/codemode/codemode.ts";
|
|
|
|
// The extension runs scripts in the sandbox the host passes, so loading it must not load the WASM VM (#11254).
|
|
vi.mock("@earendil-works/dquickts", () => {
|
|
throw new Error("the Code Mode extension loaded @earendil-works/dquickts");
|
|
});
|
|
|
|
test("the Code Mode extension loads without pi-codemode's WASM runtime", () => {
|
|
expect(createCodemodeExtension).toBeTypeOf("function");
|
|
});
|