[BUGFIX release] Fix hasThis lookup regression

Also optimizes lookup using lastIndexOf(x, 0), resulting in a constant time lookup