mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Change global namespace logic to placehold with null
This commit is contained in:
parent
b8f25eea2f
commit
81e0fb3194
@ -6,8 +6,9 @@
|
||||
var Jupyter = window.Jupyter || {};
|
||||
|
||||
var jprop = function(name, module_path) {
|
||||
requirejs([module_path], function(loaded) {
|
||||
if (!Jupyter.hasOwnProperty(name)) {
|
||||
if (Jupyter[name] === undefined) {
|
||||
Jupyter[name] = null;
|
||||
requirejs([module_path], function(loaded) {
|
||||
Object.defineProperty(Jupyter, name, {
|
||||
get: function() {
|
||||
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'")`');
|
||||
@ -16,15 +17,16 @@
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
}
|
||||
}, function(err) {
|
||||
console.warn('Jupyter.' + name + ' unavailable because "' + module_path + '" was not loaded.', err);
|
||||
});
|
||||
}, function(err) {
|
||||
console.warn('Jupyter.' + name + ' unavailable because "' + module_path + '" was not loaded.', err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var jglobal = function(name, module_path){
|
||||
requirejs([module_path], function(loaded) {
|
||||
if (!Jupyter.hasOwnProperty(name)) {
|
||||
if (Jupyter[name] === undefined) {
|
||||
Jupyter[name] = null;
|
||||
requirejs([module_path], function(loaded) {
|
||||
Object.defineProperty(Jupyter, name, {
|
||||
get: function() {
|
||||
console.warn('accessing `'+name+'` is deprecated. Use `require("'+module_path+'").'+name+'`');
|
||||
@ -33,10 +35,10 @@
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
}
|
||||
}, function(err) {
|
||||
console.warn('Jupyter.' + name + ' unavailable because "' + module_path + '" was not loaded.', err);
|
||||
});
|
||||
}, function(err) {
|
||||
console.warn('Jupyter.' + name + ' unavailable because "' + module_path + '" was not loaded.', err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user