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.

bump to v0.10.0

+44 -51
+1 -1
meson/ant.version
··· 1 - 0.9.1 1 + 0.10.0
+5 -15
src/ant.c
··· 6243 6243 set_slot(js_as_obj(stack), SLOT_SETTLED, js_true); 6244 6244 6245 6245 ant_offset_t len = vtype(entries) == T_ARR ? js_arr_len(js, entries) : 0; 6246 - for (ant_offset_t i = len; i > 0; i--) { 6247 - ant_value_t record = js_arr_get(js, entries, i - 1); 6248 - GC_ROOT_PIN(js, record); 6249 - ant_value_t result = sv_disposal_record_call(js, record); 6250 - 6251 - if (is_err(result) || js->thrown_exists) { 6252 - ant_value_t error = sv_disposal_error_value(js, result); 6253 - GC_ROOT_PIN(js, error); 6254 - completion = sv_suppress_disposal_error(js, error, completion); 6255 - 6256 - if (is_err(completion)) { 6257 - GC_ROOT_RESTORE(js, root_mark); 6258 - return completion; 6259 - } 6260 - } 6246 + if (len > 0) completion = sv_dispose_records_sync(js, entries, len, &completion, false); 6247 + 6248 + if (is_err(completion)) { 6249 + GC_ROOT_RESTORE(js, root_mark); 6250 + return completion; 6261 6251 } 6262 6252 6263 6253 set_slot(js_as_obj(stack), SLOT_ENTRIES, js_mkarr(js));
+38 -35
src/silver/ops/using.h
··· 158 158 return resource; 159 159 } 160 160 161 + static inline ant_value_t sv_dispose_records_sync( 162 + ant_t *js, ant_value_t records, ant_offset_t len, 163 + ant_value_t *completion, bool throw_completion 164 + ) { 165 + for (ant_offset_t i = len; i > 0; i--) { 166 + GC_ROOT_SAVE(iter_mark, js); 167 + ant_value_t record = js_arr_get(js, records, i - 1); 168 + 169 + GC_ROOT_PIN(js, record); 170 + ant_value_t result = sv_disposal_record_call(js, record); 171 + 172 + if (is_err(result) || js->thrown_exists) { 173 + ant_value_t error = sv_disposal_error_value(js, result); 174 + 175 + GC_ROOT_PIN(js, error); 176 + *completion = sv_suppress_disposal_error(js, error, *completion); 177 + 178 + if (is_err(*completion)) { 179 + GC_ROOT_RESTORE(js, iter_mark); 180 + return *completion; 181 + }} 182 + 183 + GC_ROOT_RESTORE(js, iter_mark); 184 + } 185 + 186 + if (throw_completion && vtype(*completion) != T_UNDEF) { 187 + ant_value_t thrown = js_throw(js, *completion); 188 + return thrown; 189 + } 190 + 191 + return *completion; 192 + } 193 + 161 194 static inline ant_value_t sv_using_dispose_sync( 162 195 ant_t *js, ant_value_t entries, ant_value_t completion, bool throw_completion 163 196 ) { ··· 185 218 } 186 219 187 220 sv_using_array_clear(entries); 188 - len = js_arr_len(js, work); 221 + ant_value_t result = sv_dispose_records_sync( 222 + js, work, js_arr_len(js, work), &completion, throw_completion 223 + ); 189 224 190 - for (ant_offset_t i = len; i > 0; i--) { 191 - GC_ROOT_SAVE(iter_mark, js); 192 - ant_value_t record = js_arr_get(js, work, i - 1); 193 - 194 - GC_ROOT_PIN(js, record); 195 - ant_value_t result = sv_disposal_record_call(js, record); 196 - 197 - if (is_err(result) || js->thrown_exists) { 198 - ant_value_t error = sv_disposal_error_value(js, result); 199 - GC_ROOT_PIN(js, error); 200 - completion = sv_suppress_disposal_error(js, error, completion); 201 - 202 - if (is_err(completion)) { 203 - GC_ROOT_RESTORE(js, root_mark); 204 - return completion; 205 - } 206 - } 207 - 208 - GC_ROOT_RESTORE(js, iter_mark); 209 - } 210 - 211 - if (throw_completion && vtype(completion) != T_UNDEF) { 212 - ant_value_t thrown = js_throw(js, completion); 213 - GC_ROOT_RESTORE(js, root_mark); 214 - return thrown; 215 - } 216 - 217 225 GC_ROOT_RESTORE(js, root_mark); 218 - return completion; 226 + return result; 219 227 } 220 228 221 229 static inline ant_value_t sv_async_dispose_continue( ··· 225 233 ant_value_t reason 226 234 ); 227 235 228 - static inline ant_value_t sv_async_dispose_on_fulfilled( 229 - ant_t *js, 230 - ant_value_t *args, 231 - int nargs 232 - ) { 233 - (void)args; (void)nargs; 236 + static inline ant_value_t sv_async_dispose_on_fulfilled(ant_t *js, ant_value_t *args, int nargs) { 234 237 ant_value_t state = js_get_slot(js_getcurrentfunc(js), SLOT_DATA); 235 238 return sv_async_dispose_continue(js, state, false, js_mkundef()); 236 239 }