(varname)
| 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 |
no test coverage detected