The error was that `staticCandidates[candidate]` was not undefined for inherited properties like `staticCandidates.__defineGetter__`. The fix I made was to check that they are numbers. This fix will fail if an inherited property is a number. The better fix would be to use sets.
if it results in an invalid syntax. > window.a = [1,2,3]; > window.a. has 0, 1, 2 as properties, which upon selection yields: > window.a.0 which is invalid.