Add object scope to variable scope in variable declaration

This was present for constant declaration, but not variable declaration. It would probably be nice to update `elementScopes` after binds also.