Skip to content

lib: recognize <LS> and <PS> as line terminators - #67695

Open
LiviaMedeiros wants to merge 1 commit into
nodejs:mainfrom
LiviaMedeiros:lib-recognize-funny-line-terminators
Open

LiviaMedeiros wants to merge 1 commit into
nodejs:mainfrom
LiviaMedeiros:lib-recognize-funny-line-terminators

Conversation

@LiviaMedeiros

Copy link
Copy Markdown
Member

Currently, ECMAScript line terminators are \u000a, \u000d, \u2028, and \u2029. So for example

// this ensures that on prod nothing runs debug-only <LS>exposeUnprotectedRootShell();
const _DEBUG = false;

...would actually run the code after <LS> because it terminated the comment.

Let's recognize them in regexps that parse code.

Refs: https://tc39.es/ecma262/#sec-line-terminators

Signed-off-by: LiviaMedeiros <livia@cirno.name>
@LiviaMedeiros LiviaMedeiros added the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Nov 22, 2026
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. source maps Issues and PRs related to source map support. util Issues and PRs related to the built-in util module. labels Nov 22, 2026
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.61%. Comparing base (2b365b2) to head (83f3c31).
⚠️ Report is 65 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67695      +/-   ##
==========================================
+ Coverage   90.58%   90.61%   +0.02%     
==========================================
  Files         801      801              
  Lines      281090   281089       -1     
  Branches    54264    54261       -3     
==========================================
+ Hits       254639   254696      +57     
+ Misses      16623    16574      -49     
+ Partials     9828     9819       -9     
Files with missing lines Coverage Δ
lib/internal/util/inspect.js 97.03% <100.00%> (-0.01%) ⬇️

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2026

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gurgunday gurgunday added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. source maps Issues and PRs related to source map support. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants