[webkit-dev] Question about Constructors in WebKit JS Bindings

Maciej Stachowiak mjs at apple.com
Tue Jun 23 10:41:33 PDT 2009

On Jun 22, 2009, at 11:58 PM, Adam Barth wrote:

> That's possible.  I don't have a good idea of what it costs to
> provide.  The benefit is it makes it easier to write correct bindings
> code.  (Or maybe it makes it harder because you have more contexts to
> choose from and choosing the right context is subtle.)
> I don't really know how to solve this problem except by writing tests.
> However, tests don't really help when introducing new kinds of
> objects (e.g., workers, database transactions).

It would be great to make it easier to write DOM constructors  
correctly. Perhaps documenting the pattern and/or introducing a common  
base class will work. I am not even sure all of these should have the  
same behavior, however. For instance, as I read the Web Workers spec,  
the lexical global object may be correct thing to use for the Worker  
constructor. What I'm dubious of is whether we should store extra data  
on every DOM object (of which there are hundreds) to make it easier to  
write DOM constructors (of which there are 9).


More information about the webkit-dev mailing list