Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: N" is unhelpful. #50

Open
otac0n opened this issue Jun 30, 2011 · 2 comments
Open

"TypeError: N" is unhelpful. #50

otac0n opened this issue Jun 30, 2011 · 2 comments

Comments

@otac0n
Copy link
Collaborator

otac0n commented Jun 30, 2011

Take this for example:

"abc".substr(0, 2);

This should throw an error indicating that the String prototype does not contain a method called "substr", but rather throws an error with the message "TypeError: N", which is entirely unhelpful.

@axefrog
Copy link

axefrog commented Jul 16, 2011

Would love to see exceptions thrown by the runtime updated so they have helpful messages. This would make it a lot easier to figure out why they have been thrown without needing a deep understanding of IronJS' internals.

Using the wiki article Create a custom javascript object, I created my first custom object for use my with my JavaScript context. Construction of the object worked fine, but when I called the method LoadURL on my object, the following exception was thrown:

Exception thrown: IronJS.UserError: TypeError: 8
at IronJS.Hosting.FSharp.run(Delegate compiled, T t) in C:\Users\otac0n\Projects\IronJS\Src\IronJS\Hosting.fs:line 151
at IronJS.Hosting.CSharp.Context.Execute(String source) in C:\Users\otac0n\Projects\IronJS\Src\IronJS\Hosting.fs:line 240
at ...

Debugging eventually revealed that it was my fault - I messed up the casing when calling my custom object's only function, but this took me a while to realise due to the obscure error message.

@crpietschmann
Copy link

Agreed! "TypeError: N" is really useless for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants