MCPcopy
hub / github.com/ternjs/tern / loadDefs

Function loadDefs

doc/demo/demo.js:150–164  ·  view source on GitHub ↗
(defs, c)

Source from the content-addressed store, hash-verified

148
149var defsLoaded = Object.create(null)
150function loadDefs(defs, c) {
151 var result = [], loaded = 0
152 for (var i = 0; i < defs.length; ++i) (function(i) {
153 var name = defs[i]
154 if (defsLoaded[name]) {
155 result[i] = defsLoaded[name]
156 if (++loaded == defs.length) c(result)
157 } else {
158 load("../../defs/" + name + ".json", function(json) {
159 defsLoaded[name] = result[i] = JSON.parse(json)
160 if (++loaded == defs.length) c(result)
161 })
162 }
163 })(i)
164}
165
166function words(str) {
167 return str ? str.split(" ") : []

Callers 1

initProjectFunction · 0.85

Calls 2

cFunction · 0.85
loadFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…