]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/modules/storage.jsm
Import r6948 from upstream hg supporting Firefox up to 24.*
[dactyl.git] / common / modules / storage.jsm
index 0f4cc06e7a83a41c0ca3e89dada9b422948c613e..f37524d843e79186c40ad36c5e02627b775f2276 100644 (file)
@@ -162,7 +162,7 @@ var ObjectStore = Class("ObjectStore", StoreBase, {
     }
 });
 
-var sessionGlobal = Cu.import("resource://gre/modules/Services.jsm", {})
+var sessionGlobal = Cu.import("resource://gre/modules/Services.jsm", {});
 
 var Storage = Module("Storage", {
     Local: function Local(dactyl, modules, window) ({
@@ -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];
@@ -762,7 +761,6 @@ var File = Class("File", {
         }
     },
 
-
     isAbsolutePath: function isAbsolutePath(path) {
         try {
             services.File().initWithPath(path);
@@ -793,7 +791,7 @@ let (file = services.directory.get("ProfD", Ci.nsIFile)) {
         if (!(prop in File.prototype)) {
             let isFunction;
             try {
-                isFunction = callable(file[prop])
+                isFunction = callable(file[prop]);
             }
             catch (e) {}
 
@@ -814,4 +812,4 @@ endModule();
 
 // catch(e){ dump(e + "\n" + (e.stack || Error().stack)); Components.utils.reportError(e) }
 
-// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript: