MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

properly look through scope for assignments

+12 -14
+1 -1
meson.build
··· 74 74 build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() 75 75 76 76 version_conf = configuration_data() 77 - version_conf.set('ANT_VERSION', '0.0.7.29') 77 + version_conf.set('ANT_VERSION', '0.0.7.30') 78 78 version_conf.set('ANT_GIT_HASH', git_hash) 79 79 version_conf.set('ANT_BUILD_DATE', build_date) 80 80
+11 -13
src/ant.c
··· 2463 2463 static jsval_t lookup(struct js *js, const char *buf, size_t len) { 2464 2464 if (js->flags & F_NOEXEC) return 0; 2465 2465 2466 - jsoff_t off = lkp(js, js->scope, buf, len); 2467 - if (off != 0) return mkval(T_PROP, off); 2466 + for (jsval_t scope = js->scope;;) { 2467 + jsoff_t off = lkp(js, scope, buf, len); 2468 + if (off != 0) return mkval(T_PROP, off); 2469 + if (vdata(scope) == 0) break; 2470 + scope = upper(js, scope); 2471 + } 2468 2472 2469 - if (global_scope_stack) { 2470 - int stack_len = utarray_len(global_scope_stack); 2471 - for (int i = stack_len - 1; i >= 0; i--) { 2472 - jsoff_t *scope_off = (jsoff_t *)utarray_eltptr(global_scope_stack, i); 2473 - jsval_t scope = mkval(T_OBJ, *scope_off); 2474 - off = lkp(js, scope, buf, len); 2475 - if (off != 0) return mkval(T_PROP, off); 2476 - } 2477 - } else { 2478 - for (jsval_t scope = upper(js, js->scope); vdata(scope) != 0; scope = upper(js, scope)) { 2479 - off = lkp(js, scope, buf, len); 2473 + if (global_scope_stack && utarray_len(global_scope_stack) > 0) { 2474 + jsoff_t *root_off = (jsoff_t *)utarray_eltptr(global_scope_stack, 0); 2475 + if (root_off && *root_off != 0) { 2476 + jsval_t root_scope = mkval(T_OBJ, *root_off); 2477 + jsoff_t off = lkp(js, root_scope, buf, len); 2480 2478 if (off != 0) return mkval(T_PROP, off); 2481 2479 } 2482 2480 }