mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 03:24:11 +01:00
Hello strange new syntax. Can we be friends?
This commit is contained in:
@@ -241,7 +241,6 @@ var Storage = Module("Storage", {
|
||||
},
|
||||
|
||||
newObject: function newObject(key, constructor, params) {
|
||||
let self = this;
|
||||
if (params == null || !isObject(params))
|
||||
throw Error("Invalid argument type");
|
||||
|
||||
@@ -261,10 +260,10 @@ var Storage = Module("Storage", {
|
||||
if (key in this && !reload)
|
||||
throw Error("Cannot add storage key with that name.");
|
||||
|
||||
let load = function () self._loadData(key, params.store, params.type || myObject);
|
||||
let load = () => this._loadData(key, params.store, params.type || myObject);
|
||||
|
||||
this.keys[key] = new constructor(key, params.store, load, params);
|
||||
this.keys[key].timer = new Timer(1000, 10000, function () self.save(key));
|
||||
this.keys[key].timer = new Timer(1000, 10000, () => this.save(key));
|
||||
this.__defineGetter__(key, function () this.keys[key]);
|
||||
}
|
||||
return this.keys[key];
|
||||
|
||||
Reference in New Issue
Block a user