You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Take this for example:
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.
The text was updated successfully, but these errors were encountered: