fix(jupyter): more robust Deno.jupyter namespace (#20710)

This commit is contained in:
Bartek Iwańczuk 2023-09-28 16:51:44 +02:00 committed by GitHub
parent 35fad4d2bc
commit 0bd53fd52d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 63 deletions

View file

@ -3,12 +3,14 @@
const core = globalThis.Deno.core;
const internals = globalThis.__bootstrap.internals;
import { denoNsUnstable } from "ext:runtime/90_deno_ns.js";
function enableJupyter() {
denoNsUnstable.jupyter = {
const {
op_jupyter_broadcast,
} = core.ensureFastOps();
globalThis.Deno.jupyter = {
async broadcast(msgType, content) {
await core.opAsync("op_jupyter_broadcast", msgType, content);
await op_jupyter_broadcast(msgType, content);
},
};
}