fix($parse): correctly assign expressions who's path is undefined and that use brackets notation

Closes #8039
Check if key is safeName first