GNOME Bugzilla – Bug 666614
Exception was: TypeError: one is undefined
Last modified: 2011-12-20 21:44:25 UTC
This appears in my log: JS ERROR: !!! Exception was: TypeError: one is undefined JS ERROR: !!! lineNumber = '1147' JS ERROR: !!! fileName = '"/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js"' JS ERROR: !!! stack = '"((void 0),[object Object])@/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js:1147 wrapper((void 0),[object Object])@/home/jstpierre/Source/gnome3/install/share/gjs-1.0/lang.js:169 lowerBound([object Array],[object Object],wrapper)@/home/jstpierre/Source/gnome3/source/gnome-shell/js/misc/util.js:268 insertSorted([object Array],[object Object],wrapper)@/home/jstpierre/Source/gnome3/source/gnome-shell/js/misc/util.js:280 ([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js:1254 wrapper([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/home/jstpierre/Source/gnome3/install/share/gjs-1.0/lang.js:169 "' JS ERROR: !!! message = '"one is undefined"'
Created attachment 203983 [details] [review] Util: fix binary search exit condition The loop can exit with an interval of length one or one of length zero. In the first case it is correct to check which side of the interval to return, in the second case no comparison should be made (since there is only one possible value). In practice, this usually results in one comparison more than needed, but in some cases (when the position was past the end of the array), would call the comparator with undefined.
Review of attachment 203983 [details] [review]: The funny thing is that I was going to ask for a test for this but said "screw it, just commit now". I guess I should trust my gut more.
Attachment 203983 [details] pushed as bbdce15 - Util: fix binary search exit condition