Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Suspicious code in promise.ts #1168

Closed
shicks opened this issue Dec 8, 2018 · 1 comment · Fixed by #1171
Closed

Suspicious code in promise.ts #1168

shicks opened this issue Dec 8, 2018 · 1 comment · Fixed by #1171

Comments

@shicks
Copy link

shicks commented Dec 8, 2018

promise && (promise = null || resolve(value));

promise && (promise = null || reject(error));

I'm rolling out a new lint check and discovered some suspicious code in promise.ts. In the above snippets, null is always falsy, so it is ignored. It can be simplified to simply promise = resolve(value) or promise = reject(value).

@JiaLiPassion
Copy link
Collaborator

Thanks, I will fix it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants