Permalink
Browse files

Cleanup empty dir stack handling.

  • Loading branch information...
1 parent 6513725 commit 8b818355fc5d3f6ff8e5874d9e055368950b0b2f @tobie tobie committed May 2, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 assets/modulr.js
  2. +2 −2 assets/modulr.sync.js
View
@@ -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,
@@ -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++) {
View
@@ -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;
@@ -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++) {

0 comments on commit 8b81835

Please sign in to comment.