Skip to content

Commit b7537b4

Browse files
committed
extract body to src/
1 parent 0599027 commit b7537b4

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

main.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
import { ensureDirSync } from "@std/fs";
2-
if (import.meta.main) {
3-
const w = new Worker(import.meta.resolve("./worker.ts"), {
4-
type: "module",
5-
});
6-
7-
try {
8-
ensureDirSync("foo/bar/baz/omg");
9-
throw new Error(
10-
"this will not be logged if compiled\nfor windows on deno v2.1.5",
11-
);
12-
} catch (err) {
13-
console.error(err as Error);
14-
}
1+
import { denoCompileWinError } from "./src/deno-compile-win-error.ts";
152

16-
w.postMessage("worker I am trapped in a computer please elp");
3+
if (import.meta.main) {
4+
await denoCompileWinError();
175
}

src/deno-compile-win-error.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ensureDir } from "@std/fs";
2+
3+
export async function denoCompileWinError() {
4+
const w = new Worker(import.meta.resolve("src/worker.ts"), {
5+
type: "module",
6+
});
7+
8+
try {
9+
await ensureDir("foo/bar/baz/omg");
10+
throw new Error(
11+
"this will not be logged if compiled\nfor windows on deno v2.1.5",
12+
);
13+
} catch (err) {
14+
console.error(err as Error);
15+
}
16+
17+
w.postMessage("worker I am trapped in a computer please elp");
18+
}
File renamed without changes.

0 commit comments

Comments
 (0)