File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -614,19 +614,22 @@ types.Reader.prototype.read = function () {
614614 return constructor . descriptor ? types . described_nc ( constructor . descriptor , value ) : value ;
615615} ;
616616
617- types . Reader . prototype . read_constructor = function ( ) {
617+ types . Reader . prototype . read_constructor = function ( descriptors ) {
618618 var code = this . read_typecode ( ) ;
619619 if ( code === 0x00 ) {
620- var d = [ ] ;
621- d . push ( this . read ( ) ) ;
622- var c = this . read_constructor ( ) ;
623- while ( c . descriptor ) {
624- d . push ( c . descriptor ) ;
625- c = this . read_constructor ( ) ;
620+ if ( descriptors === undefined ) {
621+ descriptors = [ ] ;
626622 }
627- return { 'typecode' : c . typecode , 'descriptor' : d . length === 1 ? d [ 0 ] : d } ;
623+ descriptors . push ( this . read ( ) ) ;
624+ return this . read_constructor ( descriptors ) ;
628625 } else {
629- return { 'typecode' : code } ;
626+ if ( descriptors === undefined ) {
627+ return { 'typecode' : code } ;
628+ } else if ( descriptors . length === 1 ) {
629+ return { 'typecode' : code , 'descriptor' : descriptors [ 0 ] } ;
630+ } else {
631+ return { 'typecode' : code , 'descriptor' : descriptors [ 0 ] , 'descriptors' : descriptors } ;
632+ }
630633 }
631634} ;
632635
You can’t perform that action at this time.
0 commit comments