fix retrieval of "this" object in ControllerEngine::beginTimer#1196
fix retrieval of "this" object in ControllerEngine::beginTimer#1196daschuer merged 1 commit intomixxxdj:masterfrom
Conversation
|
32bit windows build stops in the middle of an unrelated test. I assume it is a timeout. |
|
I'm wondering whether this might have unintended consequences -- what if the function passed to beginTimer has a 'this' specifically bound to it via Function.prototype.bind by the programmer? It's too bad we can't use ES6 arrow lambda (which would use 'this' from the scope it was created in) until QtScript supports ES6. I wonder whether it's better to suggest scripters use Function.prototype.bind to work around this instead of adding more 'this' hackery into the ControllerEngine itself. |
Yeah, last I checked no one was actively working on supporting ES6 in QtScript. :/
This PR only fixes the behavior as it was intended to work (but never did). I don't think script authors should have to do an extra step of binding the function to use |
I know! Let's add Node and Babel as a Mixxx dependency and transpile the ES6 to ES5 on the fly |
Someone actually tried that... I haven't seen any activity from them since... |
This will facilitate using timers in Components, for example to implement alternate actions on double button presses or long presses.