Skip to content

Commit 7c3506b

Browse files
committed
Fixed: Post-merge, also tackles #683
1 parent a6563fe commit 7c3506b

28 files changed

Lines changed: 681 additions & 517 deletions

cli/targets/static.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,15 @@ function buildEnum(ref, enm) {
613613
push(name(ref) + "." + name(enm.name) + " = (function() {");
614614
++indent;
615615
push((config.es6 ? "const" : "var") + " valuesById = {}, values = Object.create(valuesById);");
616+
var aliased = [];
616617
Object.keys(enm.values).forEach(function(key) {
617618
var val = enm.values[key];
618-
push("values[valuesById[" + val + "] = " + JSON.stringify(key) + "] = " + val + ";");
619+
if (aliased.indexOf(val) >= -1)
620+
push("values[" + JSON.stringify(key) + "] = " + val + ";");
621+
else {
622+
push("values[valuesById[" + val + "] = " + JSON.stringify(key) + "] = " + val + ";");
623+
aliased.push(val);
624+
}
619625
});
620626
push("return values;");
621627
--indent;

dist/light/protobuf.js

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js.gz

47 Bytes
Binary file not shown.

dist/light/protobuf.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.min.js.gz

-6 Bytes
Binary file not shown.

dist/protobuf.js

Lines changed: 15 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)