all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#47488: Treatment of # in js.el
@ 2021-03-29 21:28 Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-03-30  0:50 ` Dmitry Gutov
  2021-05-08 12:43 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 17+ messages in thread
From: Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-03-29 21:28 UTC (permalink / raw)
  To: 47488

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

I started using private class fields, as described here
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields>
(a stage 3 proposal that is widely implemented, though not actually
standardized yet AFAICT).

These are normal fields that start with a hash.

I find in js--proper-indentation the line (annotated by git blame):

17b5d0f7077 (Chong Yidong         2009-08-14 2864)           ((eq
(char-after) ?#) 0)

It sets the indentation for a line starting with # unconditionally to 0. I
cannot find any other use of # in JavaScript that would justify treating
lines starting with # apparently like C preprocessor macros. There is other
related code, and it all seems to go back to when js.el was first installed
in Emacs.

Is this just because the code was originally based on cc-mode or something,
and the references to hash were never removed? Or was cpp used with early
JavaScript?? I see references such as js--opt-cpp-start which says "Regexp
matching the prefix of a cpp directive", and a match for "#define" in
js--update-quick-match-re.

I cannot see any code in js-tests.el that tests this cpp-related
functionality.

Is there some reason to keep the cpp-related code in js.el? I presume
removing it would simplify then adding support for private class fields;
indeed, maybe no particular support is needed if cpp support is first
removed.

-- 
https://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 3065 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-05-12 14:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-29 21:28 bug#47488: Treatment of # in js.el Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-30  0:50 ` Dmitry Gutov
2021-05-08 12:43 ` Lars Ingebrigtsen
2021-05-09 11:18   ` Dmitry Gutov
2021-05-09 11:31     ` Dmitry Gutov
2021-05-10  8:29     ` Lars Ingebrigtsen
2021-05-10 12:12       ` Dmitry Gutov
2021-05-10  8:34     ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-10 12:14       ` Dmitry Gutov
2021-05-11 12:21         ` Lars Ingebrigtsen
2021-05-11 12:45           ` Dmitry Gutov
2021-05-12 13:32             ` Lars Ingebrigtsen
2021-05-12 13:53               ` Eli Zaretskii
2021-05-12 13:56                 ` Lars Ingebrigtsen
2021-05-12 14:39                 ` Andreas Schwab
2021-05-12 14:49                   ` Eli Zaretskii
2021-05-12 14:56               ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.