builds 2000-09-05-08-M18. all platforms. 1. Go to http://jimbob/trigger3.html 2. Enter f_fileop_fileisdirectory_err.xpi in URL field (http://jimbob/jars). 3. Trigger. OK. 4. Check logfile. Result: Returns 'false' for invalid parameters (i.e. strings) to File.isDir Expected: Error -208 (although the API returns a boolean, it still should catch invalid params and return the error). script: initInstall("Functional: f_fileop_fileisdirectory_err", "functional", "22.214.171.124", 0); err1 = File.isDirectory("myFile"); logComment("String input to File.isDirectory should return -208 = " + err1); err2 = File.isDirectory(10); logComment("Integer input to File.isDirectory should return -208 = " + err2); err3 = File.isDirectory(); logComment("Empty input to File.isDirectory should return -208 = " + err3); err4 = File.isDirectory(null); logComment("Null input to File.isDirectory should return -208 = " + err4); performInstall();
Sorry, only two values from a boolean. If it's a directory you get true, anything else you get false. false by itself doesn't tell you what it is -- that's why isFile() and exists() are there, to help people narrow it down.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID
But then this routine (and others that return booleans like File.isFile) isn't handling error conditions. 'False' then is either a syntax error or indicates the target is not a directory. It would be desirable for the script writer to know when the routine has an invalid input. Maybe it would be better if these routines returned an integer value and convert 1 & 0 to 'True' & 'False' respectively.
Changing QA Contact to David. Ccing me.
QA Contact: jimmylee → depstein
They are supposed to handle error conditions just fine, they just don't report them. This is hardly unusual behavior, it is quite similar to the behavior of the underlying nsILocalFile API we are using.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.