Fixes Issue 9291 - ICE on throwing undefined identifier.
Merge pull request #1461 from AndrejMitrovic/Fix9291

Issue 9291 - ICE on throwing undefined identifier