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

[Reg 5 -> 6] Referencing `arguments` in arrow function leads to segfault

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      In Qt5 `arguments` was available in both regular functions and arrow functions, what is not in line with JS specification. In Qt 6 `arguments` is no longer available within arrow functions, but in some circumstances leads to segfault, instead of printing error regarding undefined reference.

      Marked also as a 5.15 bug because `arguments` should not be available for arrow functions there.

       

      import QtQuick
      import QtQuick.Controls
      
      Window {
          id: root
      
          visible: true
      
          Item {
              id: item
      
              signal hello(string arg)
      
              Button {
                  text: "button"
                  onClicked: item.hello("world")
              }
      
              onHello: (arg) => {
                  console.log(JSON.stringify(arguments))
              }
          }
      }
      
      

      Attachments

        For Gerrit Dashboard: QTBUG-134215
        # Subject Branch Project Status CR V

        Activity

          People

            diseraluca Luca Di Sera
            michalc Michał Cieślak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change