From 76a820a91e4ce6d52be0f29db83def5092857d9b Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Tue, 20 Aug 2013 08:06:48 +0000 Subject: [PATCH] During bootstrapping, the script's name is not necessarily set. So check whether the name is actually set before printing it when throwing an exception. BUG=none R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/23283011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/isolate.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/isolate.cc b/src/isolate.cc index 7b77d89..653ff2e 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1400,17 +1400,19 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) { // to the console for easier debugging. int line_number = GetScriptLineNumberSafe(location->script(), location->start_pos()); - if (exception->IsString()) { + if (exception->IsString() && location->script()->name()->IsString()) { OS::PrintError( "Extension or internal compilation error: %s in %s at line %d.\n", *String::cast(exception)->ToCString(), *String::cast(location->script()->name())->ToCString(), line_number + 1); - } else { + } else if (location->script()->name()->IsString()) { OS::PrintError( "Extension or internal compilation error in %s at line %d.\n", *String::cast(location->script()->name())->ToCString(), line_number + 1); + } else { + OS::PrintError("Extension or internal compilation error.\n"); } } } -- 2.7.4