Comment 81 for bug 572074

Revision history for this message
In , Dao+bmo (dao+bmo) wrote :

(In reply to :Gijs Kruitbosch from comment #74)
> Meh. r+ I guess? I'm not sure why this is "simpler", but obviously it works,
> so whatever.

Mostly because it avoids this blob of spaghetti code:

+ let sourceNotKeyEvent = !event.sourceEvent || event.sourceEvent.target.localName != "key";
+ let relatedToCurrent = (where == "tab" || where == "tabshifted") && sourceNotKeyEvent;
+ openUILinkIn(BROWSER_NEW_TAB_URL, where == "tabshifted" ? where : "tab",
+ {relatedToCurrent});

Comment 65 was just a quick suggestion to streamline the logic a bit. I didn't say "please rewrite exactly like this to make this code awesome." So unfortunately, I still find the above hard to read. Code where you need to concentrate for a minute to decipher the structure is likely bad code. (Except for well-written regular expressions. I love regular expressions. :>)