context: function futils_nosepicker(initialPath, typeList, attribs){    const classes = Components.classes;    const interfaces = Components.interfaces;    const PICKER_CTRID = "@mozilla.org/filepicker;1";    const LOCALFILE_CTRID = "@mozilla.org/file/local;1";    const nsIFilePicker = interfaces.nsIFilePicker;    const nsILocalFile = interfaces.nsILocalFile;    var picker = classes[PICKER_CTRID].createInstance(nsIFilePicker);    if (typeof attribs == "object")    {        for (var a in attribs)            picker[a] = attribs[a];    }    else        throw "bad type for param |attribs|";        if (initialPath)    {        var localFile;                if (typeof initialPath == "string")        {            localFile =                classes[LOCALFILE_CTRID].createInstance(nsILocalFile);            localFile.initWithPath(initialPath);        }        else        {            if (!(initialPath instanceof nsILocalFile))                throw "bad type for argument |initialPath|";            localFile = initialPath;        }                picker.displayDirectory = localFile    }    var allIncluded = false;    if (typeof typeList == "string")        typeList = typeList.split(" ");    if (typeList instanceof Array)    {        for (var i in typeList)        {            switch (typeList[i])            {                case "$all":                    allIncluded = true;                    picker.appendFilters(FILTER_ALL);                    break;                                    case "$html":                    picker.appendFilters(FILTER_HTML);                    break;                                    case "$text":                    picker.appendFilters(FILTER_TEXT);                    break;                                    case "$images":                    picker.appendFilters(FILTER_IMAGES);                    break;                                    case "$xml":                    picker.appendFilters(FILTER_XML);                    break;                                    case "$xul":                    picker.appendFilters(FILTER_XUL);                    break;                default:                    picker.appendFilter(typeList[i], typeList[i]);                    break;            }        }    }    if (!allIncluded)        picker.appendFilters(FILTER_ALL);     return picker;}
meta: 1622	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1622/0918cade427e1856c2e2bcfdefa8b4ea3e457b73/file-utils.js/buggy/js/lib/file-utils.js