[Convergence] Fix for Device readonly attributes. 24/99924/1
authorTomasz Marciniak <t.marciniak@samsung.com>
Thu, 24 Nov 2016 11:55:20 +0000 (20:55 +0900)
committerTomasz Marciniak <t.marciniak@samsung.com>
Thu, 24 Nov 2016 12:00:06 +0000 (21:00 +0900)
[Verification] Code compiles.

Change-Id: If9c98b7c2cf37d35ebbdb10650d78ccdcd153e2f
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
src/convergence/convergence_api.js

index 753a98e285d4e1141256d7422baeb7ab86c633e1..022cb659c44ef46c439dc4c4fc2cd5227a3150ed 100644 (file)
@@ -83,12 +83,30 @@ function getServiceConnectionStateName(connectionStateNumber) {
   }
 }
 
-function Device(id, name, type, services) {
+function Device(id_, name_, type_, services_) {
   validator_.isConstructorCall(this, Device);
-  this.id = id;
-  this.name = name;
-  this.type = type;
-  this.services = services;
+  Object.defineProperties(this, {
+    id: {
+      value: id_,
+      writable: false,
+      enumerable: true
+    },
+    name: {
+      value: name_,
+      writable: false,
+      enumerable: true
+    },
+    type: {
+      value: type_,
+      writable: false,
+      enumerable: true
+    },
+    services: {
+      value: services_,
+      writable: false,
+      enumerable: true
+    },
+  });
 }
 
 function ConvergenceManager() {