Skip to content

Commit ec36f0b

Browse files
committed
tarantool.d.ts usage
- Conditional call to tarantool.debug.getsources() (to make it work with unpatched tarantool executables also);
1 parent 7b2fc46 commit ec36f0b

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)