Skip to content

Generator bind breaks argument passing #2

@basickarl

Description

@basickarl
var genbind = require('generator-bind');
function* myGen(i) {
    console.log('myGen',this.x, i);
}
//myGen = genbind({x:666}, myGen);
myGen(9).next();

The code above echos myGen undefined 9 as expected.

var genbind = require('generator-bind');
function* myGen(i) {
    console.log('myGen',this.x, i);
}
myGen = genbind({x:666}, myGen);
myGen(9).next();

The code above echos myGen 666 undefined, I was expecting myGen 666 9.

I'm wondering if I'm using this module incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions