Comments on Sept Meeting Notes

Kevin Smith zenparsing at gmail.com
Fri Sep 27 21:44:05 PDT 2013


All the noise we made about Object.extend was unclear? From jQuery:
>
> https://github.com/jquery/**jquery/blob/master/src/core.**js#L157<https://github.com/jquery/jquery/blob/master/src/core.js#L157>
>
> Many similar functions, going back to Prototype's Object.extend:
>
> Object.extend = function(destination, source) {
>   for (var property in source)
>     destination[property] = source[property];
>   return destination;
> };
>

Thanks.  I believe this supports my position.  Regardless of how @iterator
is defined, consider this:

    extendObject(target, someObjectWithIterator);

If `someObjectWithIterator` has an @iterator method (be it string or symbol
keyed), I would expect that after this statement runs, `target` would also
have that @iterator method.  To write it a different way:

    extendObject(target, {
      "@iterator"() {}
    });

Or:

    extendObject(target, {
      [Symbol.iterator]() {}
    });

Either way I would be surprised if the "iterator" function was **not**
copied.  I think this example argues for enumerability, at least in some
cases.  Or equivalently, not all meta-level hooks appear to want
non-enumerability.

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130928/3354ae34/attachment-0001.html>


More information about the es-discuss mailing list