Function#toString revision: JSDoc comments?

Garrett Smith dhtmlkitchen at gmail.com
Wed Apr 20 22:45:50 UTC 2016


On Sat, Apr 16, 2016 at 7:53 AM, 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
>
Comments are generally a failure of the developer to write self
explanatory code.

The proposal to break Angular.JS by having Function.prototype.toString
result in preceeding comments could send a message of not relying on
Function decompilation (we went over this in 2005; a dead horse), but
it won't happen.

Because although code in the wild (for the web) cannot reasonably
expect Function.prototype.toString to produce anything other than a
string for which eval will throw a SyntaxError, implementations try to
meet the unreasonable demands imposed by these libraries and their
hapless users (the coders who use Angular in their source code, not
the end user).

Not only does it contradict existing spec (something the Angular.js
developers obviously didn't bother to read), but it changes what
browsers actually do, and if it means breaking the web, browsers won't
do that. Even if the vast majority of content served in conjunction
with Angular is not useful.

Thank you,

-- 
Garrett
Guitar Videos https://www.youtube.com/channel/UCY_uK9hur86KEuiG8s7yvWw
@xkit


More information about the es-discuss mailing list