Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81825

Javascript Array.includes can return false when Array.indexOf doesn't return -1

    XMLWordPrintable

    Details

    • Commits:
      a8bc011d459a4d080815a2675f2a0413c8bf09d2 (qt/qtdeclarative/5.15)

      Description

      It seems that Array.includes doesn't check equality like Array.indexOf.
      Array.indexOf behaves as expected but includes doesn't:
      [(Qt.point(0, 0)].includes(Qt.point(0, 0)) returns false

      Note the second attachment and the differences when using object properties or local javascript variables as array elements.
      Everyline line should return true.

        Attachments

        1. main.qml
          1 kB
        2. property_vs_localvar.qml
          0.4 kB
        For Gerrit Dashboard: QTBUG-81825
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            grecko Pierre-Yves Siret
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes