Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-6156

Impossible to implement "defaultable" values in defaults via expanders returning undefined

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0
    • None
    • Framework
    • None

    Description

      Our irregular defaults merging algorithm (which performs merging before expansion, unlike the system used for distributions, subcomponents, etc.) leads to the impossibility of a useful feature - it would be useful to be able to override values in derived grades by values which may (via an expander return) be undefined, and as a result, retaining the original value. This would ordinarily be possible, but, for example, the following code fails:

      fluid.defaults("fluid.tests.undefinedMergeBase", {
          gradeNames: "fluid.component",
          option6: "OPTION6"
      });
      
      fluid.defaults("fluid.tests.undefinedMergeOver", {
          gradeNames: "fluid.tests.undefinedMergeBase",
          option6: "@expand:fluid.tests.returnUndefined()"
      });
      
      fluid.tests.returnUndefined = function () {};
      
      jqUnit.test("FLUID-6156: Test ignoring of undefined values during merge", function () {
          var that = fluid.tests.undefinedMergeOver();
          jqUnit.assertEquals("Undefined value should have been ignored", "OPTION6", that.option6);
      });

      });

      Attachments

        Issue Links

          Activity

            People

              antranig Antranig Basman
              antranig Antranig Basman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: