FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

make PATH.resolve return an error result on paths with '' portions · JavaScriptIOT/emscripten@59932ef · GitHub

Commit 59932ef

Browse files
committed
make PATH.resolve return an error result on paths with '' portions
1 parent 53726c8 commit 59932ef

3 files changed

Lines changed: 1 addition & 13 deletions

File tree

‎src/library_path.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ mergeInto(LibraryManager.library, {
8585
if (typeof path !== 'string') {
8686
throw new TypeError('Arguments to path.resolve must be strings');
8787
} else if (!path) {
88-
continue;
88+
return ''; // an invalid portion invalidates the whole thing
8989
}
9090
resolvedPath = path + '/' + resolvedPath;
9191
resolvedAbsolute = path.charAt(0) === '/';

‎tests/filesystem/output.txt‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
2-
isRoot: false
3-
exists: true
4-
error: 0
5-
path: /abc
6-
name: abc
7-
object.contents: ["123","456","deviceA","localLink","rootLink","relativeLink"]
8-
parentExists: true
9-
parentPath: /
10-
parentObject.contents: ["tmp","dev","forbidden","abc","def"]
11-
121
/
132
isRoot: true
143
exists: true

‎tests/filesystem/src.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function explore(path) {
3131
}
3232

3333
FS.currentPath = '/abc';
34-
explore('');
3534
explore('/');
3635
explore('.');
3736
explore('..');

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL