Breaks 2.x compatibility for using CleanCSS as a function.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 26 Sep 2014 14:49:14 +0000 (15:49 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 20:22:43 +0000 (21:22 +0100)
History.md
lib/clean.js
test/module-test.js

index a1b1da2..9d15be2 100644 (file)
@@ -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)
index ec518cc..66345cb 100644 (file)
@@ -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
index 8e4fb96..85fd24a 100644 (file)
@@ -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) {