Just some cleanup in the JS backend done while I was trying to see what would need to be done for #24743.