@@ -300,9 +300,9 @@ function buildType(ref, type) {
300
300
"@name " + fullName + "#" + name ( oneof . name ) ,
301
301
"@type {string|undefined}"
302
302
] ) ;
303
- push ( "$protobuf.util.prop ($prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
303
+ push ( "Object.defineProperty ($prototype, " + JSON . stringify ( oneof . name ) + ", {" ) ;
304
304
++ indent ;
305
- push ( "get: function getVirtual () {" ) ;
305
+ push ( "get: function() {" ) ;
306
306
++ indent ;
307
307
oneof . oneof . forEach ( function ( name ) {
308
308
push ( "if (this[" + JSON . stringify ( name ) + "] !== undefined)" ) ;
@@ -313,7 +313,7 @@ function buildType(ref, type) {
313
313
push ( "return undefined;" ) ;
314
314
-- indent ;
315
315
push ( "}," ) ;
316
- push ( "set: function setVirtual (value) {" ) ;
316
+ push ( "set: function(value) {" ) ;
317
317
++ indent ;
318
318
oneof . oneof . forEach ( function ( name ) {
319
319
push ( "if (value !== " + JSON . stringify ( name ) + ")" ) ;
@@ -601,11 +601,16 @@ function buildService(ref, service) {
601
601
}
602
602
603
603
function buildEnum ( ref , enm ) {
604
+ var parentFullName = enm . parent . fullName . substring ( 1 ) ;
604
605
push ( "" ) ;
605
- var comment = [
606
+ var comment = parentFullName . length ? [
606
607
enm . name + " enum." ,
607
608
"@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 ) ,
609
614
"@enum {number}"
610
615
] ;
611
616
Object . keys ( enm . values ) . forEach ( function ( key ) {
0 commit comments