webpack / tapable

Just a little module for plugins.
MIT License
3.71k stars 393 forks source link

Why use _call and call in Hook class? #133

Closed daolou closed 3 years ago

daolou commented 3 years ago

image

I cannot understand why use two methods _call and call, and could remove _call、_callAsync and _promise?

Who can tell me why?

daolou commented 3 years ago

I guess with _* methods is the initial value, when need reset, it will assignment to without _ methods

alexander-akait commented 3 years ago

For architecture reasons? Please read code and look at logic, https://github.com/webpack/tapable/blob/master/lib/Hook.js#L130, keep them between compilations