As for xmlhttprequest not working, I get

"DOM object constructor cannot be called as a function"

This basically means xmlhttprequest is a host object which does not want to
behave normally. Maybe with some very subtle tricks you can get it to
subclass but I recommend not subclassing host objects.

I also have a feeling axel means defining a meta object with behaviour for
instanceof and new then having every other "class-like" object inherit it as
a base class.

As an aside if we allow overloading of new and instanceof, can we overload
every operator?

On Oct 21, 2011 7:49 PM, "John J Barton" <[email protected]>
wrote:



On Fri, Oct 21, 2011 at 9:36 AM, Axel Rauschmayer <[email protected]> wrote:
> > In a vein similar to...

More entirely unsubstantiated personal opinion based on a few days
experience:

Gonzala's https://github.com/Gozala/selfish does this now and with nicer
syntax.

One subtle point I missed about his approach: instance (member) variables
are created in initializers, not as literals, unless you intend to make the
variable part of a prototype. This could be stumbling block for Java
converts, who expect declarative members.

Only bump so far: XMLHttpRequest.apply fails and you can't run
XMLHttpRequest.prototype.addEventListener unless you run XMLHttpRequest() on
the object. So I could not figure out how to inherit from XMLHttpRequest.

jjb

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to