1
1
'use strict' ;
2
- var common = require ( '../../common' ) ;
3
- var assert = require ( 'assert' ) ;
4
- var repl = require ( 'repl' ) ;
5
- var stream = require ( 'stream' ) ;
6
- var path = require ( 'path' ) ;
7
- var buildType = process . config . target_defaults . default_configuration ;
8
- var buildPath = path . join ( __dirname , 'build' , buildType , 'binding' ) ;
2
+ const common = require ( '../../common' ) ;
3
+ const assert = require ( 'assert' ) ;
4
+ const repl = require ( 'repl' ) ;
5
+ const stream = require ( 'stream' ) ;
6
+ const path = require ( 'path' ) ;
7
+ const buildType = process . config . target_defaults . default_configuration ;
8
+ let buildPath = path . join ( __dirname , 'build' , buildType , 'binding' ) ;
9
9
// On Windows, escape backslashes in the path before passing it to REPL.
10
10
if ( common . isWindows )
11
11
buildPath = buildPath . replace ( / \\ / g, '/' ) ;
12
- var cb_ran = false ;
12
+ let cb_ran = false ;
13
13
14
14
process . on ( 'exit' , function ( ) {
15
15
assert ( cb_ran ) ;
16
16
console . log ( 'ok' ) ;
17
17
} ) ;
18
18
19
- var lines = [
19
+ const lines = [
20
20
// This line shouldn't cause an assertion error.
21
21
'require(\'' + buildPath + '\')' +
22
22
// Log output to double check callback ran.
23
23
'.method(function() { console.log(\'cb_ran\'); });' ,
24
24
] ;
25
25
26
- var dInput = new stream . Readable ( ) ;
27
- var dOutput = new stream . Writable ( ) ;
26
+ const dInput = new stream . Readable ( ) ;
27
+ const dOutput = new stream . Writable ( ) ;
28
28
29
29
dInput . _read = function _read ( size ) {
30
30
while ( lines . length > 0 && this . push ( lines . shift ( ) ) ) ;
@@ -38,7 +38,7 @@ dOutput._write = function _write(chunk, encoding, cb) {
38
38
cb ( ) ;
39
39
} ;
40
40
41
- var options = {
41
+ const options = {
42
42
input : dInput ,
43
43
output : dOutput ,
44
44
terminal : false ,
0 commit comments