Alex Kocharin wrote:
Still doesn't make much sense... This pattern (this instanceof ...) breaks 
another pattern (BaseClass.call(this)). Why first one is deprecated, not the 
second one?

Fair point, and a topic at the last TC39 meeting was to *finally* add a way in JS to tell whether your constructor function was called via new or directly.

I mean, I was able to subclass such a class with prototype injection without 
any issues, and it feels more natural in javascript after all.

You mean using `new`? Mileage varies, but I agree that client code that uses `new` well can add clarity about costs and reference uniqueness (lack of aliasing).

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

Reply via email to