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

JavaScript object corruption due to Array.concat

XMLWordPrintable

      A strange object corruption problem happens when using a 3rd party JavaScript library, possibly due to Array.concat. Unfortunately I wasn't able to extract a smaller piece of code that demonstrates the problem, so I'm putting it here in full.

      When you run the attached QML example file, you'll see two outputs logged by the code that I added manually to the attached js file at line 3118. The second logging will have the "corrupt" object. Line 5225 seems like the culprit.

      The problem doesn't present when the library is used in browsers or nodejs.

      You can see the original issue here:
      https://github.com/andrewplummer/Sugar/issues/543

        1. CorruptionDemo.qml
          0.2 kB
        2. sugar_modified.js
          350 kB
        For Gerrit Dashboard: QTBUG-51581
        # Subject Branch Project Status CR V

            laknoll Lars Knoll
            bgr bgr
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes