JS backend: generate toString for data classes