mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
* Compile Effect generators statically * test: declare the dormant array write's expected fence
13 lines
437 B
JavaScript
13 lines
437 B
JavaScript
import { read } from "./remote.js";
|
|
const key = "scriptc.test.string-cache";
|
|
let count = 0;
|
|
function compute() { count++; return new Map(); }
|
|
globalThis[key] ??= compute();
|
|
globalThis[key] ??= compute();
|
|
const cache = globalThis[key];
|
|
cache.set("message", "hello");
|
|
console.log(count, read() === cache, read().get("message"));
|
|
const host = globalThis;
|
|
host["scriptc.test.string-cache"] = "changed";
|
|
console.log(globalThis[key], read());
|