Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1214

JavaScript constructor does not accept object properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • JavaScript - Compiler
    • Patch Available

    Description

      When you give a constructor function a set of default parameters they don't get assigned to the object correctly.

      The reason lies in the generated code:

      MyStruct = function(args) {
      this.value = null;
      if (args) {
      if (!args.value)

      { this.value = args.value; }

      }
      };

      The check for results !args.value causes that the value to be only set if it is undefined.

      Attachments

        1. THRIFT-1214-args-constructor.patch
          0.8 kB
          Henrique Mendonca

        Activity

          People

            henrique Henrique Mendonca
            pascal.bach Pascal Bach
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: