Skip to content

_.bind supports _.partial application, but not its non pre-filled argument syntax with _ #2328

@Majeure

Description

@Majeure

I don't know if this is intended behavior, but it seems all around confusing if so. My guess is this portion of _.bind was just left untouched when _.partial received this functionality. Here's the simplified reproduction of it in jsfiddle: http://jsfiddle.net/j3jpL4eb/1/

var foo = function(bar) {
    console.log(bar); //this should always print 'bar' if non pre-filled arguments applied to bind's partial application as well, yet it has the value of underscore when not double wrapped
}

_.bind(foo, this, _)('bar'); //function (n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}
_.bind(_.partial(foo, _), this)('bar'); //bar

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions