From: Szymon Jastrzebski Date: Fri, 18 Nov 2016 10:11:53 +0000 (+0100) Subject: [Filesystem] Method read() fixed X-Git-Tag: submit/tizen_3.0/20161121.011946~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc184a82bacb0abad3433c0c26204db383082ba2;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Filesystem] Method read() fixed [Feature] read() should throw an exception after reaching EOF [Verification] TCT tests passed on wearable and mobile Change-Id: I6d91c5fd7c40ed11ad4cefbd29eb753179eac925 Signed-off-by: Szymon Jastrzebski --- diff --git a/src/filesystem/js/file_stream.js b/src/filesystem/js/file_stream.js index 2abc68ff..1d3f708b 100644 --- a/src/filesystem/js/file_stream.js +++ b/src/filesystem/js/file_stream.js @@ -121,6 +121,9 @@ function read() { throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Argument "charCount" must be greater than 0'); } + if(this.eof) { + throw new WebAPIException(WebAPIException.IO_ERR, 'Stream is marked as EOF.'); + } var _count = this.bytesAvailable;