From: Tomasz Marciniak Date: Mon, 9 Feb 2015 10:26:12 +0000 (+0100) Subject: [Bluetooth] Changed uuids getter. X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~477 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3300dbf001936d0ebd5c5e7e4915ad61bac2df12;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Bluetooth] Changed uuids getter. [Feature] To avoid changing uuids array values getter returns array copy now. [Verification] Code compiles without errors. Change-Id: I6bf7747b8bf26c56698b2bb04d9f8ee7664deb58 Signed-off-by: Tomasz Marciniak --- diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 5812834c..89574eaf 100644 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -317,6 +317,11 @@ var BluetoothDevice = function(data) { return _getter('isConnected'); } + var uuids = []; + if (data) { + uuids = data.uuids; + } + Object.defineProperties(this, { name : {value: data.name, writable: false, enumerable: true}, address : {value: data.address, writable: false, enumerable: true}, @@ -338,7 +343,11 @@ var BluetoothDevice = function(data) { set : function(){}, get : isConnectedGetter }, - uuids : {value: data.uuids, writable: false, enumerable: true} + uuids : { + enumerable: true, + set : function(){}, + get : function(){ return uuids.slice(); } + } }); };