Missing .apply() and .call() on API methods

Post Reply New Topic
RELATED
PRODUCTS

Post

It looks like API methods in Bitwig 2 (beta6) are no longer ECMA-conform functions in that they are not instances of Function anymore and, thus, lacking the apply() and call() methods. This is a breaking change from BWS 1.3.15.

Example:
var midiInPort = host.getMidiInPort(0);
println(typeof midiInPort.createNoteInput); // function
println(typeof midiInPort.createNoteInput.apply); // undefined (BWS2beta6) <-> function (BWS1.3.15)
println(typeof midiInPort.createNoteInput.call); // undefined (BWS2beta6) <-> function (BWS1.3.15)
println(midiInPort.createNoteInput instanceof Function); // false (BWS2beta6) <-> true (BWS1.3.15)
println((function(){}) instanceof Function); // true
println(typeof (function(){}).apply); // function
Is this a beta6-specific bug and fixed in the release version?

Post Reply

Return to “Controller Scripting”