Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21884

Syntax error for a JS function with default parameters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.13.0-rc1
    • Qt Creator 4.8.1
    • Quick / QML Support
    • None
    • Qt 5.12.0, Qt Creator 4.8.1, Mac OS 10.14.3, Apple LLVM version 10.0.0 (clang-1000.11.45.5)

    Description

      Qt Creator gives me a syntax error for the following code:

      function someFunction(someVar, anotherVar = false) // "=" is underlined and "Syntax error" is shown
      {
          if (anotherVar === true) { console.log(someVar); }
      }
      

      I might be wrong, but default parameters for JS functions were added in ECMAScript 6, and Qt now supports ECMAScript 7, so it should not be a syntax error.

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            artemsyd Artem Sidyakin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes