summaryrefslogtreecommitdiff
path: root/lisp/org/ob-js.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/ob-js.el')
-rw-r--r--lisp/org/ob-js.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el
index 910c1168667..de7ea91317f 100644
--- a/lisp/org/ob-js.el
+++ b/lisp/org/ob-js.el
@@ -69,7 +69,10 @@
:safe #'stringp)
(defvar org-babel-js-function-wrapper
- "require('process').stdout.write(require('util').inspect(function(){%s}()));"
+ ;; Note that newline after %s - it makes sure that closing
+ ;; parenthesis are not shadowed if the last line of the body is a
+ ;; line comment.
+ "require('process').stdout.write(require('util').inspect(function(){%s\n}()));"
"Javascript code to print value of body.")
(defun org-babel-execute:js (body params)