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

Problem with the order of processing arguments of function calls in the QML JavaScript engine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 5.4.1
    • None
    • Ubuntu QML App
      Windows Qt 5.4 Qt 5.5 and dev branch
    • 2fdb6eba0a58b629db32f9eefec2f26df08d3d2e (qtdeclarative)

    Description

      It looks like the JavaScript engine of QML apps contains a bug in the order in which it handles function arguments. The following code explains the issue:

          var i = 2;
          console.log(i, i += 2);
          // output in Chrome, Firefox: 2, 4
          // output in QML app:         4, 4 (WRONG?) 
      

      It looks like the arguments for a function call are build up after processing each of the arguments, which goes wrong when an assignment operator changes a variable passed to the function itself earlier too.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shausman Simon Hausmann
            josdejong Jos de Jong
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes