Convert this the other way:

~~~
if (this._listeners[name] && ~idx) {
	this._listeners[name].splice(idx, 1);
	this._listeners[name].length || sendNativeMessage('r', 're' + JSON.stringify({
		hnd: this._hnd,
		name: name
	}));
}
~~~