some more work on JS generator