There's no need to capture things as Handle when using HeapFunction. In this case, it was even creating a strong reference cycle, which ended up leaking.
StringPrototype::repeat