@@ -300,9 +300,9 @@ function buildType(ref, type) {
300300 "@name " + fullName + "#" + name ( oneof . name ) ,
301301 "@type {string|undefined}"
302302 ] ) ;
303- push ( "$protobuf.util.prop ($prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
303+ push ( "Object.defineProperty ($prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
304304 ++ indent ;
305- push ( "get: function getVirtual () {" ) ;
305+ push ( "get: function() {" ) ;
306306 ++ indent ;
307307 oneof . oneof . forEach ( function ( name ) {
308308 push ( "if (this[" + JSON . stringify ( name ) + "] !== undefined)" ) ;
@@ -313,7 +313,7 @@ function buildType(ref, type) {
313313 push ( "return undefined;" ) ;
314314 -- indent ;
315315 push ( "}," ) ;
316- push ( "set: function setVirtual (value) {" ) ;
316+ push ( "set: function(value) {" ) ;
317317 ++ indent ;
318318 oneof . oneof . forEach ( function ( name ) {
319319 push ( "if (value !== " + JSON . stringify ( name ) + ")" ) ;
@@ -601,11 +601,16 @@ function buildService(ref, service) {
601601}
602602
603603function buildEnum ( ref , enm ) {
604+ var parentFullName = enm . parent . fullName . substring ( 1 ) ;
604605 push ( "" ) ;
605- var comment = [
606+ var comment = parentFullName . length ? [
606607 enm . name + " enum." ,
607608 "@name " + name ( enm . name ) ,
608- "@memberof " + enm . parent . fullName . substring ( 1 ) ,
609+ "@memberof " + parentFullName ,
610+ "@enum {number}"
611+ ] : [
612+ enm . name + " enum." ,
613+ "@exports " + name ( enm . name ) ,
609614 "@enum {number}"
610615 ] ;
611616 Object . keys ( enm . values ) . forEach ( function ( key ) {
0 commit comments