Bug 157795

Summary: Promise resolution should be able to use toJSNewlyCreated for new objects
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

youenn fablet
Reported 2016-05-17 08:11:13 PDT
WebIDL defines NewObject for APIs returning new objects. This allows doing some optimization at the JS binding layer. I would be good to have the same thing somehow for promises, although there is no WebIDL flags to help on that.
Attachments
youenn fablet
Comment 1 2016-05-17 08:13:21 PDT
One option is to add to DOMPromise something like resolveWithNewValue which would take a Ref<T>&&/RefPtr<T>&&. Another option would be to use toJSNewlyCreated when resolve() is passed a Ref<T>&&/RefPtr<T>&&, although this may be too error-prone.
youenn fablet
Comment 2 2017-10-14 16:52:33 PDT
resolveWithNewlyCreated was added in another patch
Note You need to log in before you can comment on or make changes to this bug.