[Sensor] Not using ECMAScript6 code 27/151027/1
authorPiotr Kosko <p.kosko@samsung.com>
Tue, 19 Sep 2017 11:06:47 +0000 (13:06 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Tue, 19 Sep 2017 11:07:12 +0000 (13:07 +0200)
[Bug] Web Widget Engine does not support ECMAScript6,
  so it is needed to workaround internal code which used it.

[Verification] Code compiles without errors.
  TCT passrate of sensors is 100%.
  Some Web Widget tests passed without error.

Change-Id: I2110b35ce0ed9a4a8e3660b9c77b2a687585063f
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
src/sensor/sensor_api.js

index df4aeb920be7dbd7155b36f833a73562646b7ea3..7a68684a4ad324559afe4f8b3e2effad7ff10019 100755 (executable)
@@ -169,7 +169,7 @@ var errorWrapper = function (err) {
 };
 
 var _listener = function(object) {
-    if (object.sensorType.startsWith('LED_')) {
+    if (object.sensorType.substring(0,4) === 'LED_') {
         object.sensorType = 'HRM_RAW';
     }
     _sensorListeners[object.sensorType].tryCall(object);