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()")) { |