I have a function build
that synchronously returns an object, that in turn contains a function run
. This function returns a thunk and hence can be called using yield
and a library such as co
.
Basically the call looks like this:
yield build().run();
Now, the problem is that I want to make sure that the yield
refers to run
, not to build
. How do I do that, without introducing a temporary variable as in the following snippet?
var temp = build();
yield temp.run();
Any ideas?
PS: I'm running this code on Node.js 0.11.x using the ´--harmony´ flag.