rem: const EQS = getService("@mozilla.org/event-queue-service;1", "nsIEventQueueService"); var th = EQS.getSpecialEventQueue(EQS.CURRENT_THREAD_EVENT_QUEUE);  
add: var th; if (jsenv.HAS_THREAD_MANAGER) { th = getService("@mozilla.org/thread-manager;1").currentThread; } else { const EQS = getService("@mozilla.org/event-queue-service;1", "nsIEventQueueService"); th = EQS.getSpecialEventQueue(EQS.CURRENT_THREAD_EVENT_QUEUE); } 
context: function dcc_addhost(host, auth){    var me = this;    var listener = {        onLookupComplete: function _onLookupComplete(request, record, status) {            // record == null if it failed. We can't do anything with a failure.            if (record)            {                while (record.hasMore())                    me.addIP(record.getNextAddrAsString(), auth);            }        }    };    try {        const EQS = getService("@mozilla.org/event-queue-service;1",                               "nsIEventQueueService");        var th = EQS.getSpecialEventQueue(EQS.CURRENT_THREAD_EVENT_QUEUE);        var dnsRecord = this._dnsSvc.asyncResolve(host, false, listener, th);    } catch (ex) {        dd("Error resolving host to IP: " + ex);    }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0318b8c70772f1cef1cd80f8dab2f70f1fd54712/dcc.js/buggy/extensions/irc/js/lib/dcc.js