Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(watchmanBinaryPath) {
captureExit.captureExit();
// define/clear some local state. The properties will be initialized
// in _handleClientAndCheck(). This is also called again in _onEnd when
// trying to reestablish connection to watchman.
this._clearLocalVars();
this._watchmanBinaryPath = watchmanBinaryPath;
this._backoffTimes = this._setupBackoffTimes();
this._clientListeners = null; // direct listeners from here to watchman.Client.
// Define a handler for if somehow the Node process gets interrupted. We need to
// close down the watchman.Client, if we have one.
captureExit.onExit(() => this._clearLocalVars());
}