[eval] Fix delegate; add caching for PrepareEmit

The delegate class did not use the internal cache flag as other type definitions which caused the next evaluation to fail.
Merge pull request #1334 from ztone/delegate

Fix PrepareEmit error when evaluating delegates