Index: src/api.cc |
=================================================================== |
--- src/api.cc (revision 5040) |
+++ src/api.cc (working copy) |
@@ -1438,6 +1438,22 @@ |
} |
+v8::Handle<v8::StackTrace> Message::GetStackTrace() const { |
+ if (IsDeadCheck("v8::Message::GetStackTrace()")) { |
+ return Local<v8::StackTrace>(); |
+ } |
+ ENTER_V8; |
+ HandleScope scope; |
+ i::Handle<i::JSObject> obj = |
+ i::Handle<i::JSObject>::cast(Utils::OpenHandle(this)); |
+ i::Handle<i::Object> stackFramesObj = GetProperty(obj, "stackFrames"); |
+ if (!stackFramesObj->IsJSArray()) return v8::Handle<v8::StackTrace>(); |
+ i::Handle<i::JSArray> stackTrace = |
+ i::Handle<i::JSArray>::cast(stackFramesObj); |
+ return scope.Close(Utils::StackTraceToLocal(stackTrace)); |
+} |
+ |
+ |
static i::Handle<i::Object> CallV8HeapFunction(const char* name, |
i::Handle<i::Object> recv, |
int argc, |
@@ -1583,7 +1599,9 @@ |
StackTraceOptions options) { |
if (IsDeadCheck("v8::StackTrace::CurrentStackTrace()")) Local<StackTrace>(); |
ENTER_V8; |
- return i::Top::CaptureCurrentStackTrace(frame_limit, options); |
+ i::Handle<i::JSArray> stackTrace = |
+ i::Top::CaptureCurrentStackTrace(frame_limit, options); |
+ return Utils::StackTraceToLocal(stackTrace); |
} |
@@ -3782,6 +3800,17 @@ |
} |
+void V8::SetCaptureStackTraceForUncaughtExceptions( |
+ bool capture, |
+ int frame_limit, |
+ StackTrace::StackTraceOptions options) { |
+ i::Top::SetCaptureStackTraceForUncaughtExceptions( |
+ capture, |
+ frame_limit, |
+ options); |
+} |
+ |
+ |
void V8::SetCounterFunction(CounterLookupCallback callback) { |
if (IsDeadCheck("v8::V8::SetCounterFunction()")) return; |
i::StatsTable::SetCounterFunction(callback); |