var_node.key = (uintptr_t) lhq.value;
- node = njs_rbtree_find(vm->variables_hash, &var_node.node);
+ node = njs_rbtree_find(&vm->global_scope->variables, &var_node.node);
if (njs_slow_path(node == NULL)) {
return NULL;
}
var_node.key = (uintptr_t) lhq.value;
- rb_node = njs_rbtree_find(vm->variables_hash, &var_node.node);
+ rb_node = njs_rbtree_find(&vm->global_scope->variables, &var_node.node);
if (rb_node == NULL) {
return NJS_DECLINED;
}
cmpl->length = njs_strlen(text);
cmpl->suffix_completions = NULL;
- if (vm->variables_hash != NULL) {
- cmpl->node = njs_rbtree_min(vm->variables_hash);
+ if (vm->global_scope != NULL) {
+ cmpl->node = njs_rbtree_min(&vm->global_scope->variables);
}
}
switch (cmpl->phase) {
case NJS_COMPLETION_VAR:
- variables = vm->variables_hash;
+ variables = (vm->global_scope != NULL) ? &vm->global_scope->variables
+ : NULL;
if (variables == NULL) {
njs_next_phase(cmpl);
njs_scope_value_set(vm, njs_scope_global_this_index(), &vm->global_value);
vm->start = generator.code_start;
- vm->variables_hash = &scope->variables;
vm->global_scope = scope;
if (vm->options.disassemble) {
njs_native_frame_t *top_frame;
njs_frame_t *active_frame;
- njs_rbtree_t *variables_hash;
njs_lvlhsh_t keywords_hash;
njs_lvlhsh_t values_hash;