Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34753

Returning strongly typed object in Promise fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Apache Flex 4.14.0
    • Fix Version/s: Apache Flex 4.15.0
    • Component/s: None
    • Labels:

      Description

      When I try to call fulfill function and pass strongly typed object as argument it always fails.
      I think issue is in the _resolve function of Promise class:
      if (result && (typeof(result) === 'object' || typeof(result) === 'function') && result.then is Function)

      Correct me if I am wrong but "typeof" will return "object" for any strongly typed objects and then next condition tries to access "then" property even though it might not be present.

      I guess easyfix would be to add check ("then" in result) before trying to access it.

        Attachments

        1. promises.patch
          0.5 kB
          Andrey Gorbatov

          Activity

            People

            • Assignee:
              erik@ixsoftware.nl Erik de Bruin
              Reporter:
              Shmatov Aleksey
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: