Skip to content

Conversation

@CharlesHamel
Copy link

It should be a conditional expression instead of an assignment

It should be a conditional expression instead of an assignment
@nodesocket
Copy link

This looks like a good bug fix. Is this project still being maintained?

@ichiriac
Copy link

Hi @CharlesHamel and @nodesocket,

Nope, it's a bad fix. It's a trick in order to do 2 things in one line of code (by the way, it makes it less readable).

Example :

let foo;
if (foo = testFunction()) { 
  // .... do something with foo result
}

Is the same as :

let foo = testFunction();
if (foo) { 
  // .... do something with foo result
}

Your PR introduce a bug as : LINE 16 fieldType is not defined, LINE 17 fieldType so could not be used as an equality, and LINE 18, as it's not initialised, could not provide a fromBsonValue as it's undefined.

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