@@ -35,10 +35,27 @@ define(function (require, exports, module) {
3535
3636 var FILE_WATCHER_BATCH_TIMEOUT = 200 ; // 200ms - granularity of file watcher changes
3737
38- var _changeCallback , // Callback to notify FileSystem of watcher changes
39- _offlineCallback , // Callback to notify FileSystem that watchers are offline
40- _changeTimeout , // Timeout used to batch up file watcher changes
41- _pendingChanges = { } ; // Pending file watcher changes
38+ /**
39+ * Callback to notify FileSystem of watcher changes
40+ * @type {?function(string, FileSystemStats=) }
41+ */
42+ var _changeCallback ;
43+
44+ /**
45+ * Callback to notify FileSystem if watchers stop working entirely
46+ * @type {?function() }
47+ */
48+ var _offlineCallback ;
49+
50+ /** Timeout used to batch up file watcher changes (setTimeout() return value) */
51+ var _changeTimeout ;
52+
53+ /**
54+ * Pending file watcher changes - map from fullPath to flag indicating whether we need to pass stats
55+ * to _changeCallback() for this path.
56+ * @type {!Object.<string, boolean> }
57+ */
58+ var _pendingChanges = { } ;
4259
4360 var _bracketsPath = FileUtils . getNativeBracketsDirectoryPath ( ) ,
4461 _modulePath = FileUtils . getNativeModuleDirectoryPath ( module ) ,
@@ -48,6 +65,7 @@ define(function (require, exports, module) {
4865
4966 var _isRunningOnWindowsXP = navigator . userAgent . indexOf ( "Windows NT 5." ) >= 0 ;
5067
68+
5169 // If the connection closes, notify the FileSystem that watchers have gone offline.
5270 $ ( _nodeDomain . connection ) . on ( "close" , function ( event , promise ) {
5371 if ( _offlineCallback ) {
@@ -105,7 +123,7 @@ define(function (require, exports, module) {
105123 if ( event === "change" ) {
106124 // Only register change events if filename is passed
107125 if ( filename ) {
108- // an existing file was created ; stats are needed
126+ // an existing file was modified ; stats are needed
109127 change = path + filename ;
110128 _enqueueChange ( change , true ) ;
111129 }
0 commit comments