Improved error message for undefined variable in js eval statement.

Fixes #1765.