From 7b6bff01cdd91ca098225f43bbccadd901599baa Mon Sep 17 00:00:00 2001 From: Ian Taylor Date: Thu, 21 Jun 2012 11:07:54 +0200 Subject: [PATCH] Issue #3452, adding back DisplayExceptionLine and comment about V8 rethrow being broken. --- src/node_script.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node_script.cc b/src/node_script.cc index 952ec521db2..a84963a47c7 100644 --- a/src/node_script.cc +++ b/src/node_script.cc @@ -393,10 +393,13 @@ Handle WrappedScript::EvalMachine(const Arguments& args) { script = output_flag == returnResult ? Script::Compile(code, filename) : Script::New(code, filename); if (script.IsEmpty()) { + //V8 TryCatch.ReThrow is broken. Calling it resets the stack trace to + //the place where ReThrow was called. This makes it impossible to get a stack + //trace after the an error has been rethrown. Until this V8 bug is fixed, this + //display_error argument makes it possible to log the location information. + if(display_error) DisplayExceptionLine(try_catch); + return try_catch.ReThrow(); -// return v8::ThrowException(val); -// FatalException(try_catch); -// return v8::Undefined(); } } else { WrappedScript *n_script = ObjectWrap::Unwrap(args.Holder());