Bug 161929 - Promises aren't resolved properly when making a ObjC API callback
Summary: Promises aren't resolved properly when making a ObjC API callback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-09-13 14:51 PDT by Michael Saboff
Modified: 2016-09-13 19:31 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.86 KB, patch)
2016-09-13 15:17 PDT, Michael Saboff
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2016-09-13 14:51:12 PDT
If a promise is resolved or rejected and the resolution handler is queue but hasn't been processed when an ObjC function callback is invoked, the promise resolution internal builtins may not compile properly.
Comment 1 Michael Saboff 2016-09-13 14:51:38 PDT
rdar://problem/27992169
Comment 2 Michael Saboff 2016-09-13 15:17:10 PDT
Created attachment 288735 [details]
Patch
Comment 3 Geoffrey Garen 2016-09-13 15:21:42 PDT
Comment on attachment 288735 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288735&action=review

r=me

It occurs to me that it is also a bug that we drain the micro task queue at all when calling out to ObjC. That should only happen when we exit the VM.

> Source/JavaScriptCore/ChangeLog:3
> +        Promises aren't resolved properly when making a ObcC API callback

ObjC

> Source/JavaScriptCore/ChangeLog:8
> +        When we go to call out to an Objective C functions registered via the API,

function
Comment 4 Michael Saboff 2016-09-13 19:30:37 PDT
(In reply to comment #3)
> Comment on attachment 288735 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=288735&action=review
> 
> r=me
> 
> It occurs to me that it is also a bug that we drain the micro task queue at
> all when calling out to ObjC. That should only happen when we exit the VM.

I filed https://bugs.webkit.org/show_bug.cgi?id=161942 to track this.

> > Source/JavaScriptCore/ChangeLog:3
> > +        Promises aren't resolved properly when making a ObcC API callback
> 
> ObjC

Fixed.

> > Source/JavaScriptCore/ChangeLog:8
> > +        When we go to call out to an Objective C functions registered via the API,
> 
> function

Fixed.
Comment 5 Michael Saboff 2016-09-13 19:31:28 PDT
Committed r205895: <http://trac.webkit.org/changeset/205895>