File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
3
- const t = require ( 'babel-types' ) ;
4
- const generate = require ( 'babel-generator' ) . default ;
5
- const _ = require ( 'lodash' ) ;
6
- const findTarget = require ( './finders' ) . findTarget ;
7
- const flowDoctrine = require ( '../flow_doctrine' ) ;
3
+ import * as t from 'babel-types' ;
4
+ import generate from 'babel-generator' ;
5
+ import _ from 'lodash' ;
6
+ import finders from './finders' ;
7
+ import flowDoctrine from '../flow_doctrine' ;
8
8
9
9
/**
10
10
* Infers param tags by reading function parameter names
@@ -13,7 +13,7 @@ const flowDoctrine = require('../flow_doctrine');
13
13
* @returns {Object } comment with parameters
14
14
*/
15
15
function inferParams ( comment : Comment ) {
16
- var path = findTarget ( comment . context . ast ) ;
16
+ var path = finders . findTarget ( comment . context . ast ) ;
17
17
18
18
// In case of `/** */ var x = function () {}` findTarget returns
19
19
// the declarator.
Original file line number Diff line number Diff line change @@ -121,18 +121,13 @@ class Server extends EventEmitter {
121
121
* Shut down the server's HTTP & LiveReload endpoints. This method
122
122
* can be called multiple times.
123
123
*/
124
- return new Promise ( resolve => {
125
- // idempotent
126
- if ( ! this . _lr ) {
127
- return resolve ( this ) ;
128
- }
129
-
130
- this . _http . close ( ( ) => {
131
- this . _lr . close ( ) ;
132
- delete this . _http ;
133
- delete this . _lr ;
134
- resolve ( this ) ;
135
- } ) ;
124
+ return Promise . all ( [
125
+ this . _http && this . _http . close ( ) ,
126
+ this . _lr && this . _lr . close ( )
127
+ ] ) . then ( ( ) => {
128
+ delete this . _http ;
129
+ delete this . _lr ;
130
+ return this ;
136
131
} ) ;
137
132
}
138
133
}
You can’t perform that action at this time.
0 commit comments