diff --git a/lib/build-query.js b/lib/build-query.js index 21ac8bb4..523ac822 100644 --- a/lib/build-query.js +++ b/lib/build-query.js @@ -27,9 +27,6 @@ define(['lodash', 'metadata'], function(_, metadata) { // A few of the values have to be massaged in order to match // the `value` var opts = _.map(config.options, function(opt) { - if (opt == 'setClasses') { - return 'cssclasses'; - } if (opt.indexOf('html5') === 0) { opt = opt.replace('html5', ''); } diff --git a/src/generate.js b/src/generate.js index 6efde139..515923c3 100644 --- a/src/generate.js +++ b/src/generate.js @@ -23,9 +23,6 @@ define(['lodash'], function(_) { // Some special cases var setClasses = _.contains(config.options, 'setClasses'); - // Remove the special cases - config.options = _.without(config.options, 'setClasses'); - var output = 'require(["ModernizrProto", "Modernizr", "testRunner"'; // Needed named module requires @@ -38,8 +35,9 @@ define(['lodash'], function(_) { config.options = _.without(config.options, 'html5shiv'); } - // Load in the rest of the options (they dont return values, so they aren't declared - _.forEach(config.options, function(option) { + // Load in the rest of the options, excluding special cases + // (they dont return values, so they aren't declared) + _.forEach(_.without(config.options, 'setClasses'), function(option) { output += ', "' + option + '"'; }); diff --git a/test/browser/src/generate.js b/test/browser/src/generate.js index 1c285342..e5e07674 100644 --- a/test/browser/src/generate.js +++ b/test/browser/src/generate.js @@ -93,6 +93,12 @@ describe('generate', function() { window.require = stashedRequire; }); + it('does not modify options', function() { + var config = {'options': ['setClasses']}; + generate(config); + expect(config['options']).to.eql(['setClasses']); + }); + after(function() { cleanup(); }); diff --git a/test/universal/lib/build-hash.js b/test/universal/lib/build-hash.js index a4f8a0ee..13663ad0 100644 --- a/test/universal/lib/build-hash.js +++ b/test/universal/lib/build-hash.js @@ -62,7 +62,7 @@ describe('build-query', function() { classPrefix: 'TEST_PREFIX', options: ['setClasses'] }); - expect(query).to.be('?-cssclasses-dontmin-cssclassprefix:TEST_PREFIX'); + expect(query).to.be('?-setclasses-dontmin-cssclassprefix:TEST_PREFIX'); }); it('strips `html5` from the shiv options', function() {