|
|
@ -272,6 +272,7 @@ static void ReportException(TryCatch *try_catch) { |
|
|
|
if (raw_stack->IsString()) stack = Handle<String>::Cast(raw_stack); |
|
|
|
} |
|
|
|
|
|
|
|
if (stack.IsEmpty()) { |
|
|
|
// Print (filename):(line number): (message).
|
|
|
|
String::Utf8Value filename(message->GetScriptResourceName()); |
|
|
|
const char* filename_string = ToCString(filename); |
|
|
@ -292,7 +293,6 @@ static void ReportException(TryCatch *try_catch) { |
|
|
|
} |
|
|
|
fprintf(stderr, "\n"); |
|
|
|
|
|
|
|
if (stack.IsEmpty()) { |
|
|
|
message->PrintCurrentStackTrace(stderr); |
|
|
|
} else { |
|
|
|
String::Utf8Value trace(stack); |
|
|
@ -653,12 +653,11 @@ v8::Handle<v8::Value> Compile(const v8::Arguments& args) { |
|
|
|
} |
|
|
|
|
|
|
|
static void OnFatalError(const char* location, const char* message) { |
|
|
|
#define FATAL_ERROR "\033[1;31mV8 FATAL ERROR.\033[m" |
|
|
|
if (location) |
|
|
|
fprintf(stderr, FATAL_ERROR " %s %s\n", location, message); |
|
|
|
else |
|
|
|
fprintf(stderr, FATAL_ERROR " %s\n", message); |
|
|
|
|
|
|
|
if (location) { |
|
|
|
fprintf(stderr, "FATAL ERROR: %s %s\n", location, message); |
|
|
|
} else { |
|
|
|
fprintf(stderr, "FATAL ERROR: %s\n", message); |
|
|
|
} |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
|
|
|
|