@@ -55,10 +55,8 @@ function encoder(mtype) {
5555
5656 for ( var i = 0 ; i < fields . length ; ++ i ) {
5757 var field = fields [ i ] . resolve ( ) ,
58- index = encoder . compat ? mtype . _fieldsArray . indexOf ( field ) : /* istanbul ignore next */ i ;
59- if ( field . partOf ) // see below for oneofs
60- continue ;
61- var type = field . resolvedType instanceof Enum ? "uint32" : field . type ,
58+ index = encoder . compat ? mtype . _fieldsArray . indexOf ( field ) : /* istanbul ignore next */ i ,
59+ type = field . resolvedType instanceof Enum ? "uint32" : field . type ,
6260 wireType = types . basic [ type ] ;
6361 ref = "m" + util . safeProp ( field . name ) ;
6462
@@ -124,26 +122,6 @@ function encoder(mtype) {
124122 }
125123 }
126124
127- // oneofs
128- for ( var i = 0 ; i < /* initializes */ mtype . oneofsArray . length ; ++ i ) {
129- var oneof = mtype . _oneofsArray [ i ] ; gen
130- ( "switch(%s){" , "m" + util . safeProp ( oneof . name ) ) ;
131- for ( var j = 0 ; j < /* direct */ oneof . fieldsArray . length ; ++ j ) {
132- var field = oneof . fieldsArray [ j ] ,
133- type = field . resolvedType instanceof Enum ? "uint32" : field . type ,
134- wireType = types . basic [ type ] ;
135- ref = "m" + util . safeProp ( field . name ) ; gen
136- ( "case%j:" , field . name ) ;
137- if ( wireType === undefined )
138- genTypePartial ( gen , field , mtype . _fieldsArray . indexOf ( field ) , ref ) ;
139- else gen
140- ( "w.uint32(%d).%s(%s)" , ( field . id << 3 | wireType ) >>> 0 , type , ref ) ;
141- gen
142- ( "break" ) ;
143- } gen
144- ( "}" ) ;
145- }
146-
147125 return gen
148126 ( "return w" ) ;
149127 /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */
0 commit comments