Skip to content

Possible reflection issue in .each() and .filter() ? #1011

@iaean

Description

@iaean

Running the following snippet (see the full gist) via node

p0.then(function() {
  var p1 = delayResolve(500);
  var p2 = delayReject(300);
  var p3 = delayResolve(400);
  return Promise.all([p1,p2,p3].map(function(p) { return p.reflect(); })) })
.each(function(p) {
  return p.isFulfilled() ? p.value() : null; })
.then(function(r) {
  console.log(JSON.stringify(r)); });

results in

[{"_bitField":268435457,"_settledValue":500},
 {"_bitField":135266305,"_settledValue":300},
 {"_bitField":268435457,"_settledValue":400}]

other than the expected [500,null,400] produced by .map().

Is this a bug in bluebird's node branch or do I something wrong in composition?

I'm always excited to hear from you.
Best regards

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