Skip to content

Commit 2c7f1f8

Browse files
authored
Merge pull request #2 from tsafin/tsafin/tarantool-support
Conditional tarantool.debug.getsources() usage
2 parents 7b2fc46 + ec36f0b commit 2c7f1f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

debugger/debugger.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ import {Thread, mainThread, mainThreadName, isThread} from "./thread";
3838

3939
import * as tarantool from "tarantool";
4040

41+
const luaTarantoolGetSources =
42+
tarantool.debug.getsources ??
43+
function (filePath: string): null {
44+
return null;
45+
};
46+
4147
export interface Var {
4248
val: unknown;
4349
type: string;
@@ -513,7 +519,7 @@ export namespace Debugger {
513519
} else {
514520
// eslint-disable-next-line max-len
515521
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
516-
const content: string | null = tarantool.debug.getsources(`@${path}`);
522+
const content: string | null = luaTarantoolGetSources(`@${path}`);
517523
if (typeof content === "string") {
518524
Send.result(content);
519525
} else {

0 commit comments

Comments
 (0)