| 2293 | } |
| 2294 | |
| 2295 | static bool lexical_binding_active_at(const WalkState *state, uint32_t scope_id, const char *name, |
| 2296 | uint32_t position) { |
| 2297 | const CBMLexicalScope *scope = usage_lexical_scope(state, scope_id); |
| 2298 | if (!scope) { |
| 2299 | return false; |
| 2300 | } |
| 2301 | int index = lexical_binding_lower_bound(state, scope_id, name); |
| 2302 | while (index < state->lexical_binding_count) { |
| 2303 | const CBMLexicalBinding *binding = &state->lexical_bindings[index++]; |
| 2304 | if (binding->scope_id != scope_id || strcmp(binding->name, name) != 0) { |
| 2305 | break; |
| 2306 | } |
| 2307 | uint32_t active_end = binding->active_end ? binding->active_end : scope->end_byte; |
| 2308 | if (binding->active_start <= position && position < active_end) { |
| 2309 | return true; |
| 2310 | } |
| 2311 | } |
| 2312 | return false; |
| 2313 | } |
| 2314 | |
| 2315 | static const CBMLexicalScope *lexical_binding_scope_for_usage(const WalkState *state, |
| 2316 | const CBMUsage *usage, |
no test coverage detected