(In reply to aceman from comment #123)
> (In reply to comment #122)
> > (From update of attachment 8374439)
> Is this issue really that important that we make tens of comments in such a
> long thread? It is not a perf critical path.
I'm after readability here, not perf, in particular I don't like breaking at the end of a for loop, because it's easy to miss that this skips the increment.
> > >+ try {
> > >+ root.copyFolderLocal(folderDeleted3, true, null, null);
> > >+ do_throw("copyFolderLocal() should have failed here due to user prompt!");
> > I'm not sure why you're trying to throw from inside this try block, but I
> > don't know enough about writing tests to know whether there's a better way.
> I expect .copyFolderLocal to throw and be catched by my catch. But if it
> does not throw (wrong behaviour), the next throw is not catched and fails
> the test.
Sure, but my question is is it safe to put do_throw in a try block?
> > >+ } catch (e) {
> > >+ do_check_eq(e.result, parseInt("0x8055001a", 16));
> > Why not just write 0x8055001a?
> Because e.result returns the code in decimal. Is there other method of 'e' I
> can use?
nsIException.idl (if that's the right one) says that result is an unsigned long, not a decimal. So I don't see why you can't compare it to any other integer.
> > >+confirmDuplicateFolderRename=A folder with that name already exists under folder '%1$S'. Would you like to copy the folder under a new name of '%2$S'?
> > A subfolder with that name already exists in the folder '%1$S'. Would you
> > like to move the folder using the new name of '%2$S'?
>
> Irving proposed some other wording with more arguments. So what should I do
> now?
Sorry, I hadn't seen his wording. How about:
A subfolder with the name '%$1S' already exists in the folder '%2$S'. Would you like to move this folder using the new name of '%3$S'?
(I don't really want to use a / because that's an implementation detail.)
(In reply to aceman from comment #123)
> (In reply to comment #122)
> > (From update of attachment 8374439)
> Is this issue really that important that we make tens of comments in such a
> long thread? It is not a perf critical path.
I'm after readability here, not perf, in particular I don't like breaking at the end of a for loop, because it's easy to miss that this skips the increment.
> > >+ try { Local(folderDel eted3, true, null, null); "copyFolderLoca l() should have failed here due to user prompt!");
> > >+ root.copyFolder
> > >+ do_throw(
> > I'm not sure why you're trying to throw from inside this try block, but I
> > don't know enough about writing tests to know whether there's a better way.
> I expect .copyFolderLocal to throw and be catched by my catch. But if it
> does not throw (wrong behaviour), the next throw is not catched and fails
> the test.
Sure, but my question is is it safe to put do_throw in a try block?
> > >+ } catch (e) { eq(e.result, parseInt( "0x8055001a" , 16));
> > >+ do_check_
> > Why not just write 0x8055001a?
> Because e.result returns the code in decimal. Is there other method of 'e' I
> can use?
nsIException.idl (if that's the right one) says that result is an unsigned long, not a decimal. So I don't see why you can't compare it to any other integer.
> > >+confirmDuplic ateFolderRename =A folder with that name already exists under folder '%1$S'. Would you like to copy the folder under a new name of '%2$S'?
> > A subfolder with that name already exists in the folder '%1$S'. Would you
> > like to move the folder using the new name of '%2$S'?
>
> Irving proposed some other wording with more arguments. So what should I do
> now?
Sorry, I hadn't seen his wording. How about:
A subfolder with the name '%$1S' already exists in the folder '%2$S'. Would you like to move this folder using the new name of '%3$S'?
(I don't really want to use a / because that's an implementation detail.)