@@ -4,15 +4,20 @@ const assert = require('assert');
44const events = require ( 'events' ) ;
55
66const e = new events . EventEmitter ( ) ;
7- const num_args_emited = [ ] ;
7+ const num_args_emitted = [ ] ;
88
99e . on ( 'numArgs' , function ( ) {
1010 const numArgs = arguments . length ;
11- console . log ( 'numArgs: ' + numArgs ) ;
12- num_args_emited . push ( numArgs ) ;
11+ num_args_emitted . push ( numArgs ) ;
1312} ) ;
1413
15- console . log ( 'start' ) ;
14+ e . on ( 'foo' , function ( ) {
15+ num_args_emitted . push ( arguments . length ) ;
16+ } ) ;
17+
18+ e . on ( 'foo' , function ( ) {
19+ num_args_emitted . push ( arguments . length ) ;
20+ } ) ;
1621
1722e . emit ( 'numArgs' ) ;
1823e . emit ( 'numArgs' , null ) ;
@@ -21,6 +26,8 @@ e.emit('numArgs', null, null, null);
2126e . emit ( 'numArgs' , null , null , null , null ) ;
2227e . emit ( 'numArgs' , null , null , null , null , null ) ;
2328
29+ e . emit ( 'foo' , null , null , null , null ) ;
30+
2431process . on ( 'exit' , function ( ) {
25- assert . deepStrictEqual ( [ 0 , 1 , 2 , 3 , 4 , 5 ] , num_args_emited ) ;
32+ assert . deepStrictEqual ( [ 0 , 1 , 2 , 3 , 4 , 5 , 4 , 4 ] , num_args_emitted ) ;
2633} ) ;
0 commit comments