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

Function registerVarScoped

samples/common/codehighlight/javascript.js:300–313  ·  view source on GitHub ↗
(varname, context)

Source from the content-addressed store, hash-verified

298 state.globalVars = new Var(varname, state.globalVars)
299 }
300 function registerVarScoped(varname, context) {
301 if (!context) {
302 return null
303 } else if (context.block) {
304 var inner = registerVarScoped(varname, context.prev)
305 if (!inner) return null
306 if (inner == context.prev) return context
307 return new Context(inner, context.vars, true)
308 } else if (inList(varname, context.vars)) {
309 return context
310 } else {
311 return new Context(context.prev, new Var(varname, context.vars), false)
312 }
313 }
314
315 function isModifier(name) {
316 return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"

Callers 1

registerFunction · 0.85

Calls 1

inListFunction · 0.85

Tested by

no test coverage detected