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.

add better error handling to collections

+8 -8
+4 -4
examples/results.txt
··· 539 539 compat-table/es6/Map.iterator-closing.js: OK 540 540 compat-table/es6/Map.iterator-prototype-chain.js: OK 541 541 compat-table/es6/Map.js: OK 542 - compat-table/es6/Map.prototype-not-instance.js: failed 542 + compat-table/es6/Map.prototype-not-instance.js: OK 543 543 compat-table/es6/Map.prototype.Symbol.iterator.js: OK 544 544 compat-table/es6/Map.prototype.clear.js: OK 545 545 compat-table/es6/Map.prototype.delete.js: OK ··· 656 656 compat-table/es6/Set.iterator-closing.js: failed 657 657 compat-table/es6/Set.iterator-prototype-chain.js: OK 658 658 compat-table/es6/Set.js: OK 659 - compat-table/es6/Set.prototype-not-instance.js: failed 659 + compat-table/es6/Set.prototype-not-instance.js: OK 660 660 compat-table/es6/Set.prototype.Symbol.iterator.js: OK 661 661 compat-table/es6/Set.prototype.add-returns-this.js: OK 662 662 compat-table/es6/Set.prototype.clear.js: OK ··· 700 700 compat-table/es6/WeakMap.iterator-closing.js: OK 701 701 compat-table/es6/WeakMap.js: OK 702 702 compat-table/es6/WeakMap.no-clear.js: OK 703 - compat-table/es6/WeakMap.prototype-not-instance.js: failed 703 + compat-table/es6/WeakMap.prototype-not-instance.js: OK 704 704 compat-table/es6/WeakMap.prototype.delete.js: OK 705 705 compat-table/es6/WeakMap.prototype.set-returns-this.js: OK 706 706 compat-table/es6/WeakSet.accept-primitives.js: OK ··· 711 711 compat-table/es6/WeakSet.iterator-closing.js: OK 712 712 compat-table/es6/WeakSet.js: OK 713 713 compat-table/es6/WeakSet.no-clear.js: OK 714 - compat-table/es6/WeakSet.prototype-not-instance.js: failed 714 + compat-table/es6/WeakSet.prototype-not-instance.js: OK 715 715 compat-table/es6/WeakSet.prototype.add-returns-this.js: OK 716 716 compat-table/es6/WeakSet.prototype.delete.js: OK 717 717 compat-table/es6/annex-b.RegExp.prototype.compile.js: OK
+4 -4
src/modules/collections.c
··· 375 375 ant_value_t this_val = js->this_val; 376 376 map_entry_t **map_ptr = get_map_from_obj(this_val); 377 377 378 - if (!map_ptr) return js_false; 378 + if (!map_ptr) return js_mkerr_typed(js, JS_ERR_TYPE, "Invalid Map object"); 379 379 map_entry_t *entry = map_find_entry(js, map_ptr, args[0]); 380 380 return js_bool(entry != NULL); 381 381 } ··· 606 606 607 607 ant_value_t this_val = js->this_val; 608 608 set_entry_t **set_ptr = get_set_from_obj(this_val); 609 - if (!set_ptr) return js_false; 609 + if (!set_ptr) return js_mkerr_typed(js, JS_ERR_TYPE, "Invalid Set object"); 610 610 611 611 set_entry_t *entry = set_find_entry(js, set_ptr, args[0]); 612 612 return js_bool(entry != NULL); ··· 1135 1135 1136 1136 ant_value_t this_val = js->this_val; 1137 1137 weakmap_entry_t **wm_ptr = get_weakmap_from_obj(this_val); 1138 - if (!wm_ptr) return js_false; 1138 + if (!wm_ptr) return js_mkerr_typed(js, JS_ERR_TYPE, "Invalid WeakMap object"); 1139 1139 if (!is_object_type(args[0])) return js_false; 1140 1140 1141 1141 ant_value_t key_obj = args[0]; ··· 1243 1243 1244 1244 ant_value_t this_val = js->this_val; 1245 1245 weakset_entry_t **ws_ptr = get_weakset_from_obj(this_val); 1246 - if (!ws_ptr) return js_false; 1246 + if (!ws_ptr) return js_mkerr_typed(js, JS_ERR_TYPE, "Invalid WeakSet object"); 1247 1247 if (!is_object_type(args[0])) return js_false; 1248 1248 1249 1249 ant_value_t value_obj = args[0];