mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(compile): ensure Deno.build.standalone
is set in workers (#30335)
Closes https://github.com/denoland/deno/issues/30318
This commit is contained in:
parent
038d5a5331
commit
ff8bdcd987
4 changed files with 16 additions and 4 deletions
|
@ -1025,7 +1025,11 @@ function bootstrapWorkerRuntime(
|
|||
6: argv0,
|
||||
7: nodeDebug,
|
||||
13: otelConfig,
|
||||
15: standalone,
|
||||
} = runtimeOptions;
|
||||
|
||||
denoNs.build.standalone = standalone;
|
||||
|
||||
closeOnIdle = runtimeOptions[14];
|
||||
|
||||
performance.setTimeOrigin();
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
"tests": {
|
||||
"compiled": {
|
||||
"steps": [{
|
||||
"args": "compile --output main main.ts",
|
||||
"args": "compile --allow-read --output main --include worker.ts main.ts",
|
||||
"output": "[WILDCARD]"
|
||||
}, {
|
||||
"commandName": "./main",
|
||||
"args": [],
|
||||
"output": "true\n"
|
||||
"output": "true\ntrue\n"
|
||||
}]
|
||||
},
|
||||
"run": {
|
||||
"args": "run --quiet --check main.ts",
|
||||
"output": "false\n"
|
||||
"args": "run --quiet --check --allow-read main.ts",
|
||||
"output": "false\nfalse\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,6 @@
|
|||
const value: boolean = Deno.build.standalone;
|
||||
console.log(value);
|
||||
|
||||
new Worker(import.meta.resolve("./worker.ts"), {
|
||||
"type": "module",
|
||||
});
|
||||
|
|
4
tests/specs/compile/deno_build_standalone/worker.ts
Normal file
4
tests/specs/compile/deno_build_standalone/worker.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
// ensure this is properly set in a worker
|
||||
const value: boolean = Deno.build.standalone;
|
||||
console.log(value);
|
||||
self.close();
|
Loading…
Add table
Add a link
Reference in a new issue