Skip to content

Commit

Permalink
Improves coverage and maintainability (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Oct 14, 2017
1 parent c6b03b9 commit 54526c4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/require/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/*global _gpfHost*/ // Host type
/*global _gpfHttpRequest*/ // HTTP request common implementation
/*global _gpfPathExtension*/ // Get the extension of the last name of a path (including dot)
/*global _gpfPathJoin*/ // Join all arguments together and normalize the resulting path
/*exported _gpfRequireLoad*/ // Load the resource
/*exported _gpfRequireProcessor*/ // Mapping of resource extension to processor function
/*#endif*/
Expand All @@ -30,11 +31,8 @@ function _gpfRequireLoadHTTP (name) {
}

function _gpfRequireLoadFS (name) {
if (name.charAt(0) === "/") {
// Must be relative to the current execution path
name = "." + name;
}
return _gpfFsRead(name);
// Must be relative to the current execution path
return _gpfFsRead(_gpfPathJoin(".", name));
}

if (_gpfHost === _GPF_HOST.BROWSER) {
Expand Down

0 comments on commit 54526c4

Please sign in to comment.