mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-10-20 22:15:42 +02:00
Add guard to mappings.add similar to that in commands.add, preventing external scripts from adding builtin mappings.
This commit is contained in:
1 parent
61c1111aab
commit
5eda487e43
1 file changed
+3
@@ -338,6 +338,9 @@ var Mappings = Module("mappings", {
|
||||
* @optional
|
||||
*/
|
||||
add: function () {
|
||||
util.assert(util.isDactyl(Components.stack.caller),
|
||||
"User scripts may not add builtin mappings. Please use group.mappings.add instead.");
|
||||
|
||||
let map = this.builtin.add.apply(this.builtin, arguments);
|
||||
map.definedAt = contexts.getCaller(Components.stack.caller);
|
||||
return map;
|
||||
|
||||
Reference in new issue
Block a user