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

Invalid .import statement produces unhelpful SyntaxError message

    XMLWordPrintable

Details

    Description

      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
      

      Attachments

        Issue Links

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

          Activity

            People

              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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes