Skip to content

Generated Static enums #720

Closed
Closed

Description

@ehallander9591

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>

Activity

  1. dcodeIO commented on Mar 23, 2017

    @dcodeIO
    Member

    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)

  2. ehallander9591 commented on Mar 23, 2017

    @ehallander9591
    Author

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

  3. ehallander9591 commented on Mar 23, 2017

    @ehallander9591
    Author

    Thank you

  4. ehallander9591 commented on Mar 23, 2017

    @ehallander9591
    Author

    Back to my normal..

  5. joscha commented on Mar 24, 2017

    @joscha

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions