Title: [122476] trunk/Source/WebKit/blackberry
Revision
122476
Author
[email protected]
Date
2012-07-12 10:10:56 -0700 (Thu, 12 Jul 2012)

Log Message

WebPage::executeJavaScriptFunction crashes when there is an exception
https://bugs.webkit.org/show_bug.cgi?id=91098
RIM PR #149294

When there is an exception currently the code tries to get the string of
the exception via JSValueToStringCopy to pass back, but this cases a
crash inside _javascript_Core, so change it to simply return false and not
set the return value with the exception string.

Patch by Benjamin C Meyer <[email protected]> on 2012-07-12
Reviewed by George Staikos.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::executeJavaScriptFunction):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (122475 => 122476)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-07-12 17:10:43 UTC (rev 122475)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-07-12 17:10:56 UTC (rev 122476)
@@ -881,9 +881,8 @@
 
     JSObjectRef functionObject = obj;
     JSValueRef result = 0;
-    JSValueRef exception;
     if (functionObject && thisObject)
-        result = JSObjectCallAsFunction(ctx, functionObject, thisObject, args.size(), argListRef.data(), &exception);
+        result = JSObjectCallAsFunction(ctx, functionObject, thisObject, args.size(), argListRef.data(), 0);
 
     for (unsigned i = 0; i < args.size(); ++i)
         JSStringRelease(argList[i]);
@@ -892,11 +891,6 @@
 
     if (!value) {
         returnType = JSException;
-        JSStringRef stringRef = JSValueToStringCopy(ctx, exception, 0);
-        size_t bufferSize = JSStringGetMaximumUTF8CStringSize(stringRef);
-        WTF::Vector<char> buffer(bufferSize);
-        JSStringGetUTF8CString(stringRef, buffer.data(), bufferSize);
-        returnValue = WebString::fromUtf8(buffer.data());
         return false;
     }
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (122475 => 122476)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-07-12 17:10:43 UTC (rev 122475)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-07-12 17:10:56 UTC (rev 122476)
@@ -1,3 +1,19 @@
+2012-07-12  Benjamin C Meyer  <[email protected]>
+
+        WebPage::executeJavaScriptFunction crashes when there is an exception
+        https://bugs.webkit.org/show_bug.cgi?id=91098
+        RIM PR #149294
+
+        When there is an exception currently the code tries to get the string of
+        the exception via JSValueToStringCopy to pass back, but this cases a
+        crash inside _javascript_Core, so change it to simply return false and not
+        set the return value with the exception string.
+
+        Reviewed by George Staikos.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::executeJavaScriptFunction):
+
 2012-07-12  Pawel Chomicki  <[email protected]>
 
         [BlackBerry] WebPage::touchEvent() should use Platform::TouchEvent's toString() for debugging.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to