[Filesystem] - Fixing a bug in the tizen.file.readAsText function
authorAndrzej Popowski <a.popowski@samsung.com>
Thu, 17 Sep 2015 12:29:47 +0000 (14:29 +0200)
committerAndrzej Popowski <a.popowski@samsung.com>
Thu, 17 Sep 2015 12:29:47 +0000 (14:29 +0200)
Change-Id: I3aef0ac9f0c709ba25ccd841458d96d27b9a89c6
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/filesystem/js/file.js

index dc68afbcdbc0cd24bdf41316fcf8accc504c05e7..6bcbe42d02c2b5ce20c04f376d333005df4a744a 100755 (executable)
@@ -320,6 +320,7 @@ File.prototype.readAsText = function(onsuccess, onerror, encoding) {
 
     do {
       result = native_.callSyncData('File_readSync', data);
+
       if (native_.isFailure(result)) {
         setTimeout(function() {
           native_.callIfPossible(args.onerror, native_.getErrorObject(result));
@@ -327,8 +328,8 @@ File.prototype.readAsText = function(onsuccess, onerror, encoding) {
         return;
       }
       str += result.output;
-      data.offset += result.data_size;
-    } while (result.data_size);
+      data.offset += result.reply.data_size;
+    } while (result.reply.data_size);
 
     setTimeout(function() {
       native_.callIfPossible(args.onsuccess, str);