File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1+ # 1.0.7 / 2016-12-11
2+
3+ * Early return for rejected promise
4+ * Prevent promsie swallow in callback
5+
16# 1.0.6 / 2016-11-29
27
38 * Bump version for new Repo
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ module.exports = function() {
77
88 const promise = new Promise ( ( resolve , reject ) => {
99 if ( ! args . length ) {
10- reject ( 'wrong number of arguments' ) ;
10+ return reject ( 'wrong number of arguments' ) ;
1111 }
1212
1313 const port = parseInt ( args [ 0 ] , 10 ) ;
1414
1515 if ( isNaN ( port ) ) {
16- reject ( `wrong type of arguments with: '${ args [ 0 ] } '` ) ;
16+ return reject ( `wrong type of arguments with: '${ args [ 0 ] } '` ) ;
1717 }
1818
1919 const loop = port => {
@@ -63,9 +63,9 @@ module.exports = function() {
6363 const cb = args [ 1 ] ;
6464
6565 promise . then ( data => {
66- cb . call ( this , null , data ) ;
67- } ) . catch ( err => {
68- cb . call ( this , err ) ;
66+ process . nextTick ( cb . bind ( null , null , data ) ) ;
67+ } , err => {
68+ process . nextTick ( cb . bind ( null , err ) ) ;
6969 } ) ;
7070 } else {
7171 return promise ;
Original file line number Diff line number Diff line change 11{
22 "name" : " detect-port" ,
3- "version" : " 1.0.6 " ,
3+ "version" : " 1.0.7 " ,
44 "description" : " detect available port" ,
55 "keywords" : [
66 " detect" ,
You can’t perform that action at this time.
0 commit comments