Fixes #1671.
This is close to 100% coverage, but the js_source_map stuff will be tricky, and we may just want to eliminate that soon.