Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit c558455

Browse files
AaronFrielkjin
authored andcommitted
feat: use source-map-support wrapCallSite to apply source maps to call stacks (#1015)
1 parent b06a5bb commit c558455

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@types/request": "^2.48.1",
7070
"@types/semver": "^6.0.0",
7171
"@types/shimmer": "^1.0.1",
72+
"@types/source-map-support": "^0.5.0",
7273
"@types/tmp": "0.1.0",
7374
"@types/uuid": "^3.4.3",
7475
"axios": "^0.18.0",
@@ -90,7 +91,6 @@
9091
"pify": "^4.0.0",
9192
"retry-axios": "^1.0.0",
9293
"rimraf": "^2.6.2",
93-
"source-map-support": "^0.5.6",
9494
"standard-version": "^5.0.0",
9595
"teeny-request": "^3.11.1",
9696
"timekeeper": "^2.0.0",
@@ -110,6 +110,7 @@
110110
"methods": "^1.1.1",
111111
"require-in-the-middle": "^4.0.0",
112112
"semver": "^6.0.0",
113+
"source-map-support": "^0.5.12",
113114
"shimmer": "^1.2.0",
114115
"uuid": "^3.0.1"
115116
}

src/util.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
import * as path from 'path';
17+
import * as sourceMapSupport from 'source-map-support';
18+
1819
const {hexToDec, decToHex}: {[key: string]: (input: string) => string} =
1920
require('hex2dec');
2021

@@ -206,7 +207,7 @@ export function createStackTrace(
206207
const origPrepare = Error.prepareStackTrace;
207208
Error.prepareStackTrace =
208209
(error: Error, structured: NodeJS.CallSite[]): NodeJS.CallSite[] => {
209-
return structured;
210+
return structured.map(sourceMapSupport.wrapCallSite);
210211
};
211212
const e: {stack?: NodeJS.CallSite[]} = {};
212213
Error.captureStackTrace(e, constructorOpt);

0 commit comments

Comments
 (0)