util: preserve function names without source map names · nodejs/node@6ca9c1e · GitHub
Skip to content

Commit 6ca9c1e

Browse files
privatenumberaduh95
authored andcommitted
util: preserve function names without source map names
Signed-off-by: Hiroki Osame <hiroki.osame@gmail.com> PR-URL: #65108 Fixes: #65104 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent eacd65e commit 6ca9c1e

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

lib/util.js

Lines changed: 1 addition & 2 deletions

test/fixtures/source-map/get-call-sites-function-name-mapped.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"version": 3,
3+
"sources": ["get-call-sites-function-name-original.js"],
4+
"sourcesContent": ["const { getCallSites } = require('node:util'); function foo() { process.stdout.write(JSON.stringify(getCallSites({ sourceMap: true })[0])); } foo();"],
5+
"mappings": "AAAA,KAAM,CAAE,YAAa,EAAI,QAAQ,WAAW,EAAG,SAAS,KAAM,CAAE,QAAQ,OAAO,MAAM,KAAK,UAAU,aAAa,CAAE,UAAW,EAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAG,CAAE,IAAI",
6+
"names": []
7+
}

test/parallel/test-util-getcallsites-sourcemap.js

Lines changed: 12 additions & 0 deletions

0 commit comments

Comments
 (0)