To access JS object members we have to use 'this' keyword.
Change-Id: If8bed93bb33cbc4e2dee9c01c04314c46106a2a7
ListenerManager.prototype.addListener = function(callback, nativeCall, data) {
var id = this.nextId;
- if (!nativeSet) {
- native.addListener(listenerName, function(msg) {
+ if (!this.nativeSet) {
+ this.native.addListener(this.listenerName, function(msg) {
for (var watchId in this.listeners) {
if (this.listeners.hasOwnProperty(watchId)) {
this.handle(msg, this.listeners[watchId], watchId);