Changeset 257876 in webkit


Ignore:
Timestamp:
Mar 4, 2020 1:35:08 PM (4 years ago)
Author:
achristensen@apple.com
Message:

callAsyncJavaScript with an invalid parameter and no completionHandler should not crash
https://bugs.webkit.org/show_bug.cgi?id=208593

Reviewed by Brady Eidson.

Source/WebKit:

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r257875 r257876  
     12020-03-04  Alex Christensen  <achristensen@webkit.org>
     2
     3        callAsyncJavaScript with an invalid parameter and no completionHandler should not crash
     4        https://bugs.webkit.org/show_bug.cgi?id=208593
     5
     6        Reviewed by Brady Eidson.
     7
     8        * UIProcess/API/Cocoa/WKWebView.mm:
     9        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]):
     10
    1112020-03-04  Per Arne Vollan  <pvollan@apple.com>
    212
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r257872 r257876  
    905905    }
    906906
    907     if (errorMessage) {
     907    if (errorMessage && handler) {
    908908        RetainPtr<NSMutableDictionary> userInfo = adoptNS([[NSMutableDictionary alloc] init]);
    909909
  • trunk/Tools/ChangeLog

    r257872 r257876  
     12020-03-04  Alex Christensen  <achristensen@webkit.org>
     2
     3        callAsyncJavaScript with an invalid parameter and no completionHandler should not crash
     4        https://bugs.webkit.org/show_bug.cgi?id=208593
     5
     6        Reviewed by Brady Eidson.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm:
     9        (TestWebKitAPI::TEST):
     10
    1112020-03-04  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AsyncFunction.mm

    r255998 r257876  
    184184    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
    185185
     186    [webView callAsyncJavaScript:@"shouldn't crash" arguments:@{ @"invalidparameter" : webView.get() } inContentWorld:WKContentWorld.pageWorld completionHandler:nil];
     187
    186188    NSString *functionBody = @"return new Promise(function(resolve, reject) { setTimeout(function(){ resolve(42) }, 0); })";
    187189
Note: See TracChangeset for help on using the changeset viewer.