this.nativeSet = false;
this.native = native;
this.listenerName = listenerName;
- this.handle = handle || function() {};
+ this.handle = handle || function() { return undefined; };
}
ListenerManager.prototype.addListener = function(callback, nativeCall, data) {
var id = this.nextId;
- if (!this.nativeSet) {
- this.native.addListener(this.listenerName, function(msg) {
+ if (!nativeSet) {
+ native.addListener(listenerName, function(msg) {
for (var watchId in this.listeners) {
if (this.listeners.hasOwnProperty(watchId)) {
this.handle(msg, this.listeners[watchId], watchId);
default:
throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
'Received incorrect param object from plugin');
- };
+ }
}
native_.callIfPossible(args.successCallback, retArgs.cmd, params);