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.

prevent scope corruption on error in non-let for loops

+4 -2
+4 -2
src/ant.c
··· 10468 10468 10469 10469 static inline bool is_err2(jsval_t *v, jsval_t *res) { 10470 10470 bool r = is_err(*v); 10471 - if (r) *res = *v; return r; 10471 + if (r) { *res = *v; } return r; 10472 10472 } 10473 10473 10474 10474 typedef struct { ··· 10986 10986 v = loop_block_exec(js, &loop_ctx); 10987 10987 if (is_err2(&v, &res)) { 10988 10988 loop_block_cleanup(js, &loop_ctx); 10989 - if (is_let_loop && let_var_len > 0) for_let_pop(js); delscope(js); 10989 + if (is_let_loop && let_var_len > 0) { 10990 + for_let_pop(js); delscope(js); 10991 + } 10990 10992 goto done; 10991 10993 } 10992 10994