From 5a031efa7aa8b2dabb86e57a15f5e0ccf43cc800 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Wed, 10 Feb 2010 00:03:46 -0800 Subject: [PATCH] Fixed issues with imports that had ".." in the paths. Reviewed by me. --- Objective-J/Scope.js | 2 +- Objective-J/StaticResourceNode.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Objective-J/Scope.js b/Objective-J/Scope.js index 7ffbceef8..4e4e1ff65 100644 --- a/Objective-J/Scope.js +++ b/Objective-J/Scope.js @@ -15,7 +15,7 @@ function importablePath(/*String*/ aPath, /*BOOL*/ isLocal, /*String*/ aCWD) return aPath; if (isLocal) - aPath = FILE.join(aCWD, aPath); + aPath = FILE.normal(FILE.join(aCWD, aPath)); return aPath; } diff --git a/Objective-J/StaticResourceNode.js b/Objective-J/StaticResourceNode.js index 0c568b46b..124750bf7 100644 --- a/Objective-J/StaticResourceNode.js +++ b/Objective-J/StaticResourceNode.js @@ -65,9 +65,9 @@ require("file"); if (resultsCount > 0 && results[resultsCount - 1] !== "..") results.pop(); - // If we are at the beginning and this isn't a root listing, - // add it since it makes sense for relative paths. - else if (!isRoot && resultsCount < 0) + // If this isn't a root listing, and we are preceded by only ..'s, or + // nothing at all, then add it since it makes sense for relative paths. + else if (!isRoot && resultsCount === 0 || results[resultsCount - 1] === "..") results.push(component); }