-
Notifications
You must be signed in to change notification settings - Fork 31.3k
lib: cache source maps in vm sources #52153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
legendecas
wants to merge
1
commit into
nodejs:main
Choose a base branch
from
legendecas:source-maps/vm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
test/fixtures/source-map/output/source_map_disabled_by_api.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Error: an error! | ||
at functionD (*enclosing-call-site-min.js:1:156) | ||
at functionC (*enclosing-call-site-min.js:1:97) | ||
at functionB (*enclosing-call-site-min.js:1:60) | ||
at functionA (*enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*enclosing-call-site-min.js:1:199) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site-min.js:1:156) | ||
at functionC (*/test/fixtures/source-map/enclosing-call-site-min.js:1:97) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site-min.js:1:60) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site-min.js:1:199) | ||
Error: an error! | ||
at functionD (*enclosing-call-site.js:16:17) | ||
at functionC (*enclosing-call-site.js:10:3) | ||
at functionB (*enclosing-call-site.js:6:3) | ||
at functionA (*enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*enclosing-call-site.js:24:3) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site.js:16:17) | ||
at functionC (*/test/fixtures/source-map/enclosing-call-site.js:10:3) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site.js:6:3) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site.js:24:3) |
20 changes: 10 additions & 10 deletions
20
test/fixtures/source-map/output/source_map_enabled_by_api.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Error: an error! | ||
at functionD (*enclosing-call-site.js:16:17) | ||
at functionC (*enclosing-call-site.js:10:3) | ||
at functionB (*enclosing-call-site.js:6:3) | ||
at functionA (*enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*enclosing-call-site.js:24:3) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site.js:16:17) | ||
at functionC (*/test/fixtures/source-map/enclosing-call-site.js:10:3) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site.js:6:3) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site.js:24:3) | ||
Error: an error! | ||
at functionD (*enclosing-call-site-min.js:1:156) | ||
at functionC (*enclosing-call-site-min.js:1:97) | ||
at functionB (*enclosing-call-site-min.js:1:60) | ||
at functionA (*enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*enclosing-call-site-min.js:1:199) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site-min.js:1:156) | ||
at functionC (*/test/fixtures/source-map/enclosing-call-site-min.js:1:97) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site-min.js:1:60) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site-min.js:1:199) |
12 changes: 6 additions & 6 deletions
12
test/fixtures/source-map/output/source_map_enclosing_function.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
*enclosing-call-site.js:26 | ||
*/test/fixtures/source-map/enclosing-call-site.js:26 | ||
throw err | ||
^ | ||
|
||
|
||
Error: an error! | ||
at functionD (*enclosing-call-site.js:16:17) | ||
at functionC (*enclosing-call-site.js:10:3) | ||
at functionB (*enclosing-call-site.js:6:3) | ||
at functionA (*enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*enclosing-call-site.js:24:3) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site.js:16:17) | ||
at functionC (*/test/fixtures/source-map/enclosing-call-site.js:10:3) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site.js:6:3) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site.js:24:3) | ||
|
||
Node.js * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
*tabs.coffee:26 | ||
/synthethized/workspace/tabs.coffee:26 | ||
alert "I knew it!" | ||
^ | ||
|
||
|
||
ReferenceError: alert is not defined | ||
at Object.eval (*tabs.coffee:26:2) | ||
at eval (*tabs.coffee:1:14) | ||
at Object.<anonymous> (*output*source_map_eval.js:10:1) | ||
at Object.eval (/synthethized/workspace/tabs.coffee:26:2) | ||
at eval (/synthethized/workspace/tabs.coffee:1:14) | ||
at Object.<anonymous> (*/test/fixtures/source-map/output/source_map_eval.js:11:1) | ||
|
||
Node.js * |
6 changes: 3 additions & 3 deletions
6
test/fixtures/source-map/output/source_map_no_source_file.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
*no-source.js:2 | ||
*/test/fixtures/source-map/no-source.js:2 | ||
throw new Error('foo'); | ||
^ | ||
|
||
Error: foo | ||
at Throw (*file-not-exists.ts:2:9) | ||
at Object.<anonymous> (*file-not-exists.ts:5:1) | ||
at Throw (*/test/fixtures/source-map/file-not-exists.ts:2:9) | ||
at Object.<anonymous> (*/test/fixtures/source-map/file-not-exists.ts:5:1) | ||
|
||
Node.js * |
16 changes: 8 additions & 8 deletions
16
test/fixtures/source-map/output/source_map_prepare_stack_trace.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Error: an error! | ||
at functionD (*enclosing-call-site.js:16:17) | ||
at functionB (*enclosing-call-site.js:6:3) | ||
at functionA (*enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*enclosing-call-site.js:24:3) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site.js:16:17) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site.js:6:3) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site.js:2:3) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site.js:24:3) | ||
Error: an error! | ||
at functionD (*enclosing-call-site-min.js:1:156) | ||
at functionB (*enclosing-call-site-min.js:1:60) | ||
at functionA (*enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*enclosing-call-site-min.js:1:199) | ||
at functionD (*/test/fixtures/source-map/enclosing-call-site-min.js:1:156) | ||
at functionB (*/test/fixtures/source-map/enclosing-call-site-min.js:1:60) | ||
at functionA (*/test/fixtures/source-map/enclosing-call-site-min.js:1:26) | ||
at Object.<anonymous> (*/test/fixtures/source-map/enclosing-call-site-min.js:1:199) |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What’s the difference between a “source URL” and a “source map URL”? My naïve guess is that a source URL is a
file:
URL to the module itself, and a source map URL is either afile:
URL to a.map
file or adata:
URL with the source map. I feel like these guesses are probably wrong, though, so these variables should at least get comments or perhaps get better names (since you reuse these names across many files).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your guess is correct.
SourceURL
is used to specify the URL of the eval-ed source, as described in https://tc39.es/source-map/#linking-evald-code-to-named-generated-code. However, it can be present in sources loaded by CJS/ESM loaders from filesystem as well. V8 will take this magic comment and report errors with it as the script resource name instead:node/src/node_errors.cc
Lines 62 to 65 in f1949ac
The name,
source url
, is taken from the magic comments as: