static properties of constructors have been used in JS mostly for
transport and avoiding pollution of the global object. For example
DOMPromise has Promise.any(), a static method. But if there were modules,
any() would probably be better suited as an export: import {Promise, any}
from @promise.
On Jul 1, 2013, at 7:23 AM, Juan Ignacio Dopazo dopazo.j...@gmail.com wrote:
So, in the light of modules, are static methods necessary?
Static methods that use the |this| value to allow for constructor-side
inheritance don't work correctly if simply imported from a module.
See Array.from
On Jul 1, 2013, at 17:15 , Brandon Benvie bben...@mozilla.com wrote:
So, in the light of modules, are static methods necessary?
Static methods that use the |this| value to allow for constructor-side
inheritance don't work correctly if simply imported from a module.
See Array.from and
On Jul 1, 2013, at 9:41 AM, Axel Rauschmayer wrote:
On Jul 1, 2013, at 17:15 , Brandon Benvie bben...@mozilla.com wrote:
So, in the light of modules, are static methods necessary?
Static methods that use the |this| value to allow for constructor-side
inheritance don't work correctly if
Similarly: @@create (which enables the subtyping of built-ins).
subclassing
Curious: is that an important distinction? To me, a
From: Axel Rauschmayer [a...@rauschma.de]
Curious: is that an important distinction? To me, a (sub)class is the
implementation of a (sub)type.
This doesn't make much sense in an ES context, where the only
[types](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-4.3.1) are
Undefined,
Thanks Allen, Domenic, Andreas!
Point taken.
I now remember why I originally started to use the word “subtyping”: I wanted a
verb that means deriving a new constructor from an existing constructor C. And
I didn’t want to say “extend C”, because that term was already in use in the JS
community
Given that all non-primitive built-ins behave this way, and that including `if
(!(this instanceof ConstructorName)) { return new ConstructorName(...args); }`
is a well-established best practice for ES5 code: can we just do this
automatically for classes declared with `class`?
8 matches
Mail list logo