Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: src/api.cc

Issue 655243002: Introduce v8::Exception::GetStackTrace API method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added test Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index fe56c2b8904d590a2861f2d991625a574bd82373..0febe84e589482166394086a14fc54825f3edda7 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6926,6 +6926,21 @@ DEFINE_ERROR(Error)
#undef DEFINE_ERROR
+Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) {
+ i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
+ if (!obj->IsJSObject()) return Local<StackTrace>();
+ i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj);
+ i::Isolate* isolate = js_obj->GetIsolate();
+ ENTER_V8(isolate);
+ i::Handle<i::Name> key = isolate->factory()->detailed_stack_trace_symbol();
+ i::Handle<i::Object> property = i::JSObject::GetDataProperty(js_obj, key);
+ if (property->IsJSArray()) {
+ return Utils::StackTraceToLocal(i::Handle<i::JSArray>::cast(property));
+ }
+ return Local<StackTrace>();
+}
+
+
// --- D e b u g S u p p o r t ---
bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) {
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698