MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / ensureDeps

Function ensureDeps

pywebio/html/codemirror/addons.js:73–85  ·  view source on GitHub ↗
(mode, cont)

Source from the content-addressed store, hash-verified

71 return function() { if (--countDown == 0) cont(); };
72 }
73 function ensureDeps(mode, cont) {
74 var deps = CodeMirror.modes[mode].dependencies;
75 if (!deps) return cont();
76 var missing = [];
77 for (var i = 0; i < deps.length; ++i) {
78 if (!CodeMirror.modes.hasOwnProperty(deps[i]))
79 missing.push(deps[i]);
80 }
81 if (!missing.length) return cont();
82 var split = splitCallback(cont, missing.length);
83 for (var i = 0; i < missing.length; ++i)
84 CodeMirror.requireMode(missing[i], split);
85 }
86
87 CodeMirror.requireMode = function(mode, cont) {
88 if (typeof mode != "string") mode = mode.name;

Callers 1

addons.jsFile · 0.70

Calls 2

pushMethod · 0.80
splitCallbackFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…