diff options
author | anekos | 2010-12-04 04:14:45 +0900 |
---|---|---|
committer | anekos | 2010-12-04 04:14:45 +0900 |
commit | b5b4368cfe69b18ec09a8daa0df5389f37a5b04f (patch) | |
tree | ee2aed299cfc029fe66b423e96f6a8132e03cce9 /twittperator.js | |
parent | 25bd23b10906730cc0c7674f840089327e3a909a (diff) | |
download | vimperator-plugins-b5b4368cfe69b18ec09a8daa0df5389f37a5b04f.tar.bz2 |
邪悪な黒魔術により、無理やり Vimp3.0 対応しました!
Diffstat (limited to 'twittperator.js')
-rw-r--r-- | twittperator.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/twittperator.js b/twittperator.js index f14bebc..8289fc6 100644 --- a/twittperator.js +++ b/twittperator.js @@ -28,7 +28,7 @@ let PLUGIN_INFO = <name>Twittperator</name> <description>Twitter Client using OAuth and Streaming API</description> <description lang="ja">OAuth/StreamingAPI対応Twitterクライアント</description> - <version>1.10.0</version> + <version>1.10.1</version> <minVersion>2.3</minVersion> <maxVersion>2.4</maxVersion> <author mail="teramako@gmail.com" homepage="http://d.hatena.ne.jp/teramako/">teramako</author> @@ -1783,16 +1783,23 @@ let PLUGIN_INFO = }, // }}} sourceScriptFile: function(file) { // {{{ // XXX 悪い子向けのハックです。すみません。 *.tw ファイルを *.js のように読み込みます。 - file = file.clone(); - let toString = file.toString; let script = liberator.plugins.contexts[file.path]; - file.toString = function() this.path.replace(/\.tw$/, ".js"); + + let originalPath = file.path; + let hackedPath = originalPath.replace(/\.tw$/, ".js"); + + let ugly = { + __noSuchMethod__: function (name, args) originalPath[name].apply(originalPath, args), + toString: + function() + (parseInt(Error().stack.match(/io.js:(\d+)/)[1], 10) < 100 ? originalPath : hackedPath) + }; + try { - io.source(file, false); + io.source(ugly, false); } finally { if (script) liberator.plugins[script.NAME] = script; - file.toString = toString; } }, // }}} withProtectedUserConfirmation: function(check, actionName, action) { // {{{ |