Skip to content
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
Closed

Generated Static enums #720

ehallander9591 opened this issue Mar 23, 2017 · 5 comments
Labels

Comments

@ehallander9591
Copy link

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
Copy link
Member

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)

@ehallander9591
Copy link
Author

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

@ehallander9591
Copy link
Author

Thank you

@ehallander9591
Copy link
Author

Back to my normal..

@joscha
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants