Skip to content

lib: cache source maps in vm sources

Cache source maps found in sources parsed with vm.Script, vm.compileFunction, and vm.SourceTextModule. Also, retrieve source url from V8 parsing results.

Not like filenames returned by CallSite.getFileName() in translating stack traces, when generating source lines prepended to exceptions, only resource names can be used as an index to find source maps, which can be source url magic comments instead. Source url magic comments can be either a file path or a URL. To verify that source urls with absolute file paths in the source lines are correctly translated, snapshots should include the full snapshot urls rather than neutralizing all the path strings in the stack traces.

Fixes: https://github.com/nodejs/node/issues/52102

Merge request reports

Loading