Open chenjianzhonglol opened 3 years ago
I think we can skip the MemberExpression path if the it is in the left
of an AssignmentExpression
whose operator is =
?
It would work, even if somewhere that .finally
method is probably used so the es.promise.finally
polyfill will be added anyway.
I wonder why we add the polyfill for
function Test() {}
Test.prototype.finally = function() {}
but not for
Test.prototype.finally = function() {}
I think we can skip the MemberExpression path
It will break the monkey patching of built-in methods in some cases, for example testing.
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: