From: Piotr Sawicki
Date: Wed, 12 Dec 2018 12:51:13 +0000 (+0100)
Subject: Fix ListenerManager.addListener method
X-Git-Tag: submit/tizen/20191113.044831^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=754443785ffc72b45e061722ba9eb0d32a350a81;p=platform%2Fcore%2Fwebapi%2Flibteec.git
Fix ListenerManager.addListener method
To access JS object members we have to use 'this' keyword.
Change-Id: If8bed93bb33cbc4e2dee9c01c04314c46106a2a7
---
diff --git a/src/teec/libteec_api.js b/src/teec/libteec_api.js
index 3568a1d..4159600 100644
--- a/src/teec/libteec_api.js
+++ b/src/teec/libteec_api.js
@@ -33,8 +33,8 @@ function ListenerManager(native, listenerName, handle) {
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);