Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Mar 16, 2024
1 parent 75aabd5 commit c626e79
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions runtime/js/99_main.js
Expand Up @@ -767,9 +767,8 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
ObjectDefineProperty(globalThis, "Deno", core.propReadOnly(finalDenoNs));

if (nodeBootstrap) {
nodeBootstrap(hasNodeModulesDir, argv0);
nodeBootstrap(hasNodeModulesDir, argv0, /* runningOnMainThread */ true);
}

if (future) {
delete globalThis.window;
}
Expand Down Expand Up @@ -800,6 +799,7 @@ function bootstrapWorkerRuntime(
6: argv0,
7: shouldDisableDeprecatedApiWarning,
8: shouldUseVerboseDeprecatedApiWarning,
9: _future,
} = runtimeOptions;

deprecatedApiWarningDisabled = shouldDisableDeprecatedApiWarning;
Expand Down Expand Up @@ -855,6 +855,7 @@ function bootstrapWorkerRuntime(
location.setLocationHref(location_);

globalThis.pollForMessages = pollForMessages;
globalThis.hasMessageEventListener = hasMessageEventListener;

// TODO(bartlomieju): deprecate --unstable
if (unstableFlag) {
Expand All @@ -879,8 +880,18 @@ function bootstrapWorkerRuntime(
// `Deno` with `Deno` namespace from "./deno.ts".
ObjectDefineProperty(globalThis, "Deno", core.propReadOnly(finalDenoNs));

const workerMetadata = maybeWorkerMetadata
? messagePort.deserializeJsMessageData(maybeWorkerMetadata)
: undefined;

if (nodeBootstrap) {
nodeBootstrap(hasNodeModulesDir, argv0);
nodeBootstrap(
hasNodeModulesDir,
argv0,
/* runningOnMainThread */ false,
workerId,
workerMetadata,
);
}
} else {
// Warmup
Expand Down

0 comments on commit c626e79

Please sign in to comment.