Merge pull request #341 from gideonthomas/issue339

Fix #339 - fs.rename tests fail on the browser
This commit is contained in:
Alan K 2014-12-17 17:13:09 -05:00
commit 28e981c0c1
1 changed files with 3 additions and 0 deletions

View File

@ -2003,6 +2003,9 @@ function rename(fs, context, oldpath, newpath, callback) {
if(error) { if(error) {
callback(error); callback(error);
} else { } else {
if(oldParentDirectory.id === newParentDirectory.id) {
oldParentData = newParentData;
}
delete oldParentData[oldName]; delete oldParentData[oldName];
context.putObject(oldParentDirectory.data, oldParentData, read_new_directory); context.putObject(oldParentDirectory.data, oldParentData, read_new_directory);
} }