-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Handle<Value> request =
Shell::DebugCommandToJSONRequest(String::New(command));
if (try_catch.HasCaught()) {
- v8::String::Utf8Value exception(try_catch.Exception());
- const char* exception_string = Shell::ToCString(exception);
- printf("%s\n", exception_string);
+ Shell::ReportException(&try_catch);
PrintPrompt();
return;
}
void Shell::ReportException(v8::TryCatch* try_catch) {
HandleScope handle_scope;
+ bool enter_context = !Context::InContext();
+ if (enter_context) utility_context_->Enter();
v8::String::Utf8Value exception(try_catch->Exception());
const char* exception_string = ToCString(exception);
Handle<Message> message = try_catch->Message();
}
}
printf("\n");
+ if (enter_context) utility_context_->Exit();
}