mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Avoid binding functions in _.createCallback if they don't reference this.
Former-commit-id: d491414e7e1536d3241a607ba07120f629ff2410
This commit is contained in:
3
build.js
3
build.js
@@ -1385,6 +1385,9 @@
|
||||
function removeRunInContext(source) {
|
||||
source = removeVar(source, 'contextProps');
|
||||
|
||||
// replace reference in `reThis` assignment
|
||||
source = source.replace(/\btest\(runInContext\)/, 'test(function() { return this; })');
|
||||
|
||||
// remove function scaffolding, leaving most of its content
|
||||
source = source.replace(matchFunction(source, 'runInContext'), function(match) {
|
||||
return match
|
||||
|
||||
Reference in New Issue
Block a user