Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.0
-
None
Description
When using Function.bind (MDN Function.bind) the global context is not attached to the returned function object, thus methods like eg. print can't be called anymore or console and Qt are not available.
import QtQuick 2.0 Rectangle { width: 360 height: 360 Component.onCompleted: { var func = test.bind(this, 1, 2); func(); } function test(x, y) { print("this is just a test") } }
The code above fails with
ReferenceError: print is not defined