use /break as return statement in /run

This commit is contained in:
LenAnderson 2024-07-04 12:31:27 -04:00
parent 6193b6590e
commit e4ab5d7d02
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,7 @@ import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandE
import { POPUP_TYPE, Popup, callGenericPopup } from './popup.js'; import { POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js'; import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
import { SlashCommandDebugController } from './slash-commands/SlashCommandDebugController.js'; import { SlashCommandDebugController } from './slash-commands/SlashCommandDebugController.js';
import { SlashCommandBreakController } from './slash-commands/SlashCommandBreakController.js';
export { export {
executeSlashCommands, executeSlashCommandsWithOptions, getSlashCommandsHelp, registerSlashCommand, executeSlashCommands, executeSlashCommandsWithOptions, getSlashCommandsHelp, registerSlashCommand,
}; };
@ -1782,6 +1783,7 @@ async function runCallback(args, name) {
throw new Error(`"${name}" is not callable.`); throw new Error(`"${name}" is not callable.`);
} }
closure.scope.parent = scope; closure.scope.parent = scope;
closure.breakController = new SlashCommandBreakController();
if (args._debugController && !closure.debugController) { if (args._debugController && !closure.debugController) {
closure.debugController = args._debugController; closure.debugController = args._debugController;
} }