MCPcopy Create free account
hub / github.com/zxlie/FeHelper / loadRuntime

Function loadRuntime

test/dynamic-runtime.test.js:9–20  ·  view source on GitHub ↗
(overrides = {})

Source from the content-addressed store, hash-verified

7const runtimeSource = fs.readFileSync(runtimePath, 'utf8');
8
9function loadRuntime(overrides = {}) {
10 const sandbox = {
11 console,
12 globalThis: null,
13 window: null,
14 ...overrides
15 };
16 sandbox.globalThis = sandbox;
17 sandbox.window = sandbox.window || sandbox;
18 vm.runInNewContext(runtimeSource, sandbox, { filename: runtimePath });
19 return sandbox.window.FHDynamicRuntime;
20}
21
22describe('dynamic runtime developer support', () => {
23 function createNativeFunction(context = {}) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected