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

Unified Diff: src/api.cc

Issue 23536007: Add scriptId to StackTrace frames. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 4 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') | src/isolate.cc » ('j') | test/cctest/test-api.cc » ('J')
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 643a5b4100082a31b50eb7de472ba9fe256574c9..cd7c4fbe0ac51aa2b5b83f8c44cd0f126d08d8b2 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2356,6 +2356,22 @@ int StackFrame::GetColumn() const {
}
+int StackFrame::GetScriptId() const {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ if (IsDeadCheck(isolate, "v8::StackFrame::GetScriptId()")) {
+ return Message::kNoScriptIdInfo;
+ }
+ ENTER_V8(isolate);
+ i::HandleScope scope(isolate);
+ i::Handle<i::JSObject> self = Utils::OpenHandle(this);
+ i::Handle<i::Object> scriptId = GetProperty(self, "scriptId");
+ if (!scriptId->IsSmi()) {
+ return Message::kNoScriptIdInfo;
+ }
+ return i::Smi::cast(*scriptId)->value();
+}
+
+
Local<String> StackFrame::GetScriptName() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (IsDeadCheck(isolate, "v8::StackFrame::GetScriptName()")) {
« no previous file with comments | « include/v8.h ('k') | src/isolate.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698