Function.create
Jake Verbaten
raynos2 at gmail.com
Sat Sep 24 14:37:56 PDT 2011
On Sat, Sep 24, 2011 at 5:03 PM, David Bruant <david.bruant at labri.fr> wrote:
- Show quoted text -
I defiantly like this `<|` operator. I would happily have this instead.
>
> I'm a big fan of the proto operator proposal, however, as raised
> previously this operator relies on the object being created to have an
> intialisation syntax. This prevents, for instance, Date objects to have
> a custom prototype with this method. I am not very familiar with it yet,
> but I think that if they ever came to life, ParallelArrays [2] would
> suffer from the same problem.
> By the way, could someone add this concern as a note ("open issue" or
> "limitation" or something like this) in the proto operator page, please?
>
>
I don't understand the limitation for `Date`.
var d = proto <| new Date();
That would appear to just work for me. Of course it would be sensible that
proto has Date.prototype somewhere in the chain
> One even more generic way which would work even for objects that have no
> initialization syntax would to standardize one of [3] or [4]. Is there a
> wiki page mentionning these two functions somewhere? If not, may it be
> added and linked in some way to the proto operator?
>
Personally I would be tempted to say that making mutating the prototype
chain of an object after creating leads to black magic and abuse.
>
> David
>
> [1] http://wiki.ecmascript.org/doku.php?id=harmony:proto_operator
> [2]
>
> https://github.com/RiverTrail/RiverTrail/blob/15ae7f6f77d9d2842d9d75458017efd9fe0fbee7/jslib/ParallelArray.js#L29
> [3] https://mail.mozilla.org/pipermail/es-discuss/2011-March/013141.html
> [4] https://mail.mozilla.org/pipermail/es-discuss/2011-March/013154.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110924/5fd33637/attachment.html>
More information about the es-discuss
mailing list