- From: François REMY <francois.remy.dev@outlook.com>
- Date: Sat, 29 Dec 2012 15:29:11 +0000
- To: "public-nextweb@w3.org" <public-nextweb@w3.org>, Marcos Caceres <w3c@marcosc.com>
Received on Saturday, 29 December 2012 15:29:41 UTC
I should play with it in a real browser to be sure, but I think you transform some things that were supposed to be objects into functions.
I’ll play with it a bit more, and I’ll give you more informed comments after that.
De : Marcos Caceres
Envoyé : 28 décembre 2012 23:08
À : <,public-nextweb@w3.org>,
Objet : 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 Saturday, 29 December 2012 15:29:41 UTC