make profile-require.js not to require files.js

This commit is contained in:
Slava Kim
2015-02-02 19:28:00 -08:00
parent a46d590a96
commit 01518749b7

View File

@@ -26,9 +26,10 @@ RequireInvocation.prototype.isOurCode = function () {
if (! self.name.match(/\//))
return false; // we always require our stuff via a path
var files = require('./files.js');
var ourSource = files.pathResolve(__dirname);
var required = files.pathResolve(files.pathDirname(self.filename), self.name);
// it is OK to use path here and not files.js as we are just checking the path
var path = require('path');
var ourSource = path.resolve(__dirname);
var required = path.resolve(path.dirname(self.filename), self.name);
if (ourSource.length > required.length)
return false;
return required.substr(0, ourSource.length) === ourSource;