mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +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,
|
6: argv0,
|
||||||
7: nodeDebug,
|
7: nodeDebug,
|
||||||
13: otelConfig,
|
13: otelConfig,
|
||||||
|
15: standalone,
|
||||||
} = runtimeOptions;
|
} = runtimeOptions;
|
||||||
|
|
||||||
|
denoNs.build.standalone = standalone;
|
||||||
|
|
||||||
closeOnIdle = runtimeOptions[14];
|
closeOnIdle = runtimeOptions[14];
|
||||||
|
|
||||||
performance.setTimeOrigin();
|
performance.setTimeOrigin();
|
||||||
|
|
|
@ -3,17 +3,17 @@
|
||||||
"tests": {
|
"tests": {
|
||||||
"compiled": {
|
"compiled": {
|
||||||
"steps": [{
|
"steps": [{
|
||||||
"args": "compile --output main main.ts",
|
"args": "compile --allow-read --output main --include worker.ts main.ts",
|
||||||
"output": "[WILDCARD]"
|
"output": "[WILDCARD]"
|
||||||
}, {
|
}, {
|
||||||
"commandName": "./main",
|
"commandName": "./main",
|
||||||
"args": [],
|
"args": [],
|
||||||
"output": "true\n"
|
"output": "true\ntrue\n"
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"run": {
|
"run": {
|
||||||
"args": "run --quiet --check main.ts",
|
"args": "run --quiet --check --allow-read main.ts",
|
||||||
"output": "false\n"
|
"output": "false\nfalse\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
const value: boolean = Deno.build.standalone;
|
const value: boolean = Deno.build.standalone;
|
||||||
console.log(value);
|
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