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?
[ Parent
| on HN ]
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.
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.
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.
Possibly because multiline strings are not supported?