Skip to content

Commit

Permalink
feat(COPromise.m): assert when fulfill or reject multitimes
Browse files Browse the repository at this point in the history
assert when fulfill or reject multitimes

fix alibaba#41
  • Loading branch information
pengyutang125 committed Mar 29, 2019
1 parent d72e79f commit 7cd46f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions coobjc/promise/COPromise.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ - (void)fulfill:(id)value {
_observers = nil;
}
else{
NSAssert(NO, @"Promise fulfill multitimes, you should check your logic");
return;
}

Expand Down Expand Up @@ -173,6 +174,7 @@ - (void)reject:(NSError *)error {
_observers = nil;
}
else{
NSAssert(NO, @"Promise reject multitimes, you should check your logic");
return;
}

Expand Down

0 comments on commit 7cd46f6

Please sign in to comment.