Revision: 16233
Author:   joc...@chromium.org
Date:     Tue Aug 20 08:06:48 2013 UTC
Log:      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=mstarzin...@chromium.org

Review URL: https://codereview.chromium.org/23283011
http://code.google.com/p/v8/source/detail?r=16233

Modified:
 /branches/bleeding_edge/src/isolate.cc

=======================================
--- /branches/bleeding_edge/src/isolate.cc      Wed Aug  7 09:33:09 2013 UTC
+++ /branches/bleeding_edge/src/isolate.cc      Tue Aug 20 08:06:48 2013 UTC
@@ -1400,17 +1400,19 @@
       // 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");
       }
     }
   }

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to