Faking host objects

Hi,  
Sorry I've been a bit off the grid. I've been working on implementing some more of the Web IDL spec while working through the Web MIDI API.  

Anyway, I think I finally figured out the code that replicates host objects in the browser:
https://gist.github.com/4402084

This means that it's not trivial to take some WebIDL and get it exposed in the browser. As in:

interface FooBar(){
readonly attribute DOMString foo;

}  

It would be great if you guys can take a look.  

The code does not yet support constructors, e.g.:  

var x = window.FooBar("foo");  

I'll work on adding that soon.  

With regards to WebIDL, the Web MIDI API gave me an opportunity to implement "toOctet()", which converts an input into an number between 0-255. Not super useful, but…  

Kind regards,
Marcos  
--  
Marcos Caceres

Received on Friday, 28 December 2012 22:07:52 UTC