Skip to content

Conditional tarantool.debug.getsources() usage #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion debugger/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ import {Thread, mainThread, mainThreadName, isThread} from "./thread";

import * as tarantool from "tarantool";

const luaTarantoolGetSources =
tarantool.debug.getsources ??
function (filePath: string): null {
return null;
};

export interface Var {
val: unknown;
type: string;
Expand Down Expand Up @@ -513,7 +519,7 @@ export namespace Debugger {
} else {
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
const content: string | null = tarantool.debug.getsources(`@${path}`);
const content: string | null = luaTarantoolGetSources(`@${path}`);
if (typeof content === "string") {
Send.result(content);
} else {
Expand Down