1
0
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:
Kris Maglione
2011-03-05 17:48:31 -05:00
parent 61c1111aab
commit 5eda487e43

View File

@@ -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;