On the detection, localization and repair of client-side JavaScript faults