Change heap sort to merge sort for Array.prototype (#4026)

ES11 requires Array.prototype.sort to be stable

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
Rafal Walczyna
2020-07-22 13:33:07 +02:00
committed by GitHub
parent 0124368ae7
commit a4952da831
4 changed files with 103 additions and 100 deletions
@@ -238,10 +238,10 @@ typedef ecma_value_t (*ecma_builtin_helper_sort_compare_fn_t) (ecma_value_t lhs,
ecma_value_t rhs, /**< right value */
ecma_value_t compare_func); /**< compare function */
ecma_value_t ecma_builtin_helper_array_heap_sort_helper (ecma_value_t *array_p,
uint32_t right,
ecma_value_t compare_func,
const ecma_builtin_helper_sort_compare_fn_t sort_cb);
ecma_value_t ecma_builtin_helper_array_merge_sort_helper (ecma_value_t *array_p,
uint32_t length,
ecma_value_t compare_func,
const ecma_builtin_helper_sort_compare_fn_t sort_cb);
/**
* @}