diff options
-rwxr-xr-x | _libly.js | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -12,7 +12,7 @@ var PLUGIN_INFO = <description lang="ja">適当なライブラリっぽいものたち。</description> <author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author> <license>MIT</license> - <version>0.1.30</version> + <version>0.1.31</version> <minVersion>2.3pre</minVersion> <maxVersion>2.3pre</maxVersion> <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/_libly.js</updateURL> @@ -252,21 +252,23 @@ libly.$U = {//{{{ let restore = function () obj[name] = original; if (autoRestore) { let pluginPath = getPluginPath(); - if (!pluginPath) - throw 'getPluginPath failed'; - restores[pluginPath] = - (restores[pluginPath] || []).filter( - function (res) ( - res.object != obj || - res.name != name || - (res.restore() && false) - ) - ); - restores[pluginPath].push({ - object: obj, - name: name, - restore: restore - }); + if (pluginPath) { + restores[pluginPath] = + (restores[pluginPath] || []).filter( + function (res) ( + res.object != obj || + res.name != name || + (res.restore() && false) + ) + ); + restores[pluginPath].push({ + object: obj, + name: name, + restore: restore + }); + } else { + liberator.echoerr('getPluginPath failed'); + } } original = obj[name]; let current = obj[name] = function () { |