Bug 200829 - [JSC] Promise.prototype.finally should accept non-promise objects
Summary: [JSC] Promise.prototype.finally should accept non-promise objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 200739
  Show dependency treegraph
 
Reported: 2019-08-16 13:34 PDT by Yusuke Suzuki
Modified: 2019-08-16 14:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.35 KB, patch)
2019-08-16 13:35 PDT, Yusuke Suzuki
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2019-08-16 13:34:24 PDT
[JSC] Promise.prototype.finally should accept non-promise objects
Comment 1 Yusuke Suzuki 2019-08-16 13:35:59 PDT
Created attachment 376532 [details]
Patch
Comment 2 Yusuke Suzuki 2019-08-16 13:36:53 PDT
Comment on attachment 376532 [details]
Patch

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

> Source/JavaScriptCore/builtins/PromisePrototype.js:72
> +        @throwTypeError("|this| is not a object");

We pick `a object` since the other methods are using this... We should fix it in a separate patch in a bulk manner.
Comment 3 Mark Lam 2019-08-16 13:39:41 PDT
Comment on attachment 376532 [details]
Patch

r=me
Comment 4 Yusuke Suzuki 2019-08-16 13:44:11 PDT
I also added a test passing `non-object` to finally to check the thrown error.
Comment 5 Yusuke Suzuki 2019-08-16 13:44:46 PDT
Committed r248793: <https://trac.webkit.org/changeset/248793>
Comment 6 Radar WebKit Bug Importer 2019-08-16 13:45:18 PDT
<rdar://problem/54405556>