Index: Source/web/WebPluginContainerImpl.cpp |
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp |
index e3881dca90fa35233aa035f62cf71710b12d1d3d..27e70b3fcf48d838c7cf736819624d03f8fd0650 100644 |
--- a/Source/web/WebPluginContainerImpl.cpp |
+++ b/Source/web/WebPluginContainerImpl.cpp |
@@ -442,12 +442,13 @@ WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup |
kurl.string().substring(strlen("javascript:"))); |
UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture); |
- ScriptValue result = frame->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script)); |
+ v8::HandleScope handleScope(toIsolate(frame)); |
+ v8::Local<v8::Value> result = frame->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script)); |
// Failure is reported as a null string. |
- String resultString; |
- result.toString(resultString); |
- return resultString; |
+ if (result.IsEmpty() || !result->IsString()) |
+ return WebString(); |
+ return toCoreString(v8::Handle<v8::String>::Cast(result)); |
} |
void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData) |