pull/128/merge
Fabian Jakobs 2016-01-15 15:40:59 +00:00
rodzic cfa07f4449
commit e8dcd182f8
2 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -49,7 +49,7 @@ describe('vfs-local', function () {
}); });
it('should reject paths that resolve outside the root', function (done) { it('should reject paths that resolve outside the root', function (done) {
vfs.resolve("/../test-local.js", {}, function (err, meta) { vfs.resolve("/../test-local.js", {}, function (err, meta) {
expect(err).property("code").equals("EACCESS"); expect(err).property("code").equals("EACCES");
done(); done();
}); });
}); });
@ -893,6 +893,12 @@ describe('vfs-local', function () {
}); });
}); });
}); });
it("should error with EACCES if the same extension name is empty", function (done) {
vfs.extend("", {file: __dirname + "/math.js"}, function (err, meta) {
expect(err).property("code").equal("EACCES");
done();
});
});
it("should allow a redefine if options.redefine is set", function (done) { it("should allow a redefine if options.redefine is set", function (done) {
vfs.extend("test", {file: __dirname + "/math.js"}, function (err, meta) { vfs.extend("test", {file: __dirname + "/math.js"}, function (err, meta) {
if (err) throw err; if (err) throw err;

Wyświetl plik

@ -34,7 +34,7 @@ module.exports = function(methods, vfsHome, vfsWorkspace) {
function wrap(name, excluded) { function wrap(name, excluded) {
if (excluded) { if (excluded) {
return function(){ return function() {
vfsWorkspace[name].apply(vfsWorkspace, arguments); vfsWorkspace[name].apply(vfsWorkspace, arguments);
}; };
} }
@ -43,7 +43,8 @@ module.exports = function(methods, vfsHome, vfsWorkspace) {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
PATH_OPTIONS.forEach(function(o) { PATH_OPTIONS.forEach(function(o) {
options[o] = options[o] && substituteTilde(options[o]); if (options[o] && typeof options[o] == "string")
options[o] = substituteTilde(options[o]);
}); });
args[1] = options; args[1] = options;