From: Dawid Juszczak Date: Tue, 26 Mar 2019 15:22:21 +0000 (+0100) Subject: [bluetooth] fixed bug with BluetoothProfileHandler X-Git-Tag: submit/tizen/20190328.074934~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F202278%2F4;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [bluetooth] fixed bug with BluetoothProfileHandler Refactored implementation of BluetoothProfileHandler constructor. [Verification] (automated) tct-bluetooth-tizen-tests passed 100% Change-Id: Iff1d3117f7a893da31ce4e6068e7886c4a21ff78 Signed-off-by: Dawid Juszczak --- diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 4f2b9787..0033baba 100755 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -1050,15 +1050,15 @@ var _BluetoothProfileType = { HEALTH : 'HEALTH' }; -var BluetoothProfileHandler = function(data) { - var profileType = data.profileType; - function profileTypeGetter() { - privUtils_.printDeprecationWarningFor('profileType'); - return profileType; - } +var BluetoothProfileHandler = function (data) { if (data) { + var profileType = data.profileType; + function profileTypeGetter() { + privUtils_.printDeprecationWarningFor('profileType'); + return profileType; + } Object.defineProperties(this, { - profileType : {enumerable: true, set : function() {}, get : profileTypeGetter } + profileType: { enumerable: true, set: function () { }, get: profileTypeGetter } }); } };