1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-30 15:23:31 +02:00

Employ dactyl.assert where appropriate in Melodactyl.

This commit is contained in:
Doug Kearns
2010-10-21 15:25:54 +11:00
parent d196061b16
commit 48dd94773e
3 changed files with 22 additions and 41 deletions

View File

@@ -211,12 +211,8 @@ const Config = Module("config", ConfigBase, {
"Close a display pane",
function (args) {
let arg = args.literalArg;
if (arg in Config.displayPanes)
Config.closeDisplayPane(Config.displayPanes[arg]);
else
dactyl.echoerr("E475: Invalid argument: " + arg);
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg);
Config.closeDisplayPane(Config.displayPanes[arg]);
},
{
argCount: "1",
@@ -229,12 +225,9 @@ const Config = Module("config", ConfigBase, {
"Open a display pane",
function (args) {
let arg = args.literalArg;
if (arg in Config.displayPanes)
Config.openDisplayPane(Config.displayPanes[arg]);
// TODO: focus when we have better key handling of these extended modes
else
dactyl.echoerr("E475: Invalid argument: " + arg);
dactyl.assert(arg in Config.displayPanes, "E475: Invalid argument: " + arg);
// TODO: focus when we have better key handling of these extended modes
Config.openDisplayPane(Config.displayPanes[arg]);
},
{
argCount: "1",