Skip to content

Commit a67f4e7

Browse files
committed
fixup: revert errLine computation logic
1 parent 7dc8b15 commit a67f4e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/internal/modules/cjs/loader.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const {
5656
StringPrototypeCharCodeAt,
5757
StringPrototypeEndsWith,
5858
StringPrototypeIndexOf,
59-
StringPrototypeLastIndexOf,
6059
StringPrototypeRepeat,
6160
StringPrototypeSlice,
6261
StringPrototypeSplit,
@@ -1650,8 +1649,8 @@ function loadTS(module, filename) {
16501649

16511650
function reconstructErrorStack(err, parentPath, parentSource) {
16521651
const errLine = StringPrototypeSplit(
1653-
StringPrototypeSlice(err.stack, StringPrototypeLastIndexOf(
1654-
err.stack, ' at ')), '\n', 1)[0];
1652+
StringPrototypeSlice(err.stack, StringPrototypeIndexOf(
1653+
err.stack, ' at ')), '\n', 2)[1];
16551654
const { 1: line, 2: col } =
16561655
RegExpPrototypeExec(/(\d+):(\d+)\)/, errLine) || [];
16571656
if (line && col) {

0 commit comments

Comments
 (0)