-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.2
In ECMAScript, default function arguments are placed in their own environment record, which then acts as the parent scope for the function body. That means that
console.log((function() {
let a = 1;
function f(fn = function(){ return a; }){ const a = 2; return fn() }
return f();
})())
should print 1. However, in QML, it will print 2 because fn ends up in the scope of f's body, and thus uses the a from there instead of from the outer scope.
- resulted from
-
QTBUG-98032 QML/Javascript: Using an anonymous function as a default parameter in a function signature crashes the application.
-
- Closed
-