> Le 19 janv. 2017 à 13:46, Andrea Giammarchi <[email protected]> a
> écrit :
>
> If you are looking for isClass or similar you can also rely on
> `Function.prototype.toString` decompilation, which is de facto consistent.
>
> ```js
> const isClass = (fn) =>
> typeof fn === 'function' &&
> !isClass.toString.call(fn).indexOf('class ');
> ```
>
> Of course if you transpile code, including classes, that'd be useless (but
> then you'll have many other problems anyway)
It is also useless when `Function#toString()` is not correctly implemented,
which is currently the case for Firefox, see:
https://bugzilla.mozilla.org/show_bug.cgi?id=1216630
<https://bugzilla.mozilla.org/show_bug.cgi?id=1216630>
—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss