removeEventListener removes wrong callback. If module has multiple callbacks with same name,
removeEventListener always removes first one only.
var win = Ti.UI.createWindow();
var func1 = function () {
Ti.API.info('open callback 1');
};
var func2 = function () {
Ti.API.info('open callback 2');
};
var func3 = function () {
Ti.API.info('open callback 3');
};
win.addEventListener('open', func1);
win.addEventListener('open', func1);
win.addEventListener('open', func2);
win.addEventListener('open', func2);
win.addEventListener('open', func3);
win.addEventListener('open', func3);
win.removeEventListener('open', func2);
win.open();
Actual:
func1 called once and
func2 &
func3 are called twice.
Expected: all
func2 should be removed and
func1 &
func3 should be called twice.
https://github.com/appcelerator/titanium_mobile_windows/pull/1354
FR passed. removeEventListener works as expected.waiting for resolving Jenkins test failure to merge
PR Merged.
Closing ticket, fix verified in SDK version 8.1.0.v20190301040201. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1354