From 46a4bd5178f5aed22041422c431b5ab6f697865d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 27 Sep 2023 02:21:06 +0200 Subject: feat(unstable): add `Deno.jupyter.broadcast` API (#20656) Closes https://github.com/denoland/deno/issues/20591 --------- Co-authored-by: Kyle Kelley --- runtime/js/90_deno_ns.js | 1 + runtime/js/99_main.js | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'runtime') diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 00c6d6b47..5364a60ee 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -2,6 +2,7 @@ const core = globalThis.Deno.core; const ops = core.ops; + import * as timers from "ext:deno_web/02_timers.js"; import * as httpClient from "ext:deno_fetch/22_http_client.js"; import * as console from "ext:deno_console/01_console.js"; diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 8f74e146e..15e4936b1 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -542,6 +542,16 @@ function bootstrapMainRuntime(runtimeOptions) { if (unstableFlag) { ObjectAssign(finalDenoNs, denoNsUnstable); + // TODO(bartlomieju): this is not ideal, but because we use `ObjectAssign` + // above any properties that are defined elsewhere using `Object.defineProperty` + // are lost. + ObjectDefineProperty(finalDenoNs, "jupyter", { + get() { + throw new Error( + "Deno.jupyter is only available in `deno jupyter` subcommand.", + ); + }, + }); } // Setup `Deno` global - we're actually overriding already existing global -- cgit v1.2.3