1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 23:57:59 +01:00

Update some old references to the deprecated dactyl.globalVariables.

Prefer set.has over Object#hasOwnProperty in :let/:unlet definitions.
This commit is contained in:
Doug Kearns
2011-02-01 18:28:06 +11:00
parent 4b06889126
commit 7d2605456c

View File

@@ -1094,7 +1094,7 @@ var Options = Module("options", {
dactyl.assert(scope == "g:" || scope == null, dactyl.assert(scope == "g:" || scope == null,
"E461: Illegal variable name: " + scope + name); "E461: Illegal variable name: " + scope + name);
dactyl.assert(globalVariables.hasOwnProperty(name) || (expr && !op), dactyl.assert(set.has(globalVariables, name) || (expr && !op),
"E121: Undefined variable: " + fullName); "E121: Undefined variable: " + fullName);
if (!expr) if (!expr)
@@ -1192,13 +1192,13 @@ var Options = Module("options", {
function (args) { function (args) {
for (let [, name] in args) { for (let [, name] in args) {
name = name.replace(/^g:/, ""); // throw away the scope prefix name = name.replace(/^g:/, ""); // throw away the scope prefix
if (!dactyl.globalVariables.hasOwnProperty(name)) { if (!set.has(dactyl._globalVariables, name)) {
if (!args.bang) if (!args.bang)
dactyl.echoerr("E108: No such variable: " + name); dactyl.echoerr("E108: No such variable: " + name);
return; return;
} }
delete dactyl.globalVariables[name]; delete dactyl._globalVariables[name];
} }
}, },
{ {