Commit e935523
authored
fix(bundle): Deno.bundle work in Worker (denoland#31316)
Currently, `Deno.bundle` throws exception in a `Worker`.
```
error: Uncaught (in worker "") (in promise) Error: default BundleProvider does not do anything
```
This PR passes the clone of BundleProvider to workers.
---
minimum reproduction:
```ts
#! /usr/bin/env -S deno run --allow-read=. --unstable-bundle
if (typeof WorkerGlobalScope === "undefined") {
const worker = new Worker(import.meta.url, { type: "module" });
worker.onmessage = () => Deno.exit();
} else {
await Deno.bundle({
entrypoints: [import.meta.url],
write: false
});
postMessage("done");
}
```1 parent ccc9aba commit e935523
File tree
6 files changed
+32
-1
lines changed- cli/lib
- runtime
- tests/specs/bundle/worker
6 files changed
+32
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
| |||
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
592 | | - | |
| 593 | + | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments