]> gitweb @ CieloNegro.org - sugar.git/blobdiff - dot-files/_vimperator/plugin/_libly_js
Auto commit by The Sugar System.
[sugar.git] / dot-files / _vimperator / plugin / _libly_js
index be989d7266f66a0a7ea9c5c42cb602f752e2aa78..1ff4600fac9a01aa5e2231c6d1b85769c5f663e4 100644 (file)
@@ -246,9 +246,10 @@ libly.$U = {//{{{
         function getPluginPath () {
           let pluginPath;
           Error('hoge').stack.split(/\n/).some(
-            function (s)
-              let (m = s.match(/-> liberator:\/\/template\/chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/))
-                (m && (pluginPath = m[1].replace(/\?.*$/, '')))
+            function (s) {
+              let m = s.match(/@chrome:\/\/liberator\/content\/liberator\.js -> file:\/\/\/(.+):\d+$/);
+              (m && (pluginPath = m[1].replace(/\?.*$/, '')));
+            }
           );
           return pluginPath;
         }
@@ -280,7 +281,7 @@ libly.$U = {//{{{
             }
             original = obj[name];
             let current = obj[name] = function () {
-                let self = this, args = arguments;
+                let self = this, args = Array.prototype.slice.call(arguments);
                 return func.call(self, function (_args) original.apply(self, _args || args), args);
             };
             libly.$U.extend(current, {original: original && original.original || original, restore: restore});
@@ -311,9 +312,8 @@ libly.$U = {//{{{
     evalJson: function(str, toRemove) {
         var json;
         try {
-            json = Components.classes['@mozilla.org/dom/json;1'].getService(Components.interfaces.nsIJSON);
             if (toRemove) str = str.substring(1, str.length - 1);
-            return json.decode(str);
+            return JSON.parse(str);
         } catch (e) { return null; }
     },
     dateFormat: function(dtm, fmt) {