Bug 161929

Summary: Promises aren't resolved properly when making a ObjC API callback
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, keith_miller, mark.lam, saam
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review+

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>