@@ -23,40 +23,12 @@ class ContextModule extends Module {
2323 this . built = false ;
2424 }
2525
26- identifier ( ) {
27- let identifier = "" ;
28- identifier += this . context + " " ;
29- if ( this . async )
30- identifier += "async " ;
31- if ( ! this . recursive )
32- identifier += "nonrecursive " ;
33- if ( this . addon )
34- identifier += this . addon ;
35- if ( this . regExp )
36- identifier += this . regExp ;
37- return identifier . replace ( / $ / , "" ) ;
38- }
39-
4026 prettyRegExp ( regexString ) {
4127 // remove the "/" at the front and the beginning
4228 // "/foo/" -> "foo"
4329 return regexString . substring ( 1 , regexString . length - 1 ) ;
4430 }
4531
46- readableIdentifier ( requestShortener ) {
47- let identifier = "" ;
48- identifier += requestShortener . shorten ( this . context ) + " " ;
49- if ( this . async )
50- identifier += "async " ;
51- if ( ! this . recursive )
52- identifier += "nonrecursive " ;
53- if ( this . addon )
54- identifier += requestShortener . shorten ( this . addon ) ;
55- if ( this . regExp )
56- identifier += this . prettyRegExp ( this . regExp + "" ) ;
57- return identifier . replace ( / $ / , "" ) ;
58- }
59-
6032 contextify ( context , request ) {
6133 return request . split ( "!" ) . map ( function ( subrequest ) {
6234 let rp = path . relative ( context , subrequest ) ;
@@ -68,17 +40,46 @@ class ContextModule extends Module {
6840 } ) . join ( "!" ) ;
6941 }
7042
43+ identifier ( ) {
44+ let identifier = this . context ;
45+ if ( this . async )
46+ identifier += " async" ;
47+ if ( ! this . recursive )
48+ identifier += " nonrecursive" ;
49+ if ( this . addon )
50+ identifier += ` ${ this . addon } ` ;
51+ if ( this . regExp )
52+ identifier += ` ${ this . regExp } ` ;
53+
54+ return identifier ;
55+ }
56+
57+ readableIdentifier ( requestShortener ) {
58+ let identifier = requestShortener . shorten ( this . context ) ;
59+ if ( this . async )
60+ identifier += " async" ;
61+ if ( ! this . recursive )
62+ identifier += " nonrecursive" ;
63+ if ( this . addon )
64+ identifier += ` ${ requestShortener . shorten ( this . addon ) } ` ;
65+ if ( this . regExp )
66+ identifier += ` ${ this . prettyRegExp ( this . regExp + "" ) } ` ;
67+
68+ return identifier ;
69+ }
70+
7171 libIdent ( options ) {
72- let identifier = this . contextify ( options . context , this . context ) + " " ;
72+ let identifier = this . contextify ( options . context , this . context ) ;
7373 if ( this . async )
74- identifier += "async " ;
74+ identifier += " async " ;
7575 if ( this . recursive )
76- identifier += "recursive " ;
76+ identifier += " recursive " ;
7777 if ( this . addon )
78- identifier += this . contextify ( options . context , this . addon ) ;
78+ identifier += ` ${ this . contextify ( options . context , this . addon ) } ` ;
7979 if ( this . regExp )
80- identifier += this . prettyRegExp ( this . regExp + "" ) ;
81- return identifier . replace ( / $ / , "" ) ;
80+ identifier += ` ${ this . prettyRegExp ( this . regExp + "" ) } ` ;
81+
82+ return identifier ;
8283 }
8384
8485 needRebuild ( fileTimestamps , contextTimestamps ) {
0 commit comments