[bluetooth] fixed bug with BluetoothProfileHandler 78/202278/4
authorDawid Juszczak <d.juszczak@samsung.com>
Tue, 26 Mar 2019 15:22:21 +0000 (16:22 +0100)
committerDawid Juszczak <d.juszczak@samsung.com>
Wed, 27 Mar 2019 08:08:25 +0000 (08:08 +0000)
Refactored implementation of BluetoothProfileHandler constructor.

[Verification] (automated) tct-bluetooth-tizen-tests passed 100%

Change-Id: Iff1d3117f7a893da31ce4e6068e7886c4a21ff78
Signed-off-by: Dawid Juszczak <d.juszczak@samsung.com>
src/bluetooth/bluetooth_api.js

index 4f2b9787dd8929f7737a77024efa3b081c7fe14e..0033baba2756044e02e8377418f93d063297770d 100755 (executable)
@@ -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 }
         });
     }
 };