MCPcopy
hub / github.com/DHTMLX/gantt / register

Function register

samples/common/codehighlight/javascript.js:279–299  ·  view source on GitHub ↗
(varname)

Source from the content-addressed store, hash-verified

277 return false;
278 }
279 function register(varname) {
280 var state = cx.state;
281 cx.marked = "def";
282 if (!trackScope) return
283 if (state.context) {
284 if (state.lexical.info == "var" && state.context && state.context.block) {
285 // FIXME function decls are also not block scoped
286 var newContext = registerVarScoped(varname, state.context)
287 if (newContext != null) {
288 state.context = newContext
289 return
290 }
291 } else if (!inList(varname, state.localVars)) {
292 state.localVars = new Var(varname, state.localVars)
293 return
294 }
295 }
296 // Fall through means this is global
297 if (parserConfig.globalVars && !inList(varname, state.globalVars))
298 state.globalVars = new Var(varname, state.globalVars)
299 }
300 function registerVarScoped(varname, context) {
301 if (!context) {
302 return null

Callers 6

patternFunction · 0.70
proppatternFunction · 0.70
functiondefFunction · 0.70
functiondeclFunction · 0.70
classNameFunction · 0.70
importSpecFunction · 0.70

Calls 2

registerVarScopedFunction · 0.85
inListFunction · 0.85

Tested by

no test coverage detected