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

[Reg 6.8.1 -> 6.9] qmllint: exec of regex

    XMLWordPrintable

Details

    • 360a614f9 (dev), 0fc2b4def (6.9)

    Description

      Since Qt 6.9 we get a qmllint error for exec usage of a regex. Do we need to import something here?

      import QtQuick
      
      Text {
      	id: root
      
      	QtObject {
      		id: d
      
      		property string link: ""
      
      		function dummy() {
      			let reg = /href="(.*?)"/g;
      			let match = reg.exec(root.text);
      			if (!match) {
      				// no link
      				d.link = "";
      				return;
      			}
      			d.link = match[1];
      			if (reg.exec(root.text)) {
      				console.warn("More than one link found!");
      			}
      		}
      	}
      }
      
      Warning: regex.qml:13:20: Member "exec" not found on type "undefined" [missing-property]
                              let match = reg.exec(root.text);
                                              ^^^^
      Warning: regex.qml:20:12: Member "exec" not found on type "undefined" [missing-property]
                              if (reg.exec(root.text)) {
                                      ^^^^
      

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes