Skip to content

Commit 64b56b8

Browse files
committed
homedir + async
1 parent b0bc22c commit 64b56b8

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

src/deno-compile-win-error.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
import { ensureDirSync } from "@std/fs";
1+
// import { ensureDirSync } from "@std/fs";
22
import { homedir } from "node:os";
3-
import * as path from "@std/path";
3+
// import * as path from "@std/path";
44
import { delay } from "@std/async";
55

66
export async function denoCompileWinError() {
77
await delay(1);
88
const home = homedir();
9-
const whereTheProblemsAre = path.join(home, "problematic");
10-
11-
const w = new Worker(import.meta.resolve("src/worker.ts"), {
12-
type: "module",
13-
});
14-
15-
try {
16-
ensureDirSync(whereTheProblemsAre);
17-
18-
throw new Error(
19-
"this will not be logged if compiled\nfor windows on deno v2.1.5",
20-
);
21-
} catch (err) {
22-
console.error(err as Error);
9+
if (home) {
10+
console.log(`This will not be printed when compiled for windows`);
2311
}
24-
25-
w.postMessage("worker I am trapped in a computer please elp");
2612
}

0 commit comments

Comments
 (0)