@@ -2,12 +2,12 @@ var parseRange = require("range-parser");
2
2
var pathIsAbsolute = require ( "path-is-absolute" ) ;
3
3
var MemoryFileSystem = require ( "memory-fs" ) ;
4
4
5
- module . exports = function shared ( context ) {
6
- var shared = {
5
+ module . exports = function Shared ( context ) {
6
+ var share = {
7
7
setOptions : function ( options ) {
8
8
if ( ! options ) options = { } ;
9
9
if ( typeof options . watchOptions === "undefined" ) options . watchOptions = { } ;
10
- if ( typeof options . reporter !== "function" ) options . reporter = shared . defaultReporter ;
10
+ if ( typeof options . reporter !== "function" ) options . reporter = share . defaultReporter ;
11
11
if ( typeof options . log !== "function" ) options . log = console . log . bind ( console ) ;
12
12
if ( typeof options . warn !== "function" ) options . warn = console . warn . bind ( console ) ;
13
13
if ( typeof options . watchDelay !== "undefined" ) {
@@ -117,7 +117,7 @@ module.exports = function shared(context) {
117
117
// In lazy mode, we may issue another rebuild
118
118
if ( context . forceRebuild ) {
119
119
context . forceRebuild = false ;
120
- shared . rebuild ( ) ;
120
+ share . rebuild ( ) ;
121
121
}
122
122
} ,
123
123
compilerInvalid : function ( ) {
@@ -167,12 +167,12 @@ module.exports = function shared(context) {
167
167
} ,
168
168
waitUntilValid : function ( callback ) {
169
169
callback = callback || function ( ) { } ;
170
- shared . ready ( callback , { } ) ;
170
+ share . ready ( callback , { } ) ;
171
171
} ,
172
172
invalidate : function ( callback ) {
173
173
callback = callback || function ( ) { } ;
174
174
if ( context . watching ) {
175
- shared . ready ( callback , { } ) ;
175
+ share . ready ( callback , { } ) ;
176
176
context . watching . invalidate ( ) ;
177
177
} else {
178
178
callback ( ) ;
@@ -184,14 +184,14 @@ module.exports = function shared(context) {
184
184
else callback ( ) ;
185
185
}
186
186
} ;
187
- shared . setOptions ( context . options ) ;
188
- shared . setFs ( context . compiler ) ;
187
+ share . setOptions ( context . options ) ;
188
+ share . setFs ( context . compiler ) ;
189
189
190
- context . compiler . plugin ( "done" , shared . compilerDone ) ;
191
- context . compiler . plugin ( "invalid" , shared . compilerInvalid ) ;
192
- context . compiler . plugin ( "watch-run" , shared . compilerInvalid ) ;
193
- context . compiler . plugin ( "run" , shared . compilerInvalid ) ;
190
+ context . compiler . plugin ( "done" , share . compilerDone ) ;
191
+ context . compiler . plugin ( "invalid" , share . compilerInvalid ) ;
192
+ context . compiler . plugin ( "watch-run" , share . compilerInvalid ) ;
193
+ context . compiler . plugin ( "run" , share . compilerInvalid ) ;
194
194
195
- shared . startWatch ( ) ;
196
- return shared ;
195
+ share . startWatch ( ) ;
196
+ return share ;
197
197
} ;
0 commit comments