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 kNWBGGUpPWRQLQEASxT56A (envelope-from ) for ; Mon, 17 Apr 2023 13:11:33 +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 qBKSF2UpPWQmZwEAG6o9tA (envelope-from ) for ; Mon, 17 Apr 2023 13:11:33 +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 0E5DFC533 for ; Mon, 17 Apr 2023 13:11:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poMlD-0007mu-1Z; Mon, 17 Apr 2023 07:11:03 -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 1poMlB-0007mL-Iw for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 07:11:01 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poMkr-0000lG-Le for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 07:11:01 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CE2A92401F6 for ; Mon, 17 Apr 2023 13:10:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681729837; bh=sdsJ6eXw54+rPbCemPyfxJjFJF8cIqTCaFk5oP/sW0M=; h=From:To:Cc:Subject:Date:From; b=Yy27FSV1I5dS5K/ViQzeQaMO3MXXlQ9gkmP4dysV9yGdSirDJ/2WAOJsnYMTs5QL2 sA4Bq6GM1ogjvR6yA2Mrg6mzYJG96FSOuceqGKLnuxQ/VvG7fnbNEMuzXVz1sJjz8q 8WQ4Ndi9LS8amz3dCwuCpSmwDfWH8yCRYkT5Wf7DaWktqbYEckW+dBXlt+BnEdn7ak /lZA2Ui/o0Gwr9Wq90LRC3QNeUzNEIeJn9wTSK3iCT/fKO9LayRDQhVOXyU0v8uV7N XmjN3ET85H8B8eOlFHhp01dpUF3JfLHn5yBgZn1VQKQIgXAVh0CfjnfDsssvCF/WgN /CqR6S5vacEBQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q0PVP0XKFz9rxD; Mon, 17 Apr 2023 13:10:37 +0200 (CEST) From: Ihor Radchenko To: sgherdao@tuta.io Cc: Emacs Orgmode Subject: Re: [BUG] ob-js "SyntaxError: Unexpected end of input" when code block ends with comment In-Reply-To: References: Date: Mon, 17 Apr 2023 11:13:13 +0000 Message-ID: <87r0silq2e.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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: , 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=1681729893; a=rsa-sha256; cv=none; b=ml1Wwb3/D+XsE3EQMevFXN18mi+i2werWdA3xoFaw6wM2wgim40sI/KRcGWR6+Im0GCCfi HLRQ+UrXulnjGZME+6ypkPMI2lIawUtBJjUPKHFvYPR/GQ+b8UP6bTjtrMCa5p4o9XFCdy 5PzS6Rj+8J//mZ3nGFC7QwfXlx+xzwq9Epmz8mlqqgsi+INfuyBDqiWcamoGVfYR5ex6Qj m68P/lsYYzQ5eC5qGA5US0g3TkvhUnUEjKIN3wCSfjFvbF9rU/fYorH/vtm5yddqb46L4e Sm7k1oLZuUqtPUfdHQBoSmlBK9fFOKoLWADUUES1QVPpzoDp33mz1Ae+9/JReQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Yy27FSV1; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681729893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=sdsJ6eXw54+rPbCemPyfxJjFJF8cIqTCaFk5oP/sW0M=; b=RHSblwNxKm3FuR7WYJgm97fAjt6YV/3IEz8aZ5vSKjgsgSTvl3UZtpUyR9N3GV4bF17FFP +JyHIz1AOFaRHCe/QHQO9XaE+XT/Q93zzsbCBcmUvWIVPgUSGRv46zo25dK+vL6a+KfVbF G6kQvAbwNmhmXad+4WHFQkSq7FnEEGbSNF4SK9yB/uiGa7ryEuCxicz+12ldxh52xN5D9o Rl6UftFieQbm0shDUP/KpFvgDbzTlhAEVSCua5e19REo0CBDy303RVkhNRfmV+Bj9jXbMs YZYDJR4Hv4M9aU7nsaMB70hj5Wsvv9LVE1ZBVy2YWVX3fKgrPFoW2SIn9ahy9A== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.20 X-Spam-Score: -6.20 X-Migadu-Queue-Id: 0E5DFC533 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Yy27FSV1; 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"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: WYsK1oKxxDxk 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=3D7d8a9324f --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at