Skip to content

Commit

Permalink
do not warn if the promise is not chained
Browse files Browse the repository at this point in the history
  • Loading branch information
petkaantonov committed Mar 7, 2016
1 parent 42cfccf commit 8a6a4f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/debuggability.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ function checkForgottenReturns(returnValue, promiseCreated, name, promise,
if (returnValue === undefined && promiseCreated !== null &&
wForgottenReturn) {
if (parent !== undefined && parent._returnedNonUndefined()) return;
var bitField = promise._bitField;
if (BIT_FIELD_READ(LENGTH_MASK) === 0) return;

if (name) name = name + " ";
var msg = "a promise was created in a " + name +
Expand Down

2 comments on commit 8a6a4f0

@steida
Copy link

@steida steida commented on 8a6a4f0 Mar 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I spent several hours with that.

@steida
Copy link

@steida steida commented on 8a6a4f0 Mar 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For google bot:

"Warning: a promise was created in a handler but was not returned from it" is fixed now.

Please sign in to comment.