JS-Interpreter
JS-Interpreter copied to clipboard
Errors in parsed code produce confusing error messages
The following code produces a confusing error message:
var foo = 100; foo();
Actual: 'TypeError: 100 is not a function' Expected: 'TypeError: foo is not a function'
The only problem is that the error message uses the value of 'foo' rather than its name. Fixing this would make debugging parsed code much less confusing.
I'm interested in improving error messages in JS Interpreter (or rather: in a heavily modified fork of it I maintain). If you have any insight into how other interpreters produce better error messages in cases like this I would be most interested in knowing more.