File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -406,18 +406,32 @@ Client.prototype.mirrorObject = function(handle, cb) {
406
406
return ;
407
407
}
408
408
409
- var mirror = { } ;
409
+ var mirror ;
410
+ if ( handle . className == 'Array' ) {
411
+ mirror = [ ] ;
412
+ } else {
413
+ mirror = { } ;
414
+ }
415
+
410
416
for ( var i = 0 ; i < handle . properties . length ; i ++ ) {
411
417
var value = res . body [ handle . properties [ i ] . ref ] ;
412
- mirror [ handle . properties [ i ] . name ] = value . text ;
418
+ var mirrorValue = value . value ? value . value : value . text ;
419
+
420
+ if ( Array . isArray ( mirror ) &&
421
+ typeof handle . properties [ i ] . name != 'number' ) {
422
+ // Skip the 'length' property.
423
+ continue ;
424
+ }
425
+
426
+ mirror [ handle . properties [ i ] . name ] = mirrorValue ;
413
427
}
414
428
415
429
if ( cb ) cb ( mirror ) ;
416
430
} ) ;
417
431
418
- } else if ( handle . type == 'string' ) {
432
+ } else if ( handle . value ) {
419
433
process . nextTick ( function ( ) {
420
- cb ( handle . text ) ;
434
+ cb ( handle . value ) ;
421
435
} ) ;
422
436
423
437
} else {
You can’t perform that action at this time.
0 commit comments