Fix backtraces containing r.row in JavaScript

Closes #2096
Review 1331 by @neumino