Re: Web MIDI polyfill

On Monday, December 17, 2012 at 7:28 PM, Chris Wilson wrote:
> 
> I went through event dispatching, trying to find an example that wasn't dispatching on a DOM element, and couldn't find one; after thinking through the implications, I couldn't come up with a reason that building my own would have negative implications, and it seemed much easier (and lower overhead) than creating a fake element. I could easily be wrong, but I was trying to think about it, at least. :) 

Ok, I remember now what had screwed me in the past: I'd tried to extend DOMEvent and then tried to dispatch that as an event. like:

function MyCustomEvent(){}
MyCustomEvent.prototype = new DOMEvent();
var e = new MyCustomEvent(); 
document.body.dispatchEvent(e);

Of course, that fails spectacularly (though it shouldn't if Host Objects were not magical). 

So, I'm really sorry Chris for making you waste time thinking about that.  
  

-- 
Marcos Caceres

Received on Monday, 17 December 2012 20:14:56 UTC