Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index ab4ded2472971ea519ba412b40c16bfc39804ad1..06e4b3a432e5f8ded388efa2830a413e099ecd84 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -1937,6 +1937,22 @@ v8::Handle<Value> Message::GetScriptResourceName() const { |
} |
+v8::Handle<Value> Message::GetScriptResourceNameOrSourceURL() const { |
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
+ ENTER_V8(isolate); |
+ EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
+ i::Handle<i::JSMessageObject> message = |
+ i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); |
+ // Return this.script.name. |
vsevik
2014/04/30 10:18:40
This comment seems incorrect.
|
+ i::Handle<i::JSValue> scriptValue = |
+ i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), |
+ isolate)); |
+ i::Handle<i::Script> script(i::Script::cast(scriptValue->value())); |
+ i::Handle<i::Object> script_name = i::Script::GetNameOrSourceURL(script); |
+ return scope.Escape(Utils::ToLocal(script_name)); |
+} |
+ |
+ |
v8::Handle<v8::StackTrace> Message::GetStackTrace() const { |
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
ENTER_V8(isolate); |