mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-03 22:24:11 +01:00
Fix Bookmark* autocommand events.
Struct now only offers values during iteration like Array.
This commit is contained in:
@@ -16,12 +16,12 @@ var Bookmarks = Module("bookmarks", {
|
||||
storage.addObserver("bookmark-cache", function (key, event, arg) {
|
||||
if (["add", "change", "remove"].indexOf(event) >= 0)
|
||||
autocommands.trigger("Bookmark" + util.capitalize(event),
|
||||
iter({
|
||||
update({
|
||||
bookmark: {
|
||||
toString: function () "bookmarkcache.bookmarks[" + arg.id + "]",
|
||||
valueOf: function () arg
|
||||
}
|
||||
}, arg).toObject());
|
||||
}, arg.toObject()));
|
||||
bookmarks.timer.tell();
|
||||
}, window);
|
||||
},
|
||||
|
||||
@@ -1405,6 +1405,10 @@ var StructBase = Class("StructBase", Array, {
|
||||
get: function struct_get(key, val) this[this.members[key]],
|
||||
set: function struct_set(key, val) this[this.members[key]] = val,
|
||||
|
||||
toObject: function struct_toObject() {
|
||||
return iter.toObject([k, this[k]] for (k of keys(this.members)));
|
||||
},
|
||||
|
||||
toString: function struct_toString() Class.prototype.toString.apply(this, arguments),
|
||||
|
||||
// Iterator over our named members
|
||||
|
||||
Reference in New Issue
Block a user