javascript decorators in QML
-
wrote on 26 Mar 2020, 02:20 last edited by
Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
Is it considered an ECMA-6 feature?Eg :-
@log
function HelloWorld() {
return "Hello world"
}where function log(wrapped) {
return function() {
console.log('Starting');
const result = wrapped.apply(this, arguments);
console.log('Finished');
return result;
}
} -
Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
Is it considered an ECMA-6 feature?Eg :-
@log
function HelloWorld() {
return "Hello world"
}where function log(wrapped) {
return function() {
console.log('Starting');
const result = wrapped.apply(this, arguments);
console.log('Finished');
return result;
}
}@G-P-Ranjan said in javascript decorators in QML:
Does Qt-5.12.x or above - any version support decorators on its Javascript functions?
Is it considered an ECMA-6 feature?Qt 5.12 supports ECMAScript 7.
However, it looks like Decorators are still in the Proposal stage, not yet part of the standard: https://github.com/tc39/proposal-decorators
1/2