Skip to content

Promise.coroutine: yielding a function should not call the function #1314

@giltayar

Description

@giltayar
  1. What version of bluebird is the issue happening on?
    3.4.7

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32)
    Tested on Node 7, but I'm guessing it's true for all platforms

  3. Did this issue happen with earlier version of bluebird?
    Probably.

Given:

(Promise.coroutine(function*() {
  yield function () { console.log('hi'); };
}))();

You would not expect "hi" to be written to log, because we're yielding a value (which is a function), and not calling the function.

But it does print "hi". And then returns a rejected error.

I have prepared a pull-request that contains a fix, which I will submit in a few minutes.

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