Skip to content

Conversation

cmerchant
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Mar 22, 2018

Coverage Status

Coverage increased (+0.4%) to 90.845% when pulling 003f8c9 on falseFix into 0baa8aa on master.


// resolve when a result is received
if (response && response.result) {
if (response && typeof response.result !== 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

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

the original if statement will actually properly filter if the response.result is truly undefined and this statement check is more specific and feels unnecessary in this case... was this a change for testing purposes that can be backed out?


// handle synchronous results
if (result && (!result.then || typeof result.then !== 'function')) {
if (typeof result !== 'undefined' && (!result.then || typeof result.then !== 'function')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above... if (result) will result in the same result as if (typeof result !== 'undefined'), but is more generic and a tad tighter in terms of implementation (plus more consistent with the rest of the code base). Is this a vestige from testing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I think I see... the issue is that the result from the call is actually a scalar boolean value of false. In this case, your code change makes sense.

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

Successfully merging this pull request may close these issues.

3 participants