-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
bae14b7
commit 44aa272
Showing
35 changed files
with
284 additions
and
101 deletions.
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 * |
Oops, something went wrong.