Change register function arguments to JS::HandleObject