From: Kevin Sawicki Date: Thu, 23 Jun 2016 22:45:08 +0000 (-0700) Subject: Include trailing separator in comparisons X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=905e9e96451e84fab6203ed8d122cae3ed8e8d1e;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Include trailing separator in comparisons --- diff --git a/lib/common/reset-search-paths.js b/lib/common/reset-search-paths.js index 8e21701..5cec77b 100644 --- a/lib/common/reset-search-paths.js +++ b/lib/common/reset-search-paths.js @@ -12,10 +12,11 @@ module.parent.paths = [] const originalNodeModulePaths = Module._nodeModulePaths Module._nodeModulePaths = function (from) { const paths = originalNodeModulePaths(from) - const rootPath = process.resourcesPath // If "from" is outside the app then we do nothing. - const skipOutsidePaths = path.resolve(from).startsWith(rootPath) + const rootPath = process.resourcesPath + path.sep + const fromPath = path.resolve(from) + path.sep + const skipOutsidePaths = fromPath.startsWith(rootPath) if (skipOutsidePaths) { return paths.filter(function (candidate) { return candidate.startsWith(rootPath)