From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id UG6SLODIPWRD0wAASxT56A (envelope-from ) for ; Tue, 18 Apr 2023 00:32:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wK+RK+DIPWR0AQAAG6o9tA (envelope-from ) for ; Tue, 18 Apr 2023 00:32:00 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 35756AC82 for ; Tue, 18 Apr 2023 00:32:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poXNB-0005KJ-3F; Mon, 17 Apr 2023 18:30:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poXN9-0005Jv-TF for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 18:30:55 -0400 Received: from w4.tutanota.de ([81.3.6.165]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poXN8-0003sF-4D for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 18:30:55 -0400 Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id D845F10602C4; Mon, 17 Apr 2023 22:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1681770649; s=s1; d=tuta.io; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=y7zv70RqRSbm2vOvlJcYGL40dAwwU0E5tpizR61CSYg=; b=htpX/DYgUqKZq4jFqOC3qtxTvQ30bY8dRSq5g5J8ExurzBOYZiUfFArXXTZFFAob 3hL9qDqvOW5VwhIdfNlAS6wr9ExuaHJHl0LIfAHlr93zf0j+ES1ukHik/fCr5KJoceN 9hMAQuMoG+wLUeiGsbcGg7xIPhRG9v4uQ0YDEWD/tQv3mraT3/FhZ4IMTbjQSD54Jn1 mDSj1/d8EBoMQudSlbU+iRY7109tHIKATdDy1AIPPvjNWiOJS70jZcqv+RrUWjXzjBF tET8Ke5EoBSz92JGKpi72UL2Td15Rnc6E/EhuQROfVHRBT47XscimPQBdFF91WWgZug /25fCUk32Q== Date: Tue, 18 Apr 2023 00:30:49 +0200 (CEST) To: Ihor Radchenko Cc: Emacs Orgmode Message-ID: In-Reply-To: <87r0silq2e.fsf@localhost> References: <87r0silq2e.fsf@localhost> Subject: Re: [BUG] ob-js "SyntaxError: Unexpected end of input" when code block ends with comment MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_356337_1710199854.1681770649867" Received-SPF: pass client-ip=81.3.6.165; envelope-from=sgherdao@tuta.io; helo=w4.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: sgherdao@tuta.io From: sgherdao--- via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681770720; a=rsa-sha256; cv=none; b=S20iYpDeZ21H+zLImcjF6Cp6oGdaOlWJNe211C/4V1Sy/tfcgEyiBQ5ym5tNdqSKRA086S oyJjraNRj9kV2RDo78o+eJuShZfA48mTc9EQAsEMde+hxpyTiYYhpgKQaJdQJC+Aej1F3u xINGBE//K900w7dubEkhgaVuv46kP688z++hZbU6j0YJZFF25zUdmuz1ejBqY3vaHZRLnv a2ACJbpQsukwRy8S5itO2WTZ4wTVNWQyH8rtSZvVaPk13Y+6GrCqxE0pThAgV5Ewjz/CDn YRbo+D4yHEc06qZ+9OE5LcBqK6iFgU880FNric6zB8gg41MrrVUuIOTKne4TUg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tuta.io header.s=s1 header.b="htpX/DYg"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681770720; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=y7zv70RqRSbm2vOvlJcYGL40dAwwU0E5tpizR61CSYg=; b=ABync2onYnDSOOS01wZBeiPJ/57YemjxZzH7p7jOe0rxgm9lH1V07UcQWsSAzDCjbuJgnR ajb/uXnrl+qDb1ZsfKcfDOCCQ+bqHCWQceyKN7QBZ1d7mEL1j7BNbaOzFbpo3ggDrJDd2I k2CXm3yUtblufdarby4NIRqGtHMH9PEGhccZe+mwRITHk7VWFFZvSO7wMG4GJloN0N83lb M0XuXroWq+w1INhhzgBHIflaNtUE4s0x2ih938Ff5FWHkqVCa9pXbnd4N6KuUhyvCiuY1B vSlDrSVv6o3WMGsvt60/j5S4RJamOJw/xpqpgQdYHklTKQWr9wgN/XQu6GsQzw== X-Migadu-Queue-Id: 35756AC82 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tuta.io header.s=s1 header.b="htpX/DYg"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.51 X-Spam-Score: -3.51 X-TUID: SrKt2qKqZPtF ------=_Part_356337_1710199854.1681770649867 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Happy to help and thanks for fixing it so quickly:) Best regards, -- Salah=C2=A0 Apr 17, 2023 at 12:10 by yantar92@posteo.net: > sgherdao--- via "General discussions about Org-mode." > writes: > >> The following code snippet fails to execute >> >> #+begin_src js >> console.log("Hello Friends!"); >> // -> logs "Hello Friends" >> #+end_src >> >> I encounter the following error message: >> >> #+begin_src text >> /tmp/js-script-dn2Wrp:2 >> // -> logs "Hello Friends"}())); >> >> SyntaxError: Unexpected end of input >> ... >> As a simple fix, I have added a \n after %s >> >> #+begin_src emacs-lisp >> (defvar org-babel-js-function-wrapper >> =C2=A0 "require('process').stdout.write(require('util').inspect(function= (){%s\n}()));" >> =C2=A0 "Javascript code to print value of body.") >> #+end_src >> > > Thanks for reporting and providing a fix! > Fixed, on bugfix. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3D7d8a932= 4f > > --=20 > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > ------=_Part_356337_1710199854.1681770649867 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Happy to help and thanks for fixing it so quickly:)

Best regards,
--
Salah 



Apr 17, 2023 at 12:10 by ya= ntar92@posteo.net:
= sgherdao--- via "General discussions about Org-mode."
<ema= cs-orgmode@gnu.org> writes:
The following code= snippet fails to execute

#+begin_src js
console.log("Hello Friends!");
// -> logs "Hello = Friends"
#+end_src

I encounter t= he following error message:

#+begin_src text
/tmp/js-script-dn2Wrp:2
// -> logs "Hello Fri= ends"}()));

SyntaxError: Unexpected end of inp= ut
...
As a simple fix, I have added a \n after= %s

#+begin_src emacs-lisp
(defv= ar org-babel-js-function-wrapper
  "require('process').s= tdout.write(require('util').inspect(function(){%s\n}()));"
&n= bsp; "Javascript code to print value of body.")
#+end_src
=

Thanks for reporting and providing a= fix!
Fixed, on bugfix.
https://git.savannah.gn= u.org/cgit/emacs/org-mode.git/commit/?id=3D7d8a9324f

--
Ihor Radchenko // yantar92,
Org mode= contributor,
Learn more about Org mode at <https://orgmod= e.org/>.
Support Org development at <https://liberapay.= com/org-mode>,
or support my work at <https://liberapay= .com/yantar92>

------=_Part_356337_1710199854.1681770649867--