Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var watcher = function watcher()
{
if(result.finish.valueOf()) {
timers.setImmediate(callback, result.error, result.result);
} else {
timers.setImmediate(watcher);
}
};
_recurse() {
const now = Date.now();
if (now - this._lastThreadYieldTime < 32) {
this._immediateTimerToken = timers.setImmediate(this._parseRecurse.bind(this));
}
else {
this._lastThreadYieldTime = now;
this._timeoutTimerToken = timers.setTimeout(this._parseRecurse.bind(this), 0);
}
}
_parseRecurse() {
_recurse() {
let now = Date.now();
if (now - this._lastThreadYieldTime < 32) {
this._immediateTimerToken = timers.setImmediate(this._parseRecurse.bind(this));
} else {
this._lastThreadYieldTime = now;
this._timeoutTimerToken = timers.setTimeout(this._parseRecurse.bind(this), 0);
}
}
private _recurse() {
const now = Date.now();
if (now - this._lastThreadYieldTime < 32) {
this._immediateTimerToken = timers.setImmediate(
this._parseRecurse.bind(this)
);
} else {
this._lastThreadYieldTime = now;
this._timeoutTimerToken = timers.setTimeout(
this._parseRecurse.bind(this),
0
);
}
}