From fba9603f8e38a60d2a0e42af5da2b75f64a7548c Mon Sep 17 00:00:00 2001 From: Dav Glass Date: Fri, 23 Jan 2015 14:09:02 -0600 Subject: [PATCH] mockery: removed old resolveFilename hack --- mockery.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/mockery.js b/mockery.js index b77dc1d..2543df0 100644 --- a/mockery.js +++ b/mockery.js @@ -67,23 +67,6 @@ function getEffectiveOptions(opts) { return options; } -/* - * The perils of using internal functions. The Node-internal _resolveFilename - * function was changed in commit 840229a8251955d2b791928875f36d35127dcad0 - * (just prior to v0.6.10) such that it returns a string, whereas previously - * it returned an array. Instead of playing version number tricks, just check - * for an array and pull the filename from that if necessary. - */ - //TODO Remove this whole method. -function resolveFilename(request, parent) { - var filename = m._resolveFilename(request, parent); - /*istanbul ignore next - This is for node < 0.6 which we don't care about. Can be removed. */ - if (Array.isArray(filename)) { - filename = filename[1]; - } - return filename; -} - /* * The (private) loader replacement that is used when hooking is enabled. It * does the work of returning a mock or substitute when configured, reporting @@ -116,8 +99,7 @@ function hookedLoader(request, parent, isMain) { if (registeredAllowables.hasOwnProperty(request)) { allow = registeredAllowables[request]; if (allow.unhook) { - /* TODO: Change this to m._resolveFilename */ - file = resolveFilename(request, parent); + file = m._resolveFilename(request, parent); if (file.indexOf('/') !== -1 && allow.paths.indexOf(file) === -1) { allow.paths.push(file); }