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

Returning strongly typed object in Promise fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Apache Flex 4.14.0
    • Apache Flex 4.15.0
    • None

    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

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

            Dates

              Created:
              Updated:
              Resolved: