Throw error if unsupported setting is set with setmode

This commit is contained in:
Jay Kamat 2021-06-01 23:57:57 -07:00
parent 8a679fb9ba
commit 6adb6879f0
No known key found for this signature in database
GPG key ID: 5D2E399600F4F7B5

View file

@ -3796,6 +3796,8 @@ export function setmode(mode: string, key: string, ...values: string[]) {
if (!mode || !key || !values.length) {
throw new Error("seturl syntax: mode key value")
}
if (key !== "allowautofocus")
throw new Error("Setting '" + key + "' not supported with setmode")
return config.set("modesubconfigs", mode, ...validateSetArgs(key, values))
}