dbankier/TiShadow — pull request #290 by sztn (2014-05-22 21:57:43+00:00)
Title: Ensure path components have a separator at runtime

- In our code we use variables to store directory names and then use
those variables to get specific files via Ti.Filesystem.getFile.

For example:
var aFile = Ti.Filesystem.getFile(aDirectory, "file")

When uglify is run it will convert that line to:
var aFile = Ti.Filesystem.getFile(__p.file(aDirectory + "file"))

The problem here is that the variable 'aDirectory' may or may not have
a trailing path separator but we don't know that until runtime.

Our fix was to wrap each path component argument passed to
Ti.Filesystem.getFile in a method that will check at runtime to see if
the path component ends with a path separator. If it does then we
don't append anything, if it doesn't then we append a '/'.

When uglify is run now it will convert the line to:
var aFile = Ti.Filesystem.getFile(__p.file(__p.endsWithPathSeparator(aDirectory) + "file"))

- Updated the filesystem unit tests to include the addition of
__p.endsWithPathSeparator.