src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (msg) {
            var msgHandlers;
            if (!msg.method) {
                // no message type, ignoring it
                // TODO: should we trigger a generic event?
                console.log("[Brackets LiveDev] Received message without method.");
                return;
            }
            // get handlers for msg.method
            msgHandlers = this.handlers[msg.method];

            if (msgHandlers && msgHandlers.length > 0) {
                // invoke handlers with the received message
                msgHandlers.forEach(function (handler) {
                    try {
                        // TODO: check which context should be used to call handlers here.
                        handler(msg);
                        return;
                    } catch (e) {
                        console.log("[Brackets LiveDev] Error executing a handler for " + msg.method);
                        console.log(e.stack);
                        return;
                    }
                });
            } else {
                // no subscribers, ignore it.
                // TODO: any other default handling? (eg. specific respond, trigger as a generic event, etc.);
                console.log("[Brackets LiveDev] No subscribers for message " + msg.method);
                return;
            }
        }
function (msg) {
            var msgHandlers;
            if (!msg.method) {
                // no message type, ignoring it
                // TODO: should we trigger a generic event?
                console.log("[Brackets LiveDev] Received message without method.");
                return;
            }
            // get handlers for msg.method
            msgHandlers = this.handlers[msg.method];

            if (msgHandlers && msgHandlers.length > 0) {
                // invoke handlers with the received message
                msgHandlers.forEach(function (handler) {
                    try {
                        // TODO: check which context should be used to call handlers here.
                        handler(msg);
                        return;
                    } catch (e) {
                        console.log("[Brackets LiveDev] Error executing a handler for " + msg.method);
                        console.log(e.stack);
                        return;
                    }
                });
            } else {
                // no subscribers, ignore it.
                // TODO: any other default handling? (eg. specific respond, trigger as a generic event, etc.);
                console.log("[Brackets LiveDev] No subscribers for message " + msg.method);
                return;
            }
        }
function ( msg ) { var msgHandlers ; if ( ! msg . method ) { // no message type, ignoring it // TODO: should we trigger a generic event? console . log ( "[Brackets LiveDev] Received message without method." ) ; return ; } // get handlers for msg.method msgHandlers = this . handlers [ msg . method ] ; if ( msgHandlers && msgHandlers . length > 0 ) { // invoke handlers with the received message msgHandlers . forEach ( function ( handler ) { try { // TODO: check which context should be used to call handlers here. handler ( msg ) ; return ; } catch ( e ) { console . log ( "[Brackets LiveDev] Error executing a handler for " + msg . method ) ; console . log ( e . stack ) ; return ; } } ) ; } else { // no subscribers, ignore it. // TODO: any other default handling? (eg. specific respond, trigger as a generic event, etc.); console . log ( "[Brackets LiveDev] No subscribers for message " + msg . method ) ; return ; } }
Dispatch messages to handlers according to msg.method value.
@param {Object} msg Message to be dispatched.
Dispatch messages to handlers according to msg . method value .