Осилил, может кому то вроде меня поможет :
function MyEvents()
{
function TestEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined};
var e = document.createEvent( 'CustomEvent' );
e.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return e;
}
var obj = addEventListener("test", testHandler);
function testHandler(e)
{
console.log(e.type , e.detail);
}
this.test = function( $e ,$detail)
{
dispatchEvent( new TestEvent( $e ,{ bubbles: false, cancelable: false, detail: $detail} ) );
}
}