@@ -154,9 +154,16 @@ function($rootScope, $http, $timeout, theSocket) {
154
154
checkHttp ( ) ;
155
155
} ) ;
156
156
157
- nodejs . channel . on ( 'test-type' , ( msg ) => {
157
+ nodejs . channel . on ( 'test-type' , ( msg , secondMsg , ... other_args ) => {
158
158
// Report the message payload type and contents.
159
- appendToLog ( 'Received type "' + ( typeof msg ) + '" with contents : ' + JSON . stringify ( msg ) , true ) ;
159
+ let report_msg = 'Received type "' + ( typeof msg ) + '" with contents : ' + JSON . stringify ( msg ) ;
160
+ if ( typeof secondMsg !== 'undefined' ) {
161
+ report_msg += ' . Also received type "' + ( typeof secondMsg ) + '" with contents : ' + JSON . stringify ( secondMsg ) ;
162
+ }
163
+ if ( other_args . length > 0 ) {
164
+ report_msg += ' . Further arguments received: ' + JSON . stringify ( other_args ) ;
165
+ }
166
+ appendToLog ( report_msg , true ) ;
160
167
} ) ;
161
168
162
169
nodejs . start ( 'main.js' ,
@@ -317,6 +324,9 @@ function($rootScope, $http, $timeout, theSocket) {
317
324
nodejs . channel . post ( 'test-type' , [ 1 , 2 , 3 ] ) ;
318
325
nodejs . channel . post ( 'test-type' , [ ] ) ;
319
326
nodejs . channel . post ( 'test-type' , [ 2 , _testobj , null , "other string" ] ) ;
327
+ // Send many arguments in the same event.
328
+ nodejs . channel . post ( 'test-type' , 'two-args' , _testobj ) ;
329
+ nodejs . channel . post ( 'test-type' , 'many-args' , false , true , null , 1 , 0 , - 1.3 , [ 1 , 2 , 3 ] , _testobj ) ;
320
330
}
321
331
322
332
function testMessageTypesReceived ( ) {
0 commit comments