Skip to content

Commit

Permalink
The group comboBase should inherit from the default if no group setti…
Browse files Browse the repository at this point in the history
…ng is specified

This fixes a regression caused by yui#1832.
  • Loading branch information
andrewnicols committed May 22, 2014
1 parent 0b81a18 commit 22a3cd1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/loader/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
YUI Loader Change History
=========================

@VERSION@
3.17.2
------

* No changes.
* Fix a bug in 3.17.1 where there comboBase was no longer inheritted from the default group. ([#1837][]: @andrewnicols)

3.17.1
------
Expand Down
2 changes: 1 addition & 1 deletion src/loader/js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
mod.root = group.root;
}

comboBase = group.comboBase;
comboBase = group.comboBase || comboBase;
comboSep = group.comboSep;
maxURLLength = group.maxURLLength;
} else {
Expand Down
22 changes: 22 additions & 0 deletions src/loader/tests/unit/assets/loader-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,28 @@ YUI.add('loader-tests', function(Y) {
Assert.isTrue(out.js.indexOf('http://secondhost.com/combo?3.5.0/foogg/foogg-min.js') >= 0, 'Group combo URL should be included in the result');
Assert.isTrue(out.js.indexOf('http://yui.yahooapis.com/combo?3.5.0/cookie/cookie-min.js') >= 0, 'Default YUI combo URL should be included in the result');
},
'test inheritted comboBase with groups': function () {
var loader = new testY.Loader({
combine: true,
groups: {
testGroup: {
combine: true,
modules: {
foogg: {
requires: []
}
}
}
},
require: ['foogg', 'cookie']
});
var out = loader.resolve(true);
Assert.areSame(1, out.js.length, 'Loader generated multiple URLs for a single comboBase');

var url = out.js[0];
Assert.isArray(url.match(/3.5.0\/foogg\/foogg-min\.js/), 'Group match should be combo-loaded with the default URL');
Assert.isArray(url.match(/3.5.0\/cookie\/cookie-min\.js/), 'Default match should combo-load with the group result');
},
test_resolve_maxurl_length: function() {
var loader = new testY.Loader({
maxURLLength: 1024,
Expand Down

0 comments on commit 22a3cd1

Please sign in to comment.