From unknown Thu Jun 19 12:31:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#41676 <41676@debbugs.gnu.org> To: bug#41676 <41676@debbugs.gnu.org> Subject: Status: 27.0.91; js-beginning-of-defun doesn't handle ES2015 class and arrow functions Reply-To: bug#41676 <41676@debbugs.gnu.org> Date: Thu, 19 Jun 2025 19:31:58 +0000 retitle 41676 27.0.91; js-beginning-of-defun doesn't handle ES2015 class an= d arrow functions reassign 41676 emacs submitter 41676 Brian Leung severity 41676 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 18:06:33 2020 Received: (at submit) by debbugs.gnu.org; 2 Jun 2020 22:06:33 +0000 Received: from localhost ([127.0.0.1]:41216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgF3J-0005ar-Dk for submit@debbugs.gnu.org; Tue, 02 Jun 2020 18:06:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:49730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgF3H-0005ak-W0 for submit@debbugs.gnu.org; Tue, 02 Jun 2020 18:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgF3H-00036n-SH for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2020 18:06:31 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:35241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgF3H-0005dA-4R for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2020 18:06:31 -0400 Received: by mail-ej1-x633.google.com with SMTP id y13so7590eju.2 for ; Tue, 02 Jun 2020 15:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=BIfGOwuvGrzn2SIx1h3lrLNPjM6LJkcCQ8+VkqxUFYI=; b=rCyMbZD8+3daoq1IM31Ifxq2AsNGPpri/x56G6XKLEDvDhu7uun/6RTbBM9NhqDZ6r RR3iAmhi77A8cKLvbttFYrrjan71iaJs1uprHmCgo/4n8C8YYwEWjH1gp4zipWQWuIW5 fFnTJoxiXRxpkzWhQJc/7oXfJnllpkY4v4Feq/cPGckgAQ/0JMD+N+nRM9+BAoTv0++2 dvIMJhlR7pUWvDy6do0+o1/FJGIneaPOUVpt+V0Tfp205OR7jVMxruysM74q+SWKZFUi e5P+RnMGT5pOnc+yFdYJ3jrXDpnOhewdU8cTYr7u99S806VrjebkPiQPjUHAXXgzVrl/ 9+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BIfGOwuvGrzn2SIx1h3lrLNPjM6LJkcCQ8+VkqxUFYI=; b=E7cMH5YFLXLeBPhAQMFBouGtTEA88DZ4dNjdzLQEJV7zOO92CBAHaWNFUxAt+pOFC2 F/TB8gGZCgRgbbLsv0zMUGVjq2SGaHd4D91rN4tKly+xWWNqQKawPMNB3luBQptsgRk+ xZH/+eo2dA/JFA4VKE8DWQGulcbuqG3U1V5SzT2Hbhb0dOueQhVnKAgzJsT82H0AIBgA tAmDaRxTNrhcvNGqBfCxBVY6laP+pALoQ4wuVrXbxU+j5asOEJbqy4ln2oes/VhTcYRx i9t8l17o/QHZdheDHQ5gdTpZpmAnRWuSa9R963E4pzyQulAJxIDsuys3OErXx93bzDEw HEbw== X-Gm-Message-State: AOAM533sLGCMZz2XVyRGPqKFNSs5l61Vsvkf2sEzrbLRI50IEm/qXjnQ YvcP3UpHa/XpTuYnGqIu+5MQOnjv+XpIWacM5Y0QkLBT X-Google-Smtp-Source: ABdhPJyylrR+AhsJB0qLYM8N6ZignhK5pJ4TJ0C9b1Ng+gCVlx9elkDAkPKGUXIx0l/KGtbg+5xsG1RsdBuvRNydZ80= X-Received: by 2002:a17:907:10d1:: with SMTP id rv17mr20855925ejb.51.1591135588621; Tue, 02 Jun 2020 15:06:28 -0700 (PDT) MIME-Version: 1.0 From: Brian Leung Date: Tue, 2 Jun 2020 15:05:52 -0700 Message-ID: Subject: 27.0.91; js-beginning-of-defun doesn't handle ES2015 class and arrow functions To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000008ca1f305a7211f3a" Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=bkleung89@gmail.com; helo=mail-ej1-x633.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --0000000000008ca1f305a7211f3a Content-Type: text/plain; charset="UTF-8" In the following ES2015 file: import * as React from "react"; import { render } from "react-dom"; import SearchParams from "./SearchParams"; class Abc extends React.Component {} const App = () => { return (

Hi

); }; function abc(x) { return 42; } const def = () => { return 1; }; render(, document.getElementById("root")); If you start at the end and use M-: js-beginning-of-defun repeatedly (necessary since in bug #41469 it's clear that beginning-of-defun-function is c-beginning-of-defun), point stops at the ES5 function declaration of abc and then at the imports section, skipping the arrow functions and the class declaration. In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: NixOS 20.09 (Nightingale) --0000000000008ca1f305a7211f3a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In the following ES2015 file:

import * as React fro= m "react";
import { render } from "react-dom";
im= port SearchParams from "./SearchParams";

class Abc extends= React.Component {}

const App =3D () =3D> {
=C2=A0 return (=C2=A0 =C2=A0 <div>
=C2=A0 =C2=A0 =C2=A0 <h1 id=3D"5"= ;>Hi</h1>
=C2=A0 =C2=A0 </div>
=C2=A0 );
};

= function abc(x) {
=C2=A0 return 42;
}

const def =3D () =3D>= {
=C2=A0 return 1;
};

render(<App />, document.getEleme= ntById("root"));



If you start at the end and use M= -: js-beginning-of-defun repeatedly
(necessary since in bug #41469 it= 9;s clear that
beginning-of-defun-function is c-beginning-of-defun), poi= nt stops at the
ES5 function declaration of abc and then at the imports = section,
skipping the arrow functions and the class declaration.

= In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)Windowing system distributor 'The X.Org Foundation', version 11.0= .12008000
System Description: NixOS 20.09 (Nightingale)
--0000000000008ca1f305a7211f3a-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 08 08:38:18 2022 Received: (at control) by debbugs.gnu.org; 8 May 2022 12:38:18 +0000 Received: from localhost ([127.0.0.1]:53632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nngB0-0002Lr-84 for submit@debbugs.gnu.org; Sun, 08 May 2022 08:38:18 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nngAz-0002Lb-E2 for control@debbugs.gnu.org; Sun, 08 May 2022 08:38:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ChgXUY6DOS5mqC6HH611N7rPzmb3FMau/gfV6n8vKXU=; b=rr6E2NQGQ7IyfQbCaNKkJCECcc t9TFbff2Oci7OGDpuoJ+W5QfQggU6d55rF5piK3KRO8E4lJIOCnuZE+Q9kZE5l7Pd1G6AZRFmNOZ9 aNqN7kwQQICSWteYMuRaz9V2Bf3KnrZEi3Bsl5VdsYgunnyXyV+1qZORV00DAzkDPw9g=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nngAr-0008UD-Ku for control@debbugs.gnu.org; Sun, 08 May 2022 14:38:11 +0200 Date: Sun, 08 May 2022 14:38:08 +0200 Message-Id: <87zgjsgpxr.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #28448 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: forcemerge 28448 41676 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) forcemerge 28448 41676 quit