Based on Mozilla bug 1345177.
Changes from the original bug's patch:
- We don't have JS::CurrentThreadIsHeapCollecting, so let's use
trc->runtime()->isHeapCollecting() instead.
- Mozilla bug 1337117 renamed runtimeFromMainThread to
runtimeFromActiveCooperatingThread for Firefox 54, so let's use the former
Turns out we have a duplicate VoidFunction callback in the WebIDLs. Per
Mozilla bug 1324169, we should remove this callback from
RTCPeerConnection.webidl and let Function.webidl handle it instead.
The AttributeError faced by the new Basilisk dev wasn't helpful at all;
and turns out Mozilla had this exact same issue on bug 1505504. We're
also backporting that just in case we encounter another case of
callback duplication.
Also doing a minor fix in the MicroTaskRunnable class which Moonchild
forgot to do while working on Issue #1895.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.