summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /runtime/js/99_main.js
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 56a5b411b..eedca3396 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -27,7 +27,6 @@ const {
ArrayPrototypeForEach,
ArrayPrototypeIncludes,
ArrayPrototypeMap,
- DateNow,
Error,
ErrorPrototype,
FunctionPrototypeBind,
@@ -87,6 +86,8 @@ import {
workerRuntimeGlobalProperties,
} from "ext:runtime/98_global_scope_worker.js";
import { SymbolDispose, SymbolMetadata } from "ext:deno_web/00_infra.js";
+import { bootstrap as bootstrapOtel } from "ext:runtime/telemetry.ts";
+
// deno-lint-ignore prefer-primordials
if (Symbol.metadata) {
throw "V8 supports Symbol.metadata now, no need to shim it";
@@ -470,6 +471,8 @@ const NOT_IMPORTED_OPS = [
// Related to `Deno.jupyter` API
"op_jupyter_broadcast",
"op_jupyter_input",
+ // Used in jupyter API
+ "op_base64_encode",
// Related to `Deno.test()` API
"op_test_event_step_result_failed",
@@ -574,6 +577,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
10: serveHost,
11: serveIsMain,
12: serveWorkerCount,
+ 13: otelConfig,
} = runtimeOptions;
if (mode === executionModes.serve) {
@@ -642,7 +646,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
removeImportedOps();
- performance.setTimeOrigin(DateNow());
+ performance.setTimeOrigin();
globalThis_ = globalThis;
// Remove bootstrapping data from the global scope
@@ -674,9 +678,10 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
});
ObjectSetPrototypeOf(globalThis, Window.prototype);
+ bootstrapOtel(otelConfig);
+
if (inspectFlag) {
- const consoleFromDeno = globalThis.console;
- core.wrapConsole(consoleFromDeno, core.v8Console);
+ core.wrapConsole(globalThis.console, core.v8Console);
}
event.defineEventHandler(globalThis, "error");
@@ -696,6 +701,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
// are lost.
let jupyterNs = undefined;
ObjectDefineProperty(finalDenoNs, "jupyter", {
+ __proto__: null,
get() {
if (jupyterNs) {
return jupyterNs;
@@ -855,9 +861,10 @@ function bootstrapWorkerRuntime(
5: hasNodeModulesDir,
6: argv0,
7: nodeDebug,
+ 13: otelConfig,
} = runtimeOptions;
- performance.setTimeOrigin(DateNow());
+ performance.setTimeOrigin();
globalThis_ = globalThis;
// Remove bootstrapping data from the global scope
@@ -882,8 +889,9 @@ function bootstrapWorkerRuntime(
}
ObjectSetPrototypeOf(globalThis, DedicatedWorkerGlobalScope.prototype);
- const consoleFromDeno = globalThis.console;
- core.wrapConsole(consoleFromDeno, core.v8Console);
+ bootstrapOtel(otelConfig);
+
+ core.wrapConsole(globalThis.console, core.v8Console);
event.defineEventHandler(self, "message");
event.defineEventHandler(self, "error", undefined, true);