Closed juandopazo closed 7 years ago
The easiest solution here is for you to use browserify or webpack to replace function-bind
with a module that exports Function.prototype.bind
, since you are in a position to know that's supported for your environments.
What might be a reasonable middle ground, however, is adding a new entry point to function-bind, such that one could do require('function-bind/minimal')
or something, and then update this module to use that - that way CSP wouldn't complain.
Hi!
function-bind
is a very good implementation that follows the spec very closely. The problem is that in order to follow the spec it must useeval
to ensure the bound function has a correctlength
property. This is an issue in environments that use Content Security Policy to blockeval
.However,
object.assign
doesn't really need that behavior, or anything related tonew
for that matter, so a minimalbind
implementation is enough for it. This PR removes the dependency onfunction-bind
and replaces it with a very naivebind
function.Thoughts?