News for hackers. Stuff that matters.
Re:COBOL bridge for Node.js by _1 on Monday August 17, 2015 @09:03AM (#10072652)
(Not a JS'er) You can pass a comment as a parameter?
Re:COBOL bridge for Node.js by marpstar on Monday August 17, 2015 @09:10AM (#10072686)
not in the language itself, but you can obtain the full text of a function, detect the comment and parse it, and inject it where ever it needs to go.
Re:COBOL bridge for Node.js by STRML on Monday August 17, 2015 @10:13AM (#10073057)
Yep. "Passing a comment" is used by calling .toString() on the function. It fails when using minification for obvious reasons but of course you wouldn't on Node code.

It's a clever hack around JS's awful multiline string support. But with ES6 template strings it's not really needed anymore.

Re:COBOL bridge for Node.js by untog on Monday August 17, 2015 @09:58AM (#10072966)
You can, but I'm a little confused as to why you would, instead of just passing a string.

Fits in with the esoteric nature of the library, though.

Re:COBOL bridge for Node.js by maxmcd on Monday August 17, 2015 @10:34AM (#10073219)
Possibly because multiline strings are not supported?
Re:COBOL bridge for Node.js by ivank on Monday August 17, 2015 @10:43AM (#10073290)
ES6 template strings can span multiple lines.