File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ module.exports = function(css, options){
69
69
*/
70
70
71
71
function error ( msg ) {
72
+ if ( options . silent === true ) {
73
+ return false ;
74
+ }
72
75
var err = new Error ( msg + ' near line ' + lineno + ':' + column ) ;
73
76
err . filename = options . source ;
74
77
err . line = lineno ;
Original file line number Diff line number Diff line change @@ -66,4 +66,18 @@ describe('parse(str)', function(){
66
66
parse ( 'p { color:; }' ) ;
67
67
} ) ;
68
68
} ) ;
69
+
70
+ it ( 'should not throw with silent option' , function ( ) {
71
+ assert . doesNotThrow ( function ( ) {
72
+ parse ( 'thing { color: red; } /* b { color: blue; }' , { silent : true } ) ;
73
+ } ) ;
74
+
75
+ /* Nested comments should be fine */
76
+ assert . doesNotThrow ( function ( ) {
77
+ parse ( '/* /* */' ) ;
78
+ } ) ;
79
+ } ) ;
80
+
81
+
82
+
69
83
} ) ;
You can’t perform that action at this time.
0 commit comments