Sort function breakpoints before enabling them
Function breakpoints should be sorted before enabling then since the object enumeration order does not grant consistent result.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik
@@ -1089,8 +1089,14 @@ class JerryDebugger(object):
result += self._enable_breakpoint(breakpoint)
else:
+ functions_to_enable = []
for function in self.function_list.values():
if function.name == string:
+ functions_to_enable.append(function)
+
+ functions_to_enable.sort(key=lambda x: x.line)
+
+ for function in functions_to_enable:
result += self._enable_breakpoint(function.lines[function.first_breakpoint_line])
if not result and not pending:
