What's the issue with document.createElement('object')?

On Wed, Aug 10, 2016 at 7:20 AM, Michał Wadas <michalwa...@gmail.com> wrote:

> Using instanceof Function can be confusing, because there are objects
> that are callable but not instanceof Function (document.all,
> document.createElement('object'), any cross-realm function).
>
> Function.isFunction? :D
>
> On Wed, Aug 10, 2016 at 4:00 PM, Mark S. Miller <erig...@google.com>
> wrote:
>
>>
>>
>> On Wed, Aug 10, 2016 at 4:53 AM, Andy Earnshaw <andyearns...@gmail.com>
>> wrote:
>>
>>> On Wed, 10 Aug 2016 at 12:42 Michał Wadas <michalwa...@gmail.com> wrote:
>>>
>>>> Function.prototype is no-op (run Function.prototype.toString() for
>>>> more information)
>>>>
>>>
>>> That's true, but using `Function.prototype` can be confusing
>>>
>>
>> Indeed.
>>
>> > Function.prototype instanceof Function
>> false
>>
>>
>>
>>> when passed to a function as a callback:
>>>
>>>     someFunc(Function.prototype);
>>>
>>> It's not immediately clear that `someFunc` is expecting a callback
>>> function in this case, whereas `Function.NOOP` or `() => {}` are pretty
>>> obvious.
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>>
>>
>>
>> --
>>     Cheers,
>>     --MarkM
>>
>
>


-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to