This was way more complicated than I anticipated, but I'm satisfied with how it turned out. I removed the other patches past the duplicate arguments one, because now the MR would have been too large. I'll send them as a follow up MR after this.
Now I moved the arguments_obj from the frame to the scope since we need it for lookup (and I had to take care of eval frames, which aren't the same as the scope's frame). Then I had to patch all places where identifier lookup is done (two of them) so that it looks into the argument obj if it fits the requirements; so instead of an IDREF to the scope's jsobj, it's an IDREF into the arguments obj.
I also took the liberty to simplify some other parts of the code, in separate commits of course.