[Filesystem] Fixed argument validation in readBytes().
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 29 Jul 2015 09:14:57 +0000 (11:14 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Wed, 29 Jul 2015 09:15:12 +0000 (11:15 +0200)
Fixes: UTC_filesystem_file_readBytes_error_invalid_param_N_001
[Verification] [Verification] Wearable service UTC: 93/94
               Mobile TCT: 289/289

Change-Id: I4e4efc4bca5a74e3e9463bad11f5092c784b846c
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/filesystem/js/file_stream.js

index c5c9e4319bf8cb72ab734064501280a6263ec5c7..b0ede171052ee218f806907bf9d9126e1dcf298d 100755 (executable)
@@ -141,16 +141,8 @@ FileStream.prototype.readBytes = function() {
   _checkClosed(this);
   _checkReadAccess(this._mode);
 
-  if (!arguments.length) {
-    throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
-        'Argument "byteCount" missing');
-  }
-  if (!type_.isNumber(args.byteCount)) {
-    throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
-        'Argument "byteCount" must be a number');
-  }
   if (args.byteCount <= 0) {
-    throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
+    throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR,
         'Argument "byteCount" must be greater than 0');
   }