Index: Source/bindings/core/v8/PrivateScriptRunner.cpp |
diff --git a/Source/bindings/core/v8/PrivateScriptRunner.cpp b/Source/bindings/core/v8/PrivateScriptRunner.cpp |
index eb6e41bbbaea71f89eafd4e12595d065fc17e5c9..373e77bc9de3384a8bc80943c5efe2122ea801e8 100644 |
--- a/Source/bindings/core/v8/PrivateScriptRunner.cpp |
+++ b/Source/bindings/core/v8/PrivateScriptRunner.cpp |
@@ -23,8 +23,13 @@ static void dumpV8Message(v8::Handle<v8::Message> message) |
if (message.IsEmpty()) |
return; |
- // FIXME: How can we get a resource name when an exception is thrown by DOM attributes/methods |
- // implemented in private scripts? In that case, currently ResourceName() returns an empty handle. |
+ // FIXME: GetScriptOrigin() and GetLineNumber() return empty handles |
+ // when they are called at the first time if V8 has a pending exception. |
+ // So we need to call twice to get a correct ScriptOrigin and line number. |
+ // This is a bug of V8. |
Jens Widell
2014/08/15 04:55:29
Is there a bug report?
haraken
2014/08/15 04:57:23
Not yet, I'm writing a fix :)
|
+ message->GetScriptOrigin(); |
+ message->GetLineNumber(); |
+ |
v8::Handle<v8::Value> resourceName = message->GetScriptOrigin().ResourceName(); |
String fileName = "Unknown JavaScript file"; |
if (!resourceName.IsEmpty() && resourceName->IsString()) |