[MessagePort] Convert any invalid values to string (sendMessage()).
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 11 Apr 2016 07:41:07 +0000 (09:41 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 11 Apr 2016 07:41:07 +0000 (09:41 +0200)
This change is a backward compatibility fix.

[Verification] TCT pass rate: 100% (51/51/0/0/0)

Change-Id: Ia5f5f8f91e973478977a5ab822def4147ff3d9cd
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messageport/messageport_api.js

index f8406b462abc2a38186726b2ca83bc3cb22a5809..acc1caea4b873c4b6601503097446de3f37270a3 100755 (executable)
@@ -17,6 +17,7 @@
 var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var type_ = xwalk.utils.type;
+var converter_ = xwalk.utils.converter;
 
 var callbackId = 0;
 var callbacks = {};
@@ -337,6 +338,9 @@ RemoteMessagePort.prototype.sendMessage = function() {
         }
         filtered_data[i] = { key: key, value: value, valueType: 'byteStreamArrayValueType'};
       }
+    } else {
+      // convert any other value to string -> backward compatibility
+      filtered_data[i] = { key: key, value: converter_.toString(value), valueType: 'stringValueType'};
     }
     unique_data_key[key] = true;
   }