$.pio_ = {
    //Evaluate a file and catch the exception.
    evalFile : function(path) {
        try {
            $.evalFile(path);
        } catch (e) {alert("Exception:" + e);}
    },
    // Evaluate all the files in the given folder
    evalFiles: function(jsxFolderPath) {
        var folder = new Folder(jsxFolderPath);
        if (folder.exists) {
            var jsxFiles = folder.getFiles("*.jsxbin");
            jsxFiles.push(folder.getFiles("*.jsx"));
            // var jsxFiles = folder.getFiles(
            //     function(file){
            //         var ext = file.fsName.split('.').pop();
            //         if(ext == 'jsx' || ext == 'jsxbin')
            //             return true;
            //     }
            // );
            for (var i = 0; i < jsxFiles.length; i++) {
                var jsxFile = jsxFiles[i];
                $.pio_.evalFile(jsxFile);
            }
        }
    }
};
