One proposal for how to do it is: take the current CoffeeScript-generated JS, run it through a pretty-printer, and commit. Then do a second manual commit for formatting and refactoring to remove autogeneration-isms. This way, by looking at the diffs, we can be reasonably sure that the port from CoffeeScript to JS doesn't change any semantics.
Still a few loose ends to tie up but some early review would go a long way since rebasing this is going to be nightmare if we make any significant changes.
b5934883d4 "Don't overwrite global location": The commit also adds checks for snowflake !== null. Are those related to the location change, or could they be split out?
d1af00da67 "Don't specify port for stun server": How was this working before? Was there a hardcoded default inside libwebrtc?
I did the CoffeeScript rebuild step myself starting from 60fe1ae18b^ and got the same output as your 60fe1ae18b.
In order to download the newer version of CoffeeScript needed, I had to modify package.json. It might be worth sneaking in a commit to this effect, as documentation in the log.
b5934883d4 "Don't overwrite global location": The commit also adds checks for snowflake !== null. Are those related to the location change, or could they be split out?
What was happening was the location bug would throw before window.init initialized snowflake and so window.unload would be called with it still as null. I can split them apart if you prefer since they're only related in that the one surfaced the other.
d1af00da67 "Don't specify port for stun server": How was this working before? Was there a hardcoded default inside libwebrtc?
It wasn't working before because, prior to 7f5cd81, it wasn't being set at all. Fixing that "broke" things.
For what it's worth though, I don't think removing the port actually fixes anything. It probably makes the url invalid in some way that it falls back to the default you alluded to in libwebrtc.
My investigation sort of ended when discovering it was that commit that was preventing this work from going through. We're going to look at it in more detail in comment:10:ticket:31100
I did the CoffeeScript rebuild step myself starting from 60fe1ae18b^ and got the same output as your 60fe1ae18b.
In order to download the newer version of CoffeeScript needed, I had to modify package.json. It might be worth sneaking in a commit to this effect, as documentation in the log.
{{{#!diff
"coffee-script": "^1.12.2",
"coffeescript": "^2",
}}}
Sure, the commit message for 60fe1ae does mention this though.