Commit 424d4f3b authored by Michael Starzinger's avatar Michael Starzinger

[d8] Make exception reporting more resilient.

This is a follow-up to a recent fix to make the exception reporting even
more resilient. The original regression test flushed out more issues on
different configurations.

TBR=yangguo@chromium.org
TEST=mjsunit/regress/regress-crbug-620253
BUG=chromium:620253
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/2071783002 .

Cr-Commit-Position: refs/heads/master@{#37032}
parent e55384b2
......@@ -928,12 +928,12 @@ void Shell::ReportException(Isolate* isolate, v8::TryCatch* try_catch) {
Maybe<int> maybeline = message->GetLineNumber(isolate->GetCurrentContext());
int linenum = maybeline.IsJust() ? maybeline.FromJust() : -1;
printf("%s:%i: %s\n", filename_string, linenum, exception_string);
if (maybeline.IsJust()) {
Local<String> sourceline;
if (message->GetSourceLine(isolate->GetCurrentContext())
.ToLocal(&sourceline)) {
// Print line of source code.
v8::String::Utf8Value sourceline(
message->GetSourceLine(isolate->GetCurrentContext())
.ToLocalChecked());
const char* sourceline_string = ToCString(sourceline);
v8::String::Utf8Value sourcelinevalue(sourceline);
const char* sourceline_string = ToCString(sourcelinevalue);
printf("%s\n", sourceline_string);
// Print wavy underline (GetUnderline is deprecated).
int start =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment