Skip to content

Commit 407223b

Browse files
committed
CLI: Static code no longer uses IE8 support utility
1 parent a017bf8 commit 407223b

20 files changed

+171
-319
lines changed

cli/targets/static.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -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

603603
function 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

Comments
 (0)