function (/*Object*/ source, /*String*/ method, /*Function*/ listener) (view source)
source = source || dojo.global;
// The source method is either null, a dispatcher, or some other functionvar f = source[method];
// Ensure a dispatcherif(!f||!f._listeners){var d = dojo._listener.getDispatcher();
// original target function is special
d.target = f;
// dispatcher holds a list of listeners
d._listeners = [];
// redirect source to dispatcher
f = source[method] = d;
}// The contract is that a handle is returned that can // identify this listener for disconnect. //// The type of the handle is private. Here is it implemented as Integer. // DOM event code has this same contract but handle is Function // in non-IE browsers.//// We could have separate lists of before and after listeners.return f._listeners.push(listener) ; /*Handle*/