@@ -6,10 +6,10 @@ var vfs = require('vow-fs');
66/**
77 * Starts Code Style processing process.
88 *
9+ * @constructor
910 * @name Comb
1011 */
1112var Comb = function ( ) {
12- this . _handlers ;
1313 this . _options = [
1414 'always-semicolon' ,
1515 'color-case' ,
@@ -24,7 +24,6 @@ var Comb = function() {
2424 'unitless-zero' ,
2525 'sort-order'
2626 ] ;
27- this . _config = { } ;
2827 this . _exclude = null ;
2928} ;
3029
@@ -37,17 +36,18 @@ Comb.prototype = {
3736 * @param {Object } config
3837 */
3938 configure : function ( config ) {
40- var _this = this ;
4139 this . _handlers = [ ] ;
4240 this . _options . forEach ( function ( option ) {
43- if ( config [ option ] !== undefined ) {
44- try {
45- var handler = require ( './options/' + option ) . setValue ( config [ option ] ) ;
46- handler && _this . _handlers . push ( handler ) ;
47- } catch ( e ) {
48- }
41+ if ( typeof config [ option ] === 'undefined' ) return ;
42+
43+ try {
44+ var handler = require ( './options/' + option ) . setValue ( config [ option ] ) ;
45+ handler && this . _handlers . push ( handler ) ;
46+ } catch ( e ) {
47+ console . warn ( 'Error loading "%s" handler: %s' , option , e . message ) ;
4948 }
50- } ) ;
49+ } , this ) ;
50+
5151 this . _exclude = ( config . exclude || [ ] ) . map ( function ( pattern ) {
5252 return new minimatch . Minimatch ( pattern ) ;
5353 } ) ;
@@ -151,7 +151,7 @@ Comb.prototype = {
151151 } ,
152152
153153 /**
154- * Processs directory or file.
154+ * Process directory or file.
155155 *
156156 * @param {String } path
157157 */
@@ -177,7 +177,7 @@ Comb.prototype = {
177177 } ,
178178
179179 /**
180- * Returns true if specified path is not in exluded list.
180+ * Returns true if specified path is not in excluded list.
181181 *
182182 * @returns {Boolean }
183183 */
0 commit comments