diff --git a/examples/refactoring-test.html b/examples/refactoring-test.html
index fa5bcc3..880a7c3 100644
--- a/examples/refactoring-test.html
+++ b/examples/refactoring-test.html
@@ -37,9 +37,9 @@ fs.open('/myfile', 'w+', function(error, fd) {
fs.link('/myfile', '/myotherfile', function(error) {
if(error) throw error;
console.log('linked');
- fs.unlink('/myfile', function(error) {
+ fs.stat('/myfile', function(error, stats) {
if(error) throw error;
- console.log('unlinked');
+ console.log(stats);
});
});
});
diff --git a/src/file-system.js b/src/file-system.js
index 72eac26..0546b8a 100644
--- a/src/file-system.js
+++ b/src/file-system.js
@@ -950,7 +950,8 @@ define(function(require) {
nlinks: result.nlinks,
atime: result.atime,
mtime: result.mtime,
- ctime: result.ctime
+ ctime: result.ctime,
+ type: result.mode,
};
deferred.resolve(stats);
}
diff --git a/tests/spec/idbfs.spec.js b/tests/spec/idbfs.spec.js
index 638049c..e06df65 100644
--- a/tests/spec/idbfs.spec.js
+++ b/tests/spec/idbfs.spec.js
@@ -145,6 +145,7 @@ describe('fs.stat', function() {
expect(_result['atime']).toEqual(jasmine.any(Number));
expect(_result['mtime']).toEqual(jasmine.any(Number));
expect(_result['ctime']).toEqual(jasmine.any(Number));
+ expect(_result['type']).toBeDefined();
});
});
});