Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make external relative paths working again #38

Merged
merged 1 commit into from

2 participants

@kondi

You can not depend currently on a relative module using too many parent notation.

For example:
define("something", ["../../dependency"], ...);
Explanation:

The related iteration was replaced by an each call in commit c9657f2 which was reverted later in commit ce262cf. In first commit the break statement was rewritten to return true but in the latter it is not reverted to break.

Pull Request:

The bug is fixed and the relativePaths test suite is updated to test the problematic case.

@kondi

Please do not care about "The Travis build failed" message, CI is not configured yet correctly.

@jrburke jrburke merged commit 11630b2 into jrburke:master
@jrburke
Owner

Thank you very much for catching that silly mistake, and thank you even more for the test case! I did a 0.1.4 release, the only change over 0.1.3 is this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 5, 2012
  1. @kondi
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 3 deletions.
  1. +1 −1  almond.js
  2. +10 −2 tests/relativePaths/relativePaths.html
View
2  almond.js
@@ -61,7 +61,7 @@ var requirejs, require, define;
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
- return true;
+ break;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
View
12 tests/relativePaths/relativePaths.html
@@ -26,10 +26,17 @@
};
});
- define('main', ['./foo/b'], function(v){
+ define('../../ext',[], function(){
+ return {
+ name: 'ext'
+ };
+ });
+
+ define('main', ['./foo/b', '../../ext'], function(v, e){
return {
name: 'main',
- fooB: v
+ fooB: v,
+ ext: e
};
});
@@ -42,6 +49,7 @@
t.is('foo/b', main.fooB.name);
t.is('foo/bar/c', main.fooB.barC.name);
t.is('fu/a', main.fooB.barC.fuA.name);
+ t.is('ext', main.ext.name);
}
]
);
Something went wrong with that request. Please try again.