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.
We could make this still more concise by generating these strings using `nextVal`, but I thought this was a case where a little duplication would be preferable. Since they're part of an error message, users may use tools like `grep` to search for them.