Fix throw exception on emit file

Fix issue #852
You do need to check if the targetSOurceFile is not Declaration file