From: Jakub Pawlowicz Date: Fri, 26 Sep 2014 14:49:14 +0000 (+0100) Subject: Breaks 2.x compatibility for using CleanCSS as a function. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3f1e064c91474ff9bd45ea39b11bc7bd564125c6;p=clean-css.git Breaks 2.x compatibility for using CleanCSS as a function. --- diff --git a/History.md b/History.md index a1b1da21..9d15be25 100644 --- a/History.md +++ b/History.md @@ -2,6 +2,7 @@ ================== * Allows `target` option to be a path to a folder instead of a file. +* Breaks 2.x compatibility for using CleanCSS as a function. * Fixed issue [#360](https://github.com/GoalSmashers/clean-css/issues/360) - adds 7 extra CSS colors. [2.2.16 / 2014-09-16](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.15...v2.2.16) diff --git a/lib/clean.js b/lib/clean.js index ec518cc8..66345cbd 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -26,10 +26,6 @@ var SelectorsOptimizer = require('./selectors/optimizer'); var CleanCSS = module.exports = function CleanCSS(options) { options = options || {}; - // back compat - if (!(this instanceof CleanCSS)) - return new CleanCSS(options); - options.keepBreaks = options.keepBreaks || false; //active by default diff --git a/test/module-test.js b/test/module-test.js index 8e4fb96b..85fd24a2 100644 --- a/test/module-test.js +++ b/test/module-test.js @@ -12,20 +12,6 @@ vows.describe('module tests').addBatch({ assert.equal(minify('a{ color: #f00; }'), 'a{color:red}'); } }, - 'initialization without new (back-compat)': { - topic: function() { - return CleanCSS(); - }, - 'should have stats, errors, etc.': function(css) { - assert.isObject(css.stats); - assert.isArray(css.errors); - assert.isArray(css.warnings); - assert.isString(css.lineBreak); - }, - 'should minify CSS correctly': function(css) { - assert.equal(css.minify('a{ color: #f00; }'), 'a{color:red}'); - } - }, 'extended via prototype': { topic: function() { CleanCSS.prototype.foo = function(data, callback) {