Skip to content

Commit ea8fac3

Browse files
committed
debug,ts - make changes for Deno 1.46 support
1 parent 7f5aa6d commit ea8fac3

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/core/deno/debug.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import * as colors from "colors";
10-
import { warn } from "log/mod.ts";
1110

1211
type StackEntry = {
1312
pos: string;
@@ -48,7 +47,7 @@ export const getStackAsArray = (
4847
/^.*at async (.*)src\/quarto.ts:\d+:\d+$/,
4948
);
5049
if (!m) {
51-
warn(
50+
console.log(
5251
"Could not find quarto.ts in stack trace, is QUARTO_DENO_V8_OPTIONS set with a sufficiently-large stack size?",
5352
);
5453
}
@@ -109,6 +108,20 @@ export const getStackAsArray = (
109108
col: m3[5] + (m3[1] ? 6 : 0),
110109
};
111110
}
111+
112+
// at async Command.execute (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
113+
const m4 = s.match(
114+
/^.*at (async )?(.*) \((http.+):(\d+):(\d+)*\)$/,
115+
);
116+
if (m4) {
117+
return {
118+
pos: m4[3],
119+
name: `${m4[2]}`,
120+
line: m4[4],
121+
// if async, move the column to the start of the actual function name
122+
col: m4[5] + (m4[1] ? 6 : 0),
123+
};
124+
}
112125
throw new Error(`Unexpected stack entry: ${s}`);
113126
});
114127

0 commit comments

Comments
 (0)