Skip to content

Commit

Permalink
Issue nodejs#3452, adding back DisplayExceptionLine and comment about…
Browse files Browse the repository at this point in the history
… V8 rethrow being broken.
  • Loading branch information
itaylor-cf committed Jun 21, 2012
1 parent e47371a commit 7b6bff0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/node_script.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,13 @@ Handle<Value> 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<WrappedScript>(args.Holder());
Expand Down

0 comments on commit 7b6bff0

Please sign in to comment.