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

Function register

lib/web/CodeMirror/mode/javascript/javascript.js:276–295  ·  view source on GitHub ↗
(varname)

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected