Skip to content

Commit 8aca928

Browse files
committed
debugger: handle gracefully tarantool.debug.getsources
Before 2.10 there were not only `getsources` but whole `tarantool.debug` object also. Handle gracefully this case using optional chaining syntax in TypeScript `tarantool?.debug?.getsources`
1 parent 048b2ae commit 8aca928

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

debugger/debugger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {Thread, mainThread, mainThreadName, isThread} from "./thread";
3939
import * as tarantool from "tarantool";
4040

4141
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
42-
const luaTarantoolGetSources = tarantool.debug.getsources ?? function(filePath: string) {
42+
const luaTarantoolGetSources = tarantool?.debug?.getsources ?? function(filePath: string) {
4343
return null;
4444
};
4545

debugger/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"noHeader": true,
2222
"luaBundle": "lldebugger.lua",
2323
"luaBundleEntry": "lldebugger.ts",
24-
"luaLibImport": "none",
24+
"luaLibImport": "require",
2525
"noResolvePaths": ["tarantool"]
2626
}
2727
}

0 commit comments

Comments
 (0)