@@ -4,24 +4,24 @@ const common = require('../common');
44const assert = require ( 'assert' ) ;
55const repl = require ( 'repl' ) ;
66
7- var referenceErrorCount = 0 ;
8-
9- common . ArrayStream . prototype . write = function ( msg ) {
10- if ( msg . startsWith ( 'ReferenceError: ' ) ) {
11- referenceErrorCount ++ ;
12- }
13- } ;
7+ common . ArrayStream . prototype . write = function ( msg ) { } ;
148
159const putIn = new common . ArrayStream ( ) ;
1610const testMe = repl . start ( '' , putIn ) ;
1711
1812// https://github.com/nodejs/node/issues/3346
19- // Tab-completion for an undefined variable inside a function should report a
20- // ReferenceError.
13+ // Tab-completion should be empty
2114putIn . run ( [ '.clear' ] ) ;
2215putIn . run ( [ 'function () {' ] ) ;
23- testMe . complete ( 'arguments.' ) ;
16+ testMe . complete ( 'arguments.' , common . mustCall ( ( err , completions ) => {
17+ assert . strictEqual ( err , null ) ;
18+ assert . deepStrictEqual ( completions , [ [ ] , 'arguments.' ] ) ;
19+ } ) ) ;
2420
25- process . on ( 'exit' , function ( ) {
26- assert . strictEqual ( referenceErrorCount , 1 ) ;
27- } ) ;
21+ putIn . run ( [ '.clear' ] ) ;
22+ putIn . run ( [ 'function () {' ] ) ;
23+ putIn . run ( [ 'undef;' ] ) ;
24+ testMe . complete ( 'undef.' , common . mustCall ( ( err , completions ) => {
25+ assert . strictEqual ( err , null ) ;
26+ assert . deepStrictEqual ( completions , [ [ ] , 'undef.' ] ) ;
27+ } ) ) ;
0 commit comments