babel / babel/babel-polyfills

Function 'finally' on prototype shouldn't polyfill 'promise'

Open
#96 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
357
Forks
62
PR merge metrics
No merged PRs in 30d

Description

When i define a 'finally' function on other function's prototype, why dist code includes "core-js/modules/es.promise.finally.js",
"core-js/modules/es.promise.js".

ex:

![image](https://user-images.githubusercontent.com/20663807/130187310-a5a8ff65-8521-400b-9790-6b81ae646422.png)

Contributor guide

Open the contributing guide

Research direction

Reproduce the example and inspect the generated dist output, especially the injected core-js/modules/es.promise.finally.js and es.promise.js modules. Trace why defining a finally function on another function's prototype is detected as Promise usage. Done means the example no longer adds Promise polyfills unless the source actually requires them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.