Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XBL __proto__

0 views
Skip to first unread message

"neil.stansbury () redbacksystems ! com"

unread,
Sep 15, 2009, 7:05:15 PM9/15/09
to
Hey all,

I want to implement a base XBL widget in pure JS without having to go through the agro of "implements" ala XPConnect etc.

I can get a fair way swapping around the __proto__ object of the XBL binding in its constructor, but before I spend any more time on does anyone
know if it's even possible or am I likely to badly bust something down the line?

Basically:

XBLBase implements myBaseJsObject
XBLWidget extends XBLBase


Cheers,

N

Boris Zbarsky

unread,
Sep 15, 2009, 7:48:37 PM9/15/09
to
neil.stansbury () redbacksystems ! com wrote:
> I can get a fair way swapping around the __proto__ object of the XBL
> binding in its constructor, but before I spend any more time on does
> anyone know if it's even possible or am I likely to badly bust something
> down the line?
>
> Basically:
>
> XBLBase implements myBaseJsObject
> XBLWidget extends XBLBase

If you insert your object into the proto chain instead of just setting
it as your prototype but not keeping the things that used to be there,
it should more or less work, I think. Otherwise fields won't work
right, at the very least.

-Boris

"neil.stansbury () redbacksystems ! com"

unread,
Sep 17, 2009, 7:48:57 AM9/17/09
to

Hi Boris,

Thanks for your thoughts.

I spent all day yesterday on this, and after getting past some cyclic __proto__ errors, I ended up with more hacks and errors than efficiency
improvements. So I've shelved this for the moment and put it in the "To Be Refactored" bucket for now.

Cheers,

Neil

0 new messages