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

V4 debugger always assigns ref:0 to undefined values

    XMLWordPrintable

Details

    • c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b

    Description

      Apparently the first 4 values in the list of values collected by the V4 debug services are always undefined, and equal. However, the current function being executed also gets handle:0, leading to funny results in the debugger. Consider the following snippet of QML and inspect "x" (when breaking on the "var x = ..." line before it's executed) or "y.und" in onClicked to see the result:

      import QtQuick 2.4
      import QtQuick.Window 2.2
      
      Window {
          visible: true
          Rectangle {
              anchors.fill: parent
              property alias mouseArea: mouseArea
      
              width: 360
              height: 360
      
              MouseArea {
                  function blah(a) {
                      console.log("z");
                      if (a) {
                          a = a + 12;
                          throw "horstix";
                      }
                      var b = { a: "a" };
                      return b;
                  }
      
                  id: mouseArea
                  anchors.fill: parent
                  onClicked: { var b  = { "employees":[
                                        {"firstName":"John", "lastName":"Doe"},
                                        {"firstName":"Anna", "lastName":"Smith"},
                                        {"firstName":"Peter", "lastName":"Jones"}
                                    ] }
                      var c = blah(false).a;
                      var number = 1;
                      var y = {
                          num: 1,
                          fun : function() {return 4; },
                          und : undefined,
                          nul : null,
                          str : "strsta",
                          boo : true,
                          obj : {x: "2"},
                          arr : [1, 1, 1]
                      }
                      console.log("a");
      
                      var x = {a: 12, b: [1,2,3]};
                      Qt.quit();
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes