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

Unexpected syntax error when declaring a class inside another class

    XMLWordPrintable

Details

    • b50d01891b (qt/qtdeclarative/dev) b50d01891b (qt/tqtc-qtdeclarative/dev) 6fa4d45b0d (qt/qtdeclarative/6.4)

    Description

      class Tester {
        constructor() {
          new (class {})();
        }
      
        static get test() {}
      }
      

      This block of code will throw a syntax error, even though it is valid ES6.

      Expected token `('
             static get test() {}
      

      It also does not error when I write directly in the QML view, only when I import it from a Javascript file.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes