IDL should verify non-optional fields in separate invariant statements

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL
    • Server Programmability
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When there are multiple required fields in an IDL type, IDL generates a serialize() method that invariants based on the combined AND of all those fields being present:

      invariant(_hasFieldOne && _hasFieldTwo && _hasFieldThree && _hasFieldFour);
      

      When this statement fails it is hard to debug, since it is unclear which field was not present. It would be much more helpful if each field appeared in its own invariant:

      invariant(_hasFieldOne);
      invariant(_hasFieldTwo);
      invariant(_hasFieldThree);
      invariant(_hasFieldFour);
      

            Assignee:
            Unassigned
            Reporter:
            Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: