Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up5.2 breaks ternary operator style #246
Comments
This comment has been minimized.
This comment has been minimized.
|
The ternary ( Sorry that this broke your tests -- hopefully this won't happen again. I don't think we have any more of these types of changes to release. See #248 for more discussion. |
feross
closed this
Sep 8, 2015
feross
added
the
question
label
Sep 8, 2015
This comment has been minimized.
This comment has been minimized.
|
Understood, thanks. |
This comment has been minimized.
This comment has been minimized.
timdp
commented
Sep 8, 2015
|
Just wondering what the reasoning behind this is. For example: var foo = (bar === 'test')
? baz()
: quux()If you don't look at lines 2 and 3, you don't know that My personal preference would be: var foo = (bar === 'test') ?
baz() :
quux()which bears a lot of similarity to e.g. var foo = bar + 'test' +
baz() +
quux()(You could obviously put everything on one line, but imagine longer statements ...) |
julien-f commentedSep 4, 2015
All my code suddenly failed to pass standard due to a change in standard 5.2 concerning the ternary operator: