fholm / IronJS

IronJS - A JavaScript implementation for .NET
http://ironjs.wordpress.com
Apache License 2.0
680 stars 79 forks source link

Unhelpful exception error messages, e.g. "TypeError: 8" when calling function on custom object #81

Closed axefrog closed 13 years ago

axefrog commented 13 years ago

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.

otac0n commented 13 years ago

This is a duplicate of: https://github.com/fholm/IronJS/issues/50 I'm going to close this as such.

Would you mind posting this on that issue? We appreciate your feedback, but we don't want duplicate bug reports floating around.

Thanks!

axefrog commented 13 years ago

Whoops, sorry didn't see that one.