polyfill() does not polyfill Promise.prototype.finally() if the environment already has a Promise implementation.
See original GitHub issueIn polyfill.js
, observe line 30: https://github.com/stefanpenner/es6-promise/blob/master/lib/es6-promise/polyfill.js#L30
As I understand it, if a Promise implementation is found on the global object, then the polyfill will use the global object’s Promise implementation as-is, not augmenting it with the stage 4 ES9/ES2018 feature proposal provided in this library, Promise.prototype.finally()
.
Is this intended behaviour, or a bug? Surely if I have polyfilled es6-promise
, I should be getting at least all the advertised features of es6-promise
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:6
Top Results From Across the Web
How to add a polyfill to support finally() in Edge?
A finally callback will not receive any argument, since there's no reliable means of determining if the promise was fulfilled or rejected.
Read more >Source: util/es6-promise.js - NASA WorldWind
@overview es6-promise - a tiny implementation of Promises/A+. ... function useSetTimeout() {; // Store setTimeout reference so es6-promise will be ...
Read more >Usage Guide - Babel.js
This guide will show you how to compile your JavaScript application code that uses ES2015+ syntax into code that works in current browsers....
Read more >Javascript – How to add a polyfill to support finally() in Edge ...
However the finally() method does not work in MS Edge. ... test('native'); // force Promise to use the polyfill implementation Promise.prototype.finally ...
Read more >es6-promise | Yarn - Package Manager
This is a polyfill of the ES6 Promise. The implementation is a subset of rsvp.js extracted by @jakearchibald, if you're wanting extra features...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@YurySolovyov
require('es6-promise/auto')
is just an alias forrequire('es6-promise').polyfill()
, so this issue affects both usages.Thank you!