aboutsummaryrefslogtreecommitdiffstats
path: root/twittperator.js
diff options
context:
space:
mode:
Diffstat (limited to 'twittperator.js')
-rw-r--r--twittperator.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/twittperator.js b/twittperator.js
index a5918ec..c0e56bd 100644
--- a/twittperator.js
+++ b/twittperator.js
@@ -1815,9 +1815,16 @@ let PLUGIN_INFO =
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)
+ toString: function() {
+ function isFile (caller) {
+ if (!caller)
+ return false;
+ if (caller === io.File)
+ return true;
+ return isFile(caller.caller);
+ }
+ return isFile(arguments.callee.caller) ? originalPath : hackedPath;
+ }
};
try {