Fix backtraces containing r.row in JavaScript

Closes #2096
Review 1331 by @neumino
Merge branch 'next' into sam_multiple_ii