mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixes two bugs in the index calculations that affect the result of the `String.startsWith` function: - Fixes the implementation of ECMA-262 v6, 21.1.3.18, step 14: "If searchLength+start is greater than len, return false". - Fixes the return value of the helper function `ecma_builtin_helper_string_find_index`. If it is called with a starting search position, the returned index should be not less than that. These changes fix the following test cases in the test262 suite: - built-ins/String/prototype/startsWith/return-true-if-searchstring-is-empty.js - built-ins/String/prototype/startsWith/searchstring-found-with-position.js JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu