Are stack traces supported?

Aug 30, 2010 at 7:58 PM

I'd like to include a bunch of files, and then if there are any errors (and there will be, because they are unit tests) I would love for Javascript.NET to give me file names and line numbers in a stack trace that comes back.

Is that possible?  What would it take to make that happen?

Aug 31, 2010 at 6:55 PM

You're talking about a bunch of javascript files ?

If yes, can you show a little example of what you want to accomplish with the stack trace to run your units test.

Thanks.

Sep 2, 2010 at 5:51 PM
Sure.  I've created a super trimmed down version of what I was trying to do, and uploaded the code here :


I'm running unit tests using Jasmine and Javascript.NET.  It's a normal condition to get failures as I go through development, and currently, all the stack traces associated are pretty worthless.  

Here's an example :

X
Roman should parse single values.
Error: Expected 10 to be 20.
    at new <anonymous> (unknown source)
    at [object Object].toBe (unknown source)
    at [object Object].<anonymous> (unknown source)
    at [object Object].execute (unknown source)
    at [object Object].next_ (unknown source)
    at unknown source
    at unknown source
    at [object Object].setTimeout (unknown source)
    at unknown source
    at [object Object].next_ (unknown source)
...

4 specs run, 1 failures

All the places where it says "unknown source" should instead give the filename in which the error happened.  But V8 doesn't have that information because I never gave it to it.  Files are are included using something like this :

context.Run(File.ReadAllText(path));

and there's no way (I can see) to give the javascript context the name of the file being loaded.

Like I said, the code is up on github.  I'd be happy to answer any questions.  I might even be happy to help out if you guys can point me in the right direction.  It's definitely painful to try to debug stuff when it blows up in a 3rd party library with a generic error with no stack trace...

Thanks for a great product!

----
Jeremy Lightsmith
Helping Software Teams Get More Productive with tools like Agile, Lean, & Rails
312-953-1193
http://jeremylightsmith.com/
http://facilitationpatterns.org/ (book in progress)
http://www.linkedin.com/in/jeremylightsmith



On Tue, Aug 31, 2010 at 10:55 AM, deacon_frost22 <notifications@codeplex.com> wrote:

From: deacon_frost22

You're talking about a bunch of javascript files ?

If yes, can you show a little example of what you want to accomplish with the stack trace to run your units test.

Thanks.

Read the full discussion online.

To add a post to this discussion, reply to this email (javascriptdotnet@discussions.codeplex.com)

To start a new discussion for this project, email javascriptdotnet@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Sep 2, 2010 at 11:26 PM

The incoming 0.4 release will improve the stack output. One improvement was to map the toString( ) javascript method to the ToString( ) CLI method, which will replace all these [object Object] items to the actual CLI string form of the object.

Associating a resource name to scripts supplied through Run( ) calls is a simple task. An optional parameter will be added for this purpose. We will try to make it part of 0.4 if possible.

Thanks for using, testing and submitting improvements for Javascript.NET.