Move device name off fs and onto context

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2018-12-29 11:31:26 -05:00 committed by David Humphrey
parent ace4222a82
commit 11c91acdcf
2 changed files with 5 additions and 4 deletions

View File

@ -1750,7 +1750,7 @@ function stat(fs, context, path, callback) {
if(error) {
callback(error);
} else {
var stats = new Stats(path, result, fs.name);
var stats = new Stats(path, result, context.name);
callback(null, stats);
}
}
@ -1763,7 +1763,7 @@ function fstat(fs, context, fd, callback) {
if(error) {
callback(error);
} else {
var stats = new Stats(ofd.path, result, fs.name);
var stats = new Stats(ofd.path, result, context.name);
callback(null, stats);
}
}
@ -1846,7 +1846,7 @@ function readFile(fs, context, path, options, callback) {
return callback(err);
}
var stats = new Stats(ofd.path, fstatResult, fs.name);
var stats = new Stats(ofd.path, fstatResult, context.name);
if(stats.isDirectory()) {
cleanup();
@ -2427,7 +2427,7 @@ function lstat(fs, context, path, callback) {
if(error) {
callback(error);
} else {
var stats = new Stats(path, result, fs.name);
var stats = new Stats(path, result, context.name);
callback(null, stats);
}
}

View File

@ -205,6 +205,7 @@ function FileSystem(options, callback) {
function complete(error) {
function wrappedContext(methodName) {
var context = provider[methodName]();
context.name = name;
context.flags = flags;
context.changes = [];
context.guid = wrappedGuidFn(context);