Commit 0442e080 authored by ricow@chromium.org's avatar ricow@chromium.org

Print out line number and extension name when compilation of an extension...

Print out line number and extension name when compilation of an extension fails. This fixes issue 305.
Review URL: http://codereview.chromium.org/8332029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6950fab3
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "macro-assembler.h" #include "macro-assembler.h"
#include "natives.h" #include "natives.h"
#include "objects-visiting.h" #include "objects-visiting.h"
#include "platform.h"
#include "snapshot.h" #include "snapshot.h"
#include "extensions/externalize-string-extension.h" #include "extensions/externalize-string-extension.h"
#include "extensions/gc-extension.h" #include "extensions/gc-extension.h"
...@@ -2006,6 +2007,12 @@ bool Genesis::InstallExtension(v8::RegisteredExtension* current) { ...@@ -2006,6 +2007,12 @@ bool Genesis::InstallExtension(v8::RegisteredExtension* current) {
false); false);
ASSERT(isolate->has_pending_exception() != result); ASSERT(isolate->has_pending_exception() != result);
if (!result) { if (!result) {
// We print out the name of the extension that fail to install.
// When an error is thrown during bootstrapping we automatically print
// the line number at which this happened to the console in the isolate
// error throwing functionality.
OS::PrintError("Error installing extension '%s'.\n",
current->extension()->name());
isolate->clear_pending_exception(); isolate->clear_pending_exception();
} }
current->set_state(v8::INSTALLED); current->set_state(v8::INSTALLED);
......
...@@ -1072,6 +1072,16 @@ void Isolate::DoThrow(MaybeObject* exception, MessageLocation* location) { ...@@ -1072,6 +1072,16 @@ void Isolate::DoThrow(MaybeObject* exception, MessageLocation* location) {
message_obj = MessageHandler::MakeMessageObject("uncaught_exception", message_obj = MessageHandler::MakeMessageObject("uncaught_exception",
location, HandleVector<Object>(&exception_handle, 1), stack_trace, location, HandleVector<Object>(&exception_handle, 1), stack_trace,
stack_trace_object); stack_trace_object);
} else if (location != NULL && !location->script().is_null()) {
// We are bootstrapping and caught an error where the location is set
// and we have a script for the location.
// In this case we could have an extension (or an internal error
// somewhere) and we print out the line number at which the error occured
// to the console for easier debugging.
int line_number = GetScriptLineNumberSafe(location->script(),
location->start_pos());
OS::PrintError("Extension or internal compilation error at line %d.\n",
line_number);
} }
} }
......
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