Bug 157795
| Summary: | Promise resolution should be able to use toJSNewlyCreated for new objects | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | youenn fablet <youennf> |
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | cdumez, darin |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
youenn fablet
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
youenn fablet
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
resolveWithNewlyCreated was added in another patch