File tree 2 files changed +13
-12
lines changed
2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 10
10
tree . importVisitor . prototype = {
11
11
isReplacing : true ,
12
12
run : function ( root ) {
13
- // process the contents
14
- this . _visitor . visit ( root ) ;
13
+ var error ;
14
+ try {
15
+ // process the contents
16
+ this . _visitor . visit ( root ) ;
17
+ }
18
+ catch ( e ) {
19
+ error = e ;
20
+ }
15
21
16
22
this . isFinished = true ;
17
23
18
24
if ( this . importCount === 0 ) {
19
- this . _finish ( ) ;
25
+ this . _finish ( error ) ;
20
26
}
21
27
} ,
22
28
visitImport : function ( importNode , visitArgs ) {
43
49
if ( e && ! e . filename ) { e . index = importNode . index ; e . filename = importNode . currentFileInfo . filename ; }
44
50
if ( imported && ! importNode . options . multiple ) { importNode . skip = imported ; }
45
51
46
- var subFinish = function ( ) {
52
+ var subFinish = function ( e ) {
47
53
importVisitor . importCount -- ;
48
54
49
55
if ( importVisitor . importCount === 0 && importVisitor . isFinished ) {
50
- importVisitor . _finish ( ) ;
56
+ importVisitor . _finish ( e ) ;
51
57
}
52
58
} ;
53
59
Original file line number Diff line number Diff line change @@ -477,13 +477,8 @@ less.Parser = function Parser(env) {
477
477
} ;
478
478
479
479
if ( env . processImports !== false ) {
480
- try {
481
- new tree . importVisitor ( this . imports , finish )
482
- . run ( root ) ;
483
- }
484
- catch ( e ) {
485
- error = e ;
486
- }
480
+ new tree . importVisitor ( this . imports , finish )
481
+ . run ( root ) ;
487
482
} else {
488
483
finish ( ) ;
489
484
}
You can’t perform that action at this time.
0 commit comments