Skip to content

Commit

Permalink
[all] Use argscheck in requestFileSystem.js
Browse files Browse the repository at this point in the history
  • Loading branch information
agrieve committed Nov 22, 2012
1 parent 1fe276b commit ee4a70c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/common/plugin/requestFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit ee4a70c

Please sign in to comment.