The latest version of the ECMAScript spec, ECMAScript 2015 (formerly called ECMAScript 6) has been finalized and it would be wonderful to be able to use the features it brings to Javascript in QML, especially:

      • Block scoped variables using "let" instead of "var"
      • Constants
      • Template Strings - multiline strings without needing to concat strings, and inlining variables like this: `This is a string with a ${variable} in it!`
      • "Arrow functions", simple anonymous functions that look like this: `argument => doSomething(argument)`. Also uses a lexical `this` in the body of the function.
      • Classes
      • Generators
      • Destructuring

      I don't know if QML can support ES2015 modules - that might conflict with its use of the import keyword.

      Folks can try out ES2015 features in-browser here using the Babel transpiler:

      Transpiling stuff with Babel works great on a lot of features, but things like block scoping and constants would work a lot better if it was supported natively in the engine.

      Some interesting reading material:


          Issue Links

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



              • Assignee:
                laknoll Lars Knoll
                empyrical empyrical
              • Votes:
                87 Vote for this issue
                89 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes