Skip to content

Commit

Permalink
CLI: Static code no longer uses IE8 support utility
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Jan 2, 2017
1 parent a017bf8 commit 407223b
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 319 deletions.
15 changes: 10 additions & 5 deletions cli/targets/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ function buildType(ref, type) {
"@name " + fullName + "#" + name(oneof.name),
"@type {string|undefined}"
]);
push("$protobuf.util.prop($prototype, " + JSON.stringify(oneof.name) +", {");
push("Object.defineProperty($prototype, " + JSON.stringify(oneof.name) +", {");
++indent;
push("get: function getVirtual() {");
push("get: function() {");
++indent;
oneof.oneof.forEach(function(name) {
push("if (this[" + JSON.stringify(name) + "] !== undefined)");
Expand All @@ -313,7 +313,7 @@ function buildType(ref, type) {
push("return undefined;");
--indent;
push("},");
push("set: function setVirtual(value) {");
push("set: function(value) {");
++indent;
oneof.oneof.forEach(function(name) {
push("if (value !== " + JSON.stringify(name) + ")");
Expand Down Expand Up @@ -601,11 +601,16 @@ function buildService(ref, service) {
}

function buildEnum(ref, enm) {
var parentFullName = enm.parent.fullName.substring(1);
push("");
var comment = [
var comment = parentFullName.length ? [
enm.name + " enum.",
"@name " + name(enm.name),
"@memberof " + enm.parent.fullName.substring(1),
"@memberof " + parentFullName,
"@enum {number}"
] : [
enm.name + " enum.",
"@exports " + name(enm.name),
"@enum {number}"
];
Object.keys(enm.values).forEach(function(key) {
Expand Down
Loading

0 comments on commit 407223b

Please sign in to comment.