fix TypeError when there are __defineGetter__ or other synthetic references in code