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

Stepping through JavaScript code seeming steps to line which is not being executed

    XMLWordPrintable

Details

    • f261a534cc96d41cee15462795844116887bd99a

    Description

      1. Create a Qt Quick Application project in Qt Creator.
      2. In the project's QML file, add some JavaScript with a failing condition:
        I have:
            MainForm {
                anchors.fill: parent
                mouseArea.onClicked: {
                    console.log(qsTr('Clicked on background. Text: "' + textEdit.text + '"'));
                    if (textEdit.text == "key")
                        console.log("Unlocked");
                }
            }
        
      3. Put a breakpoint into the first line of this JavaScript.
      4. Run the application in the debugger and let it stop at the breakpoint.
      5. Step forward twice.
        Creator will indicate that you stepped into the line with the second log although this line is not being executed.

      Stepping should only reach lines that are being executed.

      It seems like the debugger will always indicate being stopped at the last line of the block. If you add another line after the second log (outside the "if"), the debugger will step to this instead.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              rlohning Robert Löhning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes