Function#toString revision: JSDoc comments?

Marius Gundersen gundersen at gmail.com
Sat Apr 16 16:42:21 UTC 2016


Would it not be better to expose the names (and default values,
destructurings, etc) of the function arguments using reflection? For
example, Reflection.arguments(Math.max).then this method can return any
JSDoc it is able to parse.
On 16 Apr 2016 16:53, "Caitlin Potter" <caitpotter88 at gmail.com> wrote:

> How would that interact with angular.js' Function.prototype.toString
> parsing? Seems like doing that could break some content, even if it were
> useful
>
> On Apr 16, 2016, at 10:48 AM, Axel Rauschmayer <rauschma at icloud.com>
> wrote:
>
> Regarding this proposal:
> https://github.com/tc39/Function-prototype-toString-revision
>
> Wouldn’t it make sense to include a preceding JSDoc-style comment in a
> function’s (or method’s) `[[SourceText]]` value? Conceptually it is a part
> of the function and it could be used to implement a REPL `help()` function.
>
> --
> Dr. Axel Rauschmayer
> axel at rauschma.de
> rauschma.de
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> 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/20160416/f245dfc3/attachment.html>


More information about the es-discuss mailing list