Permalink
Browse files

[all] Use argscheck in requestFileSystem.js

  • Loading branch information...
agrieve committed Nov 22, 2012
1 parent 1fe276b commit ee4a70cce10fadd7a7563eb2941f231c9841d009
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/common/plugin/requestFileSystem.js
@@ -19,7 +19,8 @@
*
*/
-var FileError = require('cordova/plugin/FileError'),
+var argscheck = require('cordova/argscheck'),
+ FileError = require('cordova/plugin/FileError'),
FileSystem = require('cordova/plugin/FileSystem'),
exec = require('cordova/exec');
@@ -31,10 +32,9 @@ var FileError = require('cordova/plugin/FileError'),
* @param errorCallback invoked if error occurs retrieving file system
*/
var requestFileSystem = function(type, size, successCallback, errorCallback) {
+ argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
var fail = function(code) {
- if (typeof errorCallback === 'function') {
- errorCallback(new FileError(code));
- }
+ errorCallback && errorCallback(new FileError(code));
};
if (type < 0 || type > 3) {
@@ -43,7 +43,7 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) {
// if successful, return a FileSystem object
var success = function(file_system) {
if (file_system) {
- if (typeof successCallback === 'function') {
+ if (successCallback) {
// grab the name and root from the file system object
var result = new FileSystem(file_system.name, file_system.root);
successCallback(result);

0 comments on commit ee4a70c

Please sign in to comment.