MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / registerVarScoped

Function registerVarScoped

lib/web/CodeMirror/mode/javascript/javascript.js:296–309  ·  view source on GitHub ↗
(varname, context)

Source from the content-addressed store, hash-verified

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

Callers 1

registerFunction · 0.85

Calls 1

inListFunction · 0.70

Tested by

no test coverage detected