Skip to content

Commit

Permalink
Cleanup empty dir stack handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobie committed May 2, 2010
1 parent 6513725 commit 8b81835
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/modulr.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var modulr = (function(global) {
_modules = {},
_exports = {},
_handlers = [],
_dirStack = [],
_dirStack = [''],
PREFIX = '__module__', // Prefix identifiers to avoid issues in IE.
RELATIVE_IDENTIFIER_PATTERN = /^\.\.?\//,
_forEach,
Expand Down Expand Up @@ -103,7 +103,7 @@ var modulr = (function(global) {
if (!RELATIVE_IDENTIFIER_PATTERN.test(identifier)) {
return identifier;
}
dir = _dirStack[_dirStack.length - 1] || '';
dir = _dirStack[_dirStack.length - 1];
parts = (dir + identifier).split('/');
path = [];
for (var i = 0, length = parts.length; i < length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions assets/modulr.sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var require = (function() {
_modules = {},
_exports = {},
_handlers = [],
_dirStack = [],
_dirStack = [''],
PREFIX = '__module__', // Prefix identifiers to avoid issues in IE.
RELATIVE_IDENTIFIER_PATTERN = /^\.\.?\//,
_forEach;
Expand Down Expand Up @@ -85,7 +85,7 @@ var require = (function() {
if (!RELATIVE_IDENTIFIER_PATTERN.test(identifier)) {
return identifier;
}
dir = _dirStack[_dirStack.length - 1] || '';
dir = _dirStack[_dirStack.length - 1];
parts = (dir + identifier).split('/');
path = [];
for (var i = 0, length = parts.length; i < length; i++) {
Expand Down

0 comments on commit 8b81835

Please sign in to comment.