Skip to content

field: [default = <unknown enum member>] silently yields undefined default #10

Description

@JavaGT

Lane: reflection/parse (sweep 2, finding 4)
src/field.js:358-361: [default = NOPE] on an enum field where NOPE isn't a member → values["NOPE"] is undefined, no error; field.js:403-404 then sets ctor.prototype[name] = undefined. protoc rejects unknown enum defaults at parse time.

Repro (executed): typeDefault is undefined after resolveAll().

Verdicts: luna Confirm Strong; grok Downgrade Worth exploring (requires a typo protoc would already catch upstream of protobuf.js). Recorded as Worth exploring.

Upstream: no match.

Decision question: Adopt (throw at resolve when a string default isn't an enum member) or Reject?

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions