My initial motivation was to create a Python-style help() function. But I agree that it’s probably better not to depend on this mechanism.
> On 16 Apr 2016, at 19:28, Jordan Harband <ljh...@gmail.com> wrote: > > As I see it, the primary purpose of the `Function#toString` proposal is to > document what browsers already do, and tighten it down so they can't deviate > further (which some browsers already have begun to do with "class", for > example). > > "Preceding comments" would be a very hard thing to specify without unduly > blessing an arbitrary documentation pattern, especially one that isn't > universally considered to be a good thing. > > Reflection methods on functions are certainly a potential separate proposal, > if you can make a compelling argument that it's a good idea to reflect on > functions in this manner. > > On Sat, Apr 16, 2016 at 9:42 AM, Marius Gundersen <gunder...@gmail.com > <mailto:gunder...@gmail.com>> wrote: > 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" <caitpotte...@gmail.com > <mailto:caitpotte...@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 <rausc...@icloud.com > <mailto:rausc...@icloud.com>> wrote: > >> Regarding this proposal: >> https://github.com/tc39/Function-prototype-toString-revision >> <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 >> a...@rauschma.de <mailto:a...@rauschma.de> >> rauschma.de <http://rauschma.de/> >> _______________________________________________ >> es-discuss mailing list >> es-discuss@mozilla.org <mailto:es-discuss@mozilla.org> >> https://mail.mozilla.org/listinfo/es-discuss >> <https://mail.mozilla.org/listinfo/es-discuss> > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org <mailto:es-discuss@mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss > <https://mail.mozilla.org/listinfo/es-discuss> > > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org <mailto:es-discuss@mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss > <https://mail.mozilla.org/listinfo/es-discuss> > > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de rauschma.de
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss