From: vitalyr@chromium.org Date: Fri, 14 May 2010 10:00:24 +0000 (+0000) Subject: Add stack traces to mjsunit tests. X-Git-Tag: upstream/4.7.83~21806 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3260fb9465f454e4fbfceff6a05b076fb3bb057a;p=platform%2Fupstream%2Fv8.git Add stack traces to mjsunit tests. Review URL: http://codereview.chromium.org/2094005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4654 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/samples/shell.cc b/samples/shell.cc index 27ed293..1a13f5f 100644 --- a/samples/shell.cc +++ b/samples/shell.cc @@ -299,5 +299,10 @@ void ReportException(v8::TryCatch* try_catch) { printf("^"); } printf("\n"); + v8::String::Utf8Value stack_trace(try_catch->StackTrace()); + if (stack_trace.length() > 0) { + const char* stack_trace_string = ToCString(stack_trace); + printf("%s\n", stack_trace_string); + } } } diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js index 07c4e7e..558282f 100644 --- a/test/mjsunit/mjsunit.js +++ b/test/mjsunit/mjsunit.js @@ -27,6 +27,8 @@ function MjsUnitAssertionError(message) { this.message = message; + // This allows fetching the stack trace using TryCatch::StackTrace. + this.stack = new Error("").stack; } MjsUnitAssertionError.prototype.toString = function () {