-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathidb.filesystem.js+0.0.8.patch
51 lines (44 loc) · 2.33 KB
/
idb.filesystem.js+0.0.8.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/node_modules/idb.filesystem.js/src/idb.filesystem.js b/node_modules/idb.filesystem.js/src/idb.filesystem.js
index 520d523..de65de9 100644
--- a/node_modules/idb.filesystem.js/src/idb.filesystem.js
+++ b/node_modules/idb.filesystem.js/src/idb.filesystem.js
@@ -115,8 +115,8 @@ if (exports.FileError === undefined) {
}
if (!FileError.INVALID_MODIFICATION_ERR) {
- FileError.INVALID_MODIFICATION_ERR = 9;
- FileError.NOT_FOUND_ERR = 1;
+ FileError.INVALID_MODIFICATION_ERR = 13;
+ FileError.NOT_FOUND_ERR = 8;
}
function MyFileError(obj) {
@@ -150,9 +150,9 @@ const INVALID_MODIFICATION_ERR = new MyFileError({
code: FileError.INVALID_MODIFICATION_ERR,
name: 'INVALID_MODIFICATION_ERR'});
const NOT_IMPLEMENTED_ERR = new MyFileError({code: 1000,
- name: 'Not implemented'});
+ name: 'NotImplementedError'});
const NOT_FOUND_ERR = new MyFileError({code: FileError.NOT_FOUND_ERR,
- name: 'Not found'});
+ name: 'NotFoundError'});
let fs_ = null;
@@ -598,7 +598,7 @@ DirectoryEntry.prototype.getDirectory = function(path, options, successCallback,
opt_errorCallback) {
// Create an absolute path if we were handed a relative one.
- path = resolveToFullPath_(this.fullPath, path);
+ path = path !== undefined ? resolveToFullPath_(this.fullPath, path) : this.fullPath;
idb_.get(path, function(folderEntry) {
if (!options) {
diff --git a/node_modules/idb.filesystem.js/tests/tests.js b/node_modules/idb.filesystem.js/tests/tests.js
index 4f76c47..d02532e 100644
--- a/node_modules/idb.filesystem.js/tests/tests.js
+++ b/node_modules/idb.filesystem.js/tests/tests.js
@@ -57,8 +57,8 @@ test('resolveToFullPath_', 23, function() {
equal(resolveToFullPath_('/', '.'), '/');
equal(resolveToFullPath_('/asdf', '.'), '/asdf');
equal(resolveToFullPath_('/', './'), '/');
- equal(resolveToFullPath_('/', '../'), '/');
- equal(resolveToFullPath_('/', '..'), '/');
+ throws(function() {resolveToFullPath_('/', '../')}, 'Invalid path');
+ throws(function() {resolveToFullPath_('/', '..')}, 'Invalid path');
equal(resolveToFullPath_('/asdf', '../'), '/');
equal(resolveToFullPath_('/', 'test.mp3'), '/test.mp3');