Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1800

Allow to use modern ECMAScript syntax

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • API: JavaScript
    • None

    Description

      Nowadays, Qbs relies on QuickJS engine which supports ES2023. However, the Qbs' parser doesn't seem to understand the syntax.

      As a user, I want to be able to use modern ES features including, but not limited to:

      • template strings
      • destructuring
      • rest, spread, default
      • arrow functions
      • let and const
      • for … of loop
      • nullish coalescing ( and =)
      • optional chaining ?.
      • exponentiation **
      • symbols
      • modules
      • etc.

      Additionally and similarly to QML, anonymous functions and arrow functions should be allowed for properties of type script. Examples:

      Rule {
          // ...
          prepare: (project, product, inputs, outputs, i, o, expDepOn) => {
              return []
          }
      }
      
      Module {
          setupRunEnvironment: (_, prd, cfg) => { ... }
      }
      
      PathProbe {
          // ...
          nameFilter: f => !f.starsWith('.')  // apparently, this is incorrect because the documentation on `PathProbe.nameFilter` does not explain how to properly use it
      }
      

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            gooroo Serhii Olendarenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes