mirror of https://github.com/vitalif/phantomjs
Fix loading modules from an absolute path on Windows.
Don't check the module path using Linux-style path checking. Issue #11165: https://github.com/ariya/phantomjs/issues/111651.x
parent
da71c5fbdd
commit
9ca45ed62e
|
@ -216,7 +216,7 @@ phantom.callback = function(callback) {
|
|||
|
||||
if (request[0] === '.') {
|
||||
paths.push(fs.absolute(joinPath(phantom.webdriverMode ? ":/ghostdriver" : this.dirname, request)));
|
||||
} else if (request[0] === '/') {
|
||||
} else if (fs.isAbsolute(request)) {
|
||||
paths.push(fs.absolute(request));
|
||||
} else {
|
||||
// first look in PhantomJS modules
|
||||
|
|
|
@ -154,4 +154,10 @@ describe("require()", function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when path is absolute", function() {
|
||||
it("loads modules from the absolute path", function() {
|
||||
require(fs.absolute('dummy')).should.equal('spec/dummy');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue