Reviewers: Michael Starzinger,
Message:
Committed patchset #1 manually as r16233.
Description:
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
Committed: https://code.google.com/p/v8/source/detail?r=16233
Please review this at https://codereview.chromium.org/23283011/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/isolate.cc
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index
7b77d893f15451738d6ecada03a7eafa7ca600de..653ff2ef79d4593b3de0e1da7bdbc3e9708cdc93
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");
}
}
}
--
--
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.