mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 23:44:11 +01:00
Add guard to mappings.add similar to that in commands.add, preventing external scripts from adding builtin mappings.
This commit is contained in:
@@ -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