GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: implement source map scopes decoder by legendecas · Pull Request #67594 · nodejs/node

Conversation

@legendecas

@legendecas legendecas commented Nov 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Implements the TC39 Source Maps Stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md proposal decoder. This does not implement the stack trace formatter of the scopes. The stack trace formatter will be in a follow-up.

The Source Maps Scopes proposal would allow Node.js to print a human readable stacktrace variable and function names, with inlined function frames.

For example, a transpiler inlines inner into outer, renames outer to a, and calls it through a generated helper h:

// original.js
function outer() {
  inner();
}
function inner() {
  throw new Error('boom');
}
outer();

// generated.js
function a() {
  throw new Error('boom');
}
function h(f) {
  return f();
}
h(a);
//# sourceMappingURL=generated.js.map

Without scopes info, Node.js prints a stack trace like:

Error: boom
    at a (/path/to/original.js:5:9)
    at global (/path/to/original.js:5:9)
    at Object.<anonymous> (/path/to/original.js:7:1)

With the scopes in the source map, the stack trace can show the original
functions, restore the inlined inner frame, and leave out the helper h:

Error: boom
    at inner (/path/to/original.js:5:9)
    at outer (/path/to/original.js:2:3)
    at Object.<anonymous> (/path/to/original.js:7:1)

The first commit moves the VLQ decoder into a dedicated vlq.js so that the decoder can be shared by the regular Source Maps parser and the new Scopes parser.

The new decoder is tested against https://github.com/tc39/source-map-tests/tree/main/decoding in the test/test262 suite.


Assisted-by: Claude

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

robpalme and bricss reacted with hooray emoji
All reactions
  • 🎉 2 reactions
@legendecas legendecas added the source maps Issues and PRs related to source map support. label Nov 18, 2026
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 18, 2026
@legendecas
legendecas force-pushed the source-maps-scopes branch from 5e9ad3d to 823b559 Compare November 18, 2026 21:44
@codecov

codecov Bot commented Nov 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.40048% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.73%. Comparing base (030745c) to head (3e58349).
⚠️ Report is 97 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/source_map/scopes.js 89.74% 59 Missing and 2 partials ⚠️
lib/internal/source_map/source_map.js 98.21% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67594      +/-   ##
==========================================
+ Coverage   90.72%   90.73%   +0.01%     
==========================================
  Files         801      803       +2     
  Lines      280960   281708     +748     
  Branches    54260    54361     +101     
==========================================
+ Hits       254892   255617     +725     
- Misses      16248    16257       +9     
- Partials     9820     9834      +14     
Files with missing lines Coverage Δ
lib/internal/source_map/vlq.js 100.00% <100.00%> (ø)
lib/internal/source_map/source_map.js 99.30% <98.21%> (-0.33%) ⬇️
lib/internal/source_map/scopes.js 89.74% <89.74%> (ø)

... and 34 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

guybedford
guybedford approved these changes Nov 18, 2026
View reviewed changes
legendecas added 2 commits November 20, 2026 09:14
@legendecas
lib: move source map VLQ decoding into its own module
ffeec0c
Signed-off-by: Chengzhong Wu <[email protected]>
@legendecas
lib: implement source map scopes decoder
3e58349
Implements the stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md
proposal decoder. This does not implement the stack trace formatter of
the scopes. The stack trace formatter will be in a follow-up.

Signed-off-by: Chengzhong Wu <[email protected]>
@legendecas
legendecas force-pushed the source-maps-scopes branch from 823b559 to 3e58349 Compare November 20, 2026 14:14
jasnell
jasnell approved these changes Nov 22, 2026
View reviewed changes
@legendecas legendecas added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 23, 2026
@github-actions github-actions Bot removed 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 23, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79452/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@legendecas legendecas added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. labels Nov 23, 2026
nodejs-github-bot pushed a commit that referenced this pull request Nov 23, 2026
@legendecas @nodejs-github-bot
lib: move source map VLQ decoding into its own module
b11733a
Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: #67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Landed in 3ece3fd...527dd80

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nodejs-github-bot pushed a commit that referenced this pull request Nov 23, 2026
@legendecas @nodejs-github-bot
lib: implement source map scopes decoder
527dd80
Implements the stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md
proposal decoder. This does not implement the stack trace formatter of
the scopes. The stack trace formatter will be in a follow-up.

Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: #67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@nodejs-github-bot nodejs-github-bot closed this Nov 23, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 23, 2026
@legendecas
legendecas deleted the source-maps-scopes branch November 23, 2026 16:57
aduh95 pushed a commit that referenced this pull request Nov 24, 2026
@legendecas @aduh95
lib: move source map VLQ decoding into its own module
e18a140
Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: #67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 24, 2026
@legendecas @aduh95
lib: implement source map scopes decoder
8e620b9
Implements the stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md
proposal decoder. This does not implement the stack trace formatter of
the scopes. The stack trace formatter will be in a follow-up.

Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: #67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@legendecas @gabylb
lib: move source map VLQ decoding into its own module
5b2a22e
Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: nodejs#67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@legendecas @gabylb
lib: implement source map scopes decoder
93f8acd
Implements the stage 3 https://github.com/tc39/ecma426/blob/main/proposals/scopes.md
proposal decoder. This does not implement the stack trace formatter of
the scopes. The stack trace formatter will be in a follow-up.

Signed-off-by: Chengzhong Wu <[email protected]>
PR-URL: nodejs#67594
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@guybedford guybedford guybedford approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. needs-ci PRs that need a full CI run. source maps Issues and PRs related to source map support.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@legendecas @nodejs-github-bot @jasnell @guybedford
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.