Skip to content

lib: suppress source map lookup exceptions#56299

Merged
aduh95 merged 2 commits into
nodejs:mainfrom
legendecas:source-maps/path-url
Dec 20, 2024
Merged

lib: suppress source map lookup exceptions#56299
aduh95 merged 2 commits into
nodejs:mainfrom
legendecas:source-maps/path-url

Conversation

@legendecas

@legendecas legendecas commented Dec 17, 2024

Copy link
Copy Markdown
Member

lib: skip parsing invalid source maps

When the source map data are invalid json strings, skip construct
SourceMap on it. Additionally, suppress exceptions on source map lookups
and fix test runners crash on invalid source maps.

lib: optimize prepareStackTrace on builtin frames

Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
array.map.

                                                      confidence improvement accuracy (*)   (**)  (***)
es/error-stack.js n=100000 method='sourcemap'                ***     78.04 %       ±1.27% ±1.70% ±2.24%
es/error-stack.js n=100000 method='without-sourcemap'                 0.27 %       ±1.09% ±1.45% ±1.89%

Refs: #56296

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. needs-ci PRs that need a full CI run. source maps Issues and PRs related to source map support. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants