WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 149380
149477
PromiseSubclass.resolve does not "cast" correctly
https://bugs.webkit.org/show_bug.cgi?id=149477
Summary
PromiseSubclass.resolve does not "cast" correctly
Stefan Penner
Reported
2015-09-22 15:21:39 PDT
http://www.ecma-international.org/ecma-262/6.0/#sec-promise.resolve
the following lines of the spec text: 25.4.4.5.a 25.4.4.5.c Indicate class PromiseSubclass extends Promise { } PromiseSubclass.resolve(Promise.resolve()).constructor === PromiseSubclass; Unfortunately, today the following is true: PromiseSubclass.resolve(Promise.resolve()).constructor === Promise; Related patch to V8 ->
https://codereview.chromium.org/1362773002
Attachments
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2015-09-23 00:13:55 PDT
This is because the current Promise cannot be subclassible. We can fix this by using newTarget in C++ Promise constructor as a workaround. But ideally, this should be fixed by moving Promise to JS implemented constructor.
Alexey Shvayka
Comment 2
2020-04-03 11:04:04 PDT
Promise subclassing was implemented in
https://trac.webkit.org/changeset/191276
. Tests: JSTests/es6/Promise_is_subclassable_*.js JSTests/stress/derived-promise-constructor-*.js *** This bug has been marked as a duplicate of
bug 149380
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug