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 authored and tripp committed May 22, 2014
1 parent 025eadf commit 8f42a3f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/loader/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ YUI Loader Change History
@VERSION@
------

* 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 8f42a3f

Please sign in to comment.