1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 04:45:45 +01:00

Use real Sets rather than objects in most places.

This commit is contained in:
Kris Maglione
2014-02-15 18:10:45 -08:00
parent e3fb435f99
commit fd20535999
29 changed files with 353 additions and 262 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2009-2013 Kris Maglione <maglione.k@gmail.com>
// Copyright (c) 2009-2014 Kris Maglione <maglione.k@gmail.com>
// Copyright (c) 2009-2010 by Doug Kearns <dougkearns@gmail.com>
//
// This work is licensed for reuse under an MIT license. Details are
@@ -164,7 +164,8 @@ var Addon = Class("Addon", {
},
commandAllowed: function commandAllowed(cmd) {
util.assert(Set.has(actions, cmd), _("addon.unknownCommand"));
util.assert(hasOwnProperty(actions, cmd),
_("addon.unknownCommand"));
let action = actions[cmd];
if ("perm" in action && !(this.permissions & AddonManager["PERM_CAN_" + action.perm.toUpperCase()]))