Introspect bind function targets

Jordan Harband ljharb at gmail.com
Mon Feb 4 23:43:40 UTC 2019


Given that you can also do `const c = (...args) => proto.call(null,
...args);`, and `Function.isSameTarget(a, c)` would presumably be `false`,
can you elaborate more on the use case for this?

On Mon, Feb 4, 2019 at 9:38 AM Sultan <thysultan at gmail.com> wrote:

> A way to determine if two bound functions reference the same target
> function.
>
> For example:
>
> function proto () {}
>
> const a = proto.bind(null, 1)
> const b = proto.bind(null, 2)
>
> console.assert(Function.isSameTarget(a, b))
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190204/261c7c7d/attachment.html>


More information about the es-discuss mailing list