New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Static enums #720

Closed
ehallander9591 opened this Issue Mar 23, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@ehallander9591

ehallander9591 commented Mar 23, 2017

protobuf.js version: <6.6.5>

What happened to the reverse entries for the generated enums in the static code? I liked that feature.

By reverse I mean, the generated code used to look like

            values[valuesById[0] = "NOT_SPECIFIED"] = 0;
            values[valuesById[102] = "GET_MISSION"] = 102;

and now looks like

            values["NOT_SPECIFIED"] = 0;
            values["GET_MISSION"] = 102;
<please paste the stack trace of the error if applicable>
@dcodeIO

This comment has been minimized.

Owner

dcodeIO commented Mar 23, 2017

It should still emit that, except if it is an aliased key.

Reference: https://github.com/dcodeIO/protobuf.js/blob/master/cli/targets/static.js#L612

Isn't this working?

Edit: if (aliased.indexOf(val) >= -1) is wrong, should be if (aliased.indexOf(val) > -1)

@dcodeIO dcodeIO added the bug label Mar 23, 2017

dcodeIO added a commit that referenced this issue Mar 23, 2017

@ehallander9591

This comment has been minimized.

ehallander9591 commented Mar 23, 2017

Hmmm. What would I have done to trigger the aliased key?

@ehallander9591

This comment has been minimized.

ehallander9591 commented Mar 23, 2017

Thank you

@ehallander9591

This comment has been minimized.

ehallander9591 commented Mar 23, 2017

Back to my normal..

@joscha

This comment has been minimized.

joscha commented Mar 24, 2017

I think this might be related to #727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment