File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 553553 }
554554 }
555555
556+ /**
557+ * Continues with the callback on the next tick.
558+ * @param {function(...[*]) } callback Callback to execute
559+ * @private
560+ */
561+ function _nextTick ( callback ) {
562+ if ( typeof process !== 'undefined' && typeof process . nextTick === 'function' ) {
563+ process . nextTick ( callback ) ;
564+ } else {
565+ setTimeout ( callback , 0 ) ;
566+ }
567+ }
568+
556569 /**
557570 * Internaly crypts a string.
558571 * @param {Array.<number> } b Bytes to crypt
619632 }
620633 }
621634 if ( callback ) {
622- process . nextTick ( next ) ;
635+ _nextTick ( next ) ;
623636 }
624637 return null ;
625638 }
799812 if ( typeof callback != 'function' ) {
800813 throw ( new Error ( "Illegal or missing 'callback': " + callback ) ) ;
801814 }
802- process . nextTick ( function ( ) { // Pretty thin, but salting is fast enough
815+ _nextTick ( function ( ) { // Pretty thin, but salting is fast enough
803816 try {
804817 var res = bcrypt . genSaltSync ( rnd ) ;
805818 callback ( null , res ) ;
You can’t perform that action at this time.
0 commit comments