Skip to content

Commit 6f7cf37

Browse files
committed
Deno workarounds for deno 2
1 parent 31d5b63 commit 6f7cf37

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @ts-expect-error re-add window global for existing libraries
2+
globalThis.window = globalThis;
3+
// @ts-expect-error remove global process so that vireo module does not detect as a node env
4+
globalThis.process = undefined;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './restore-globals.ts';
12
import { runViaCodeLines } from "./runtime-helper.ts";
23

34
await runViaCodeLines(['start(dv(VirtualInstrument (clump(Println("Hello, sky. I can fly")))))']);

Deno/Support/convert-html.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function createContent (extractedUrls: ExtractedUrls, viaCode: string) {
2929
.join('\n');
3030
const viaCodeLines = JSON.stringify(viaCode.split('\n'), undefined, 4);
3131
const mainTemplate = `
32+
import '${extractedUrls.relativePathToRoot}../../Library/Support/Runtime/restore-globals.ts';
3233
${formattedScriptSources}
3334
import { runViaCodeLines } from '${extractedUrls.relativePathToRoot}../../Library/Support/Runtime/runtime-helper.ts';
3435
await runViaCodeLines(viaCodeLines());

0 commit comments

Comments
 (0)