summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/99_main.js35
1 files changed, 18 insertions, 17 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 6dd75b415..d0171acd2 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -722,26 +722,27 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
target,
);
+ // TODO(bartlomieju): this is not ideal, but because we use `ObjectAssign`
+ // above any properties that are defined elsewhere using `Object.defineProperty`
+ // are lost.
+ let jupyterNs = undefined;
+ ObjectDefineProperty(finalDenoNs, "jupyter", {
+ get() {
+ if (jupyterNs) {
+ return jupyterNs;
+ }
+ throw new Error(
+ "Deno.jupyter is only available in `deno jupyter` subcommand.",
+ );
+ },
+ set(val) {
+ jupyterNs = val;
+ },
+ });
+
// TODO(bartlomieju): deprecate --unstable
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.
- let jupyterNs = undefined;
- ObjectDefineProperty(finalDenoNs, "jupyter", {
- get() {
- if (jupyterNs) {
- return jupyterNs;
- }
- throw new Error(
- "Deno.jupyter is only available in `deno jupyter` subcommand.",
- );
- },
- set(val) {
- jupyterNs = val;
- },
- });
} else {
for (let i = 0; i <= unstableFeatures.length; i++) {
const id = unstableFeatures[i];