Selaa lähdekoodia

Do not use ?? in plain js, as it is too new.

In Typescript, we are compiling this down to es2017 to remove the ??.

Fixes #9592
Jason Grout 4 vuotta sitten
vanhempi
commit
3f90f74e72
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2 2
      dev_mode/bootstrap.js
  2. 2 2
      jupyterlab/staging/bootstrap.js

+ 2 - 2
dev_mode/bootstrap.js

@@ -22,7 +22,7 @@
 let _CONFIG_DATA = null;
 function getOption(name) {
   if (_CONFIG_DATA === null) {
-    let configData;
+    let configData = {};
     // Use script tag if available.
     if (typeof document !== 'undefined' && document) {
       const el = document.getElementById('jupyter-config-data');
@@ -31,7 +31,7 @@ function getOption(name) {
         configData = JSON.parse(el.textContent || '{}');
       }
     }
-    _CONFIG_DATA = configData ?? Object.create(null);
+    _CONFIG_DATA = configData;
   }
 
   return _CONFIG_DATA[name] || '';

+ 2 - 2
jupyterlab/staging/bootstrap.js

@@ -23,7 +23,7 @@
 let _CONFIG_DATA = null;
 function getOption(name) {
   if (_CONFIG_DATA === null) {
-    let configData;
+    let configData = {};
     // Use script tag if available.
     if (typeof document !== 'undefined' && document) {
       const el = document.getElementById('jupyter-config-data');
@@ -32,7 +32,7 @@ function getOption(name) {
         configData = JSON.parse(el.textContent || '{}');
       }
     }
-    _CONFIG_DATA = configData ?? Object.create(null);
+    _CONFIG_DATA = configData;
   }
 
   return _CONFIG_DATA[name] || '';