Re:Node.js: Some quick optimization advice
by ycitm on Monday October 12, 2015 @05:56PM
(#10377178)
Yup, see @pauljz's comment above - https://news.ycombinator.com/item?id=10375297
[ Parent
| on HN ]
Re:Node.js: Some quick optimization advice
by alkonaut on Tuesday October 13, 2015 @04:22AM
(#10379135)
I still don't understand that. Function.prototype.toString() wouldn't break because the parser stripped the comments, it would just output the source without comments? Does any code anywhere depend on the comments being preserved?
Re:Node.js: Some quick optimization advice
by spullara on Tuesday October 13, 2015 @12:30PM
(#10381556)
People literally toString functions and parse them to implement features. Those features depend on there being comment text in the function that they parse. Pretty much a terrible hack but it is true that you can't remove the comments without breaking current code.
Re:Node.js: Some quick optimization advice
by alkonaut on Tuesday October 13, 2015 @02:10PM
(#10382312)
Wow. That's just something that should be an obvious fix in a future ES. Not only does it hurt the optimizer, it also seems to imply that the content of comments sometimes has semantic meaning in the code, such as people having invented directives etc.
Surely this must be undocumented features of the language spec?