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

Invalid .import statement produces unhelpful SyntaxError message

XMLWordPrintable

      When the .import statement is used to import a QML module into a JS file and the qualifier or version is omitted, as here:

      sample.js
      .import MyModule 1.0
      
      function doStuff() {
          ...
      }
      

      QML produces the following diagnostic:

      sample.js:1: SyntaxError: Unexpected token .
      

      A better error would be:

      sample.js:1:8: Module import requires version and qualifier
      

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

            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes