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.

implicit refErr

+18 -14
+1 -1
meson.build
··· 75 75 build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() 76 76 77 77 version_conf = configuration_data() 78 - version_conf.set('ANT_VERSION', '0.1.3.16') 78 + version_conf.set('ANT_VERSION', '0.1.3.17') 79 79 version_conf.set('ANT_GIT_HASH', git_hash) 80 80 version_conf.set('ANT_BUILD_DATE', build_date) 81 81
+17 -13
src/ant.c
··· 5483 5483 if (is_err(r)) return r; 5484 5484 if (is_assign(op) && vtype(lhs) != T_PROP && vtype(lhs) != T_PROPREF) { 5485 5485 if (!(js->flags & F_STRICT) && vtype(lhs) == T_UNDEF) return r; 5486 + if (!(js->flags & F_STRICT) && vtype(lhs) == T_CODEREF && op == TOK_ASSIGN) { 5487 + jsoff_t id_off = coderefoff(lhs); 5488 + jsoff_t id_len = codereflen(lhs); 5489 + jsval_t global_scope = js->scope; 5490 + while (vdata(upper(js, global_scope)) != 0) { 5491 + global_scope = upper(js, global_scope); 5492 + } 5493 + jsval_t key = js_mkstr(js, &js->code[id_off], id_len); 5494 + if (is_err(key)) return key; 5495 + jsval_t prop = setprop(js, global_scope, key, r); 5496 + if (is_err(prop)) return prop; 5497 + return r; 5498 + } 5486 5499 return js_mkerr(js, "bad lhs"); 5487 5500 } 5488 5501 ··· 7257 7270 js->consumed = saved_consumed; 7258 7271 uint8_t next_tok = next(js); 7259 7272 if (next_tok == TOK_ASSIGN) { 7260 - jsval_t global_scope = js->scope; 7261 - while (vdata(upper(js, global_scope)) != 0) { 7262 - global_scope = upper(js, global_scope); 7263 - } 7264 - jsval_t key = js_mkstr(js, &js->code[id_off], id_len); 7265 - if (!is_err(key)) { 7266 - res = setprop(js, global_scope, key, js_mkundef()); 7267 - if (!is_err(res)) { 7268 - js->flags &= (uint8_t)~F_THROW; 7269 - js->thrown_value = js_mkundef(); 7270 - if (js->errmsg) js->errmsg[0] = '\0'; 7271 - } 7272 - } 7273 + js->flags &= (uint8_t)~F_THROW; 7274 + js->thrown_value = js_mkundef(); 7275 + if (js->errmsg) js->errmsg[0] = '\0'; 7276 + return mkcoderef(id_off, id_len); 7273 7277 } 7274 7278 } 7275 7279 if (is_err(res)) return res;