Merge similar code paths

Not trying to be a busy body here: this helps avoid further duplication in name inference logic I'm working on for gh-1893.

> The paths for ES5 "getter" and "setter" attributes share enough code to
> warrant combination.