Index: gin/try_catch.cc |
diff --git a/gin/try_catch.cc b/gin/try_catch.cc |
index 97e7fe15f832b33af9d5648152c2f4986a0f137b..f5c2da048a68280403a303b1a51090b864c139dd 100644 |
--- a/gin/try_catch.cc |
+++ b/gin/try_catch.cc |
@@ -8,9 +8,20 @@ |
#include "gin/converter.h" |
+namespace { |
+ |
+v8::Local<v8::String> GetSourceLine(v8::Local<v8::Message> message) { |
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
jochen (gone - plz use gerrit)
2015/05/27 14:43:26
please pass in the Isolate* as parameter
bashi
2015/05/29 02:04:02
Done.
|
+ auto maybe = message->GetSourceLine(isolate->GetCurrentContext()); |
+ v8::Local<v8::String> source_line; |
+ return maybe.ToLocal(&source_line) ? source_line : v8::String::Empty(isolate); |
+} |
+ |
+} // namespace |
+ |
namespace gin { |
-TryCatch::TryCatch() { |
+TryCatch::TryCatch(v8::Isolate* isolate) : try_catch_(isolate) { |
} |
TryCatch::~TryCatch() { |
@@ -28,7 +39,7 @@ std::string TryCatch::GetStackTrace() { |
std::stringstream ss; |
v8::Local<v8::Message> message = try_catch_.Message(); |
ss << V8ToString(message->Get()) << std::endl |
- << V8ToString(message->GetSourceLine()) << std::endl; |
+ << V8ToString(GetSourceLine(message)) << std::endl; |
v8::Local<v8::StackTrace> trace = message->GetStackTrace(); |
if (trace.IsEmpty()) |