Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected a conditional expression and instead saw an assignment #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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