From b5b4368cfe69b18ec09a8daa0df5389f37a5b04f Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 4 Dec 2010 04:14:45 +0900 Subject: 邪悪な黒魔術により、無理やり Vimp3.0 対応しました! --- twittperator.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'twittperator.js') 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 = Twittperator Twitter Client using OAuth and Streaming API OAuth/StreamingAPI対応Twitterクライアント - 1.10.0 + 1.10.1 2.3 2.4 teramako @@ -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) { // {{{ -- cgit v1.2.3