1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 20:27:58 +01:00

Fix command arg count validation.

This commit is contained in:
Doug Kearns
2010-11-13 23:27:25 +11:00
parent b6cca65f3f
commit 9148d00ede

View File

@@ -269,7 +269,7 @@ const Command = Class("Command", {
get literalArg() this.command.literal != null && this[this.command.literal] || "",
// TODO: string: Class.memoize(function () { ... }),
verify: function verify() {
if (this.argCount) {
if (this.command.argCount) {
dactyl.assert((this.length > 0 || !/^[1+]$/.test(this.command.argCount)) &&
(this.literal == null || !/[1+]/.test(this.command.argCount) || /\S/.test(this.literalArg || "")),
"E471: Argument required");